Sandro-Alessio Gierens d7ec416cf7 ci: help text in xtests il y a 2 ans
..
features 8c34b46a22 Version output changes il y a 4 ans
outputs d7ec416cf7 ci: help text in xtests il y a 2 ans
README.md 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
attributes.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
colour-term.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
debug-logging.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
details-view-dates.toml 32b2c5b2f3 add test for far future dates il y a 2 ans
details-view-filesizes.toml d19d66d57a Fix device IDs test so it works every time il y a 4 ans
details-view-passwd.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
details-view-permissions.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
details-view.toml dbd11d3804 Add classify char to symlink targets il y a 4 ans
dotfiles.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
errors.toml b1c49341c0 Add tests for common command-line errors il y a 4 ans
git-ignore.toml 06c899cac0 More git-ignore xtests il y a 5 ans
git.toml fe11b9d319 Fix panic on non UTF-8 file when using Git il y a 4 ans
grid-details-view.toml beaf561086 Add xtests for EXA_GRID_ROWS il y a 4 ans
grid-view.toml da171c405f Fix argument sorting in test outputs il y a 4 ans
help.toml 701a2e60e5 Add 'exa: ' before all command-line errors il y a 4 ans
icons.toml 51be9f4c43 Introduce EXA_ICON_SPACING environment variable il y a 5 ans
ignore-glob.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
input-options.toml 1d950086bc Resolves #270: add support for --time-style=relative il y a 2 ans
lines-view.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
run.sh 4dcf927622 test: change to /usr/bin/env bash il y a 2 ans
sorting.toml cfa00bf4b2 Fix new tests il y a 5 ans
themes.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans
tree-view.toml 61c5df7c11 Use Specsheet for the extended tests il y a 5 ans

README.md

exa › xtests

These are the extended tests. They are integration tests: they run the exa binary with select configurations of parameters and environment variables, and assert that the program prints the correct text to standard output and error, and exits with the correct status code.

They test things like:

  • broken symlinks
  • extended attributes
  • file names with weird stuff like newlines or escapes in
  • invalid UTF-8
  • missing users and groups
  • nested Git repositories

They are intended to be run from the Vagrant VM that has already had its environment set up — see the devtools/dev-create-test-filesystem.sh script for how the files are generated.

Anatomy of the tests

The tests are run using Specsheet. The TOML files define the tests, and the files in output/ contain the output that exa should produce.

For example, let’s look at one of the tests in lines-view.toml. This test checks that running exa does the right thing when running with the -1 argument, and a directory full of files:

[[cmd]]
name = "‘exa -1’ displays file names, one on each line"
shell = "exa -1 /testcases/file-names"
stdout = { file = "outputs/names_lines.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'oneline' ]

Here’s an explanation of each line:

  1. The [[cmd]] line marks this test as a cmd check, which can run arbitrary commands. In this case, the commad is exa with some arguments.

  2. The name field is a human-readable description of the feature of exa that’s under test. It gets printed to the screen as tests are run.

  3. The shell field contains the shell script to execute. It should have exa in there somewhere.

  4. The stdout field describes the content that exa should print to standard output. In this case, the test asserts that the output of running the program should be identical to the contents of the file.

  5. The stderr field describes the content of standard error. In this case, it asserts that nothing is printed to stderr.

  6. The status field asserts that exa should exit with a status code of 0.

  7. The tags field does not change the test at all, but can be used to filter which tests are run, instead of running all of them each time.