exa/xtests/grid-view.toml
Benjamin Sago 61c5df7c11 Use Specsheet for the extended tests
This commit changes the way the extended test suite is run.

Previously, there was a folder full of outputs, and a script that ran exa repeatedly to check the outputs match. This script was hacked-together, with many problems:

• It stops at the first failure, so if one test fails, you have no idea how many actually failed.
• It also didn't actually show you the diff if one was different, it just checked it.
• It combined stdout and stderr, and didn't test the exit status of exa.
• All the output file names were just whatever I felt like calling the file at the time.
• There is no way to only run a few of the tests — you have to run the whole thing each time.
• There's no feel-good overall view where you see how many tests are passing.

I started writing Specsheet to solve this problem (amongst other problems), and now, three and a half years later, it's finally ready for prime time.

The tests are now defined as data rather than as a script. The outputs have a consistent naming convention (directory_flags.ansitxt), and they check stdout, stderr, and exit status separately. Specsheet also lets simple outputs (empty, non-empty, or one-line error messages) can be written inline rather than needing to be in files.

So even though this pretty much runs the same tests as the run.sh script did, the tests are now more organised, making it easy to see where tests are missing and functionality is not being tested.
2020-10-17 21:12:18 +01:00

125 lines
3.3 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# file name tests
[[cmd]]
name = "exa produces a grid of file names"
shell = "exa /testcases/file-names"
environment = { COLUMNS = "80" }
stdout = { file = "outputs/names_grid.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "exa -x produces an across grid of file names"
shell = "exa -x /testcases/file-names"
environment = { COLUMNS = "80" }
stdout = { file = "outputs/names_grid_across.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid', 'across' ]
# recurse tests
[[cmd]]
name = "exa -R produces several grids of file names"
shell = "exa -R /testcases/file-names"
environment = { COLUMNS = "80" }
stdout = { file = "outputs/names_grid_recurse.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid', 'recurse' ]
# symlink tests
[[cmd]]
name = "exa highlights symlinks and broken symlinks"
shell = "exa /testcases/links"
environment = { COLUMNS = "80" }
stdout = { file = "outputs/links_grid.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
# columns and width tests
[[cmd]]
name = "COLUMNS=40 exa produces a grid of 4 columns"
shell = "exa /testcases/files"
environment = { COLUMNS = "40" }
stdout = { file = "outputs/files_grid_4col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "COLUMNS=80 exa produces a grid of 8 columns"
shell = "exa /testcases/files"
environment = { COLUMNS = "80" }
stdout = { file = "outputs/files_grid_8col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "COLUMNS=120 exa produces a grid of 13 columns"
shell = "exa /testcases/files"
environment = { COLUMNS = "120" }
stdout = { file = "outputs/files_grid_13col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "COLUMNS=160 exa produces a grid of 13 columns"
shell = "exa /testcases/files"
environment = { COLUMNS = "160" }
stdout = { file = "outputs/files_grid_13col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "COLUMNS=200 exa produces a grid of 20 columns"
shell = "exa /testcases/files"
environment = { COLUMNS = "200" }
stdout = { file = "outputs/files_grid_20col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
# columns and width tests with files
# (these rely on bashs glob sort order)
# (some of the output files also have trailing whitespace)
[[cmd]]
name = "COLUMNS=100 exa with file arguments produces a grid of 3 columns, with full paths"
shell = "exa /testcases/files/*"
environment = { COLUMNS = "100" }
stdout = { file = "outputs/files_paths_grid_3col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "COLUMNS=150 exa with file arguments produces a grid of 5 columns, with full paths"
shell = "exa /testcases/files/*"
environment = { COLUMNS = "150" }
stdout = { file = "outputs/files_paths_grid_5col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]
[[cmd]]
name = "COLUMNS=200 exa with file arguments produces a grid of 7 columns, with full paths"
shell = "exa /testcases/files/*"
environment = { COLUMNS = "200" }
stdout = { file = "outputs/files_paths_grid_7col.ansitxt" }
stderr = { empty = true }
status = 0
tags = [ 'env', 'grid' ]