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 19:39:44 +00:00
|
|
|
|
# listing directory tests
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=40 exa -lG’ produces a grid with details of 1 column"
|
|
|
|
|
shell = "exa -lG /testcases/files"
|
|
|
|
|
environment = { COLUMNS = "40" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_1col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=80 exa -lG’ produces a grid with details of 1 column"
|
|
|
|
|
shell = "exa -lG /testcases/files"
|
|
|
|
|
environment = { COLUMNS = "80" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_1col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=120 exa -lG’ produces a grid with details of 2 columns"
|
|
|
|
|
shell = "exa -lG /testcases/files"
|
|
|
|
|
environment = { COLUMNS = "120" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_2col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=160 exa -lG’ produces a grid with details of 3 columns"
|
|
|
|
|
shell = "exa -lG /testcases/files"
|
|
|
|
|
environment = { COLUMNS = "160" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_3col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=200 exa -lG’ produces a grid with details of 4 columns"
|
|
|
|
|
shell = "exa -lG /testcases/files"
|
|
|
|
|
environment = { COLUMNS = "200" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_4col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# listing files tests
|
|
|
|
|
# (these rely on bash’s glob sort order)
|
|
|
|
|
# (some of the output files also have trailing whitespace)
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=100 exa -lG’ with file arguments produces a grid with details of 1 column, with full paths"
|
|
|
|
|
shell = "exa -lG /testcases/files/*"
|
|
|
|
|
environment = { COLUMNS = "100" }
|
|
|
|
|
stdout = { file = "outputs/files_paths_long_grid_1col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=150 exa -lG’ with file arguments produces a grid with details of 2 columns, with full paths"
|
|
|
|
|
shell = "exa -lG /testcases/files/*"
|
|
|
|
|
environment = { COLUMNS = "150" }
|
|
|
|
|
stdout = { file = "outputs/files_paths_long_grid_2col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=200 exa -lG’ with file arguments produces a grid with details of 3 columns, with full paths"
|
|
|
|
|
shell = "exa -lG /testcases/files/*"
|
|
|
|
|
environment = { COLUMNS = "200" }
|
|
|
|
|
stdout = { file = "outputs/files_paths_long_grid_3col.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
2021-01-10 15:52:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# check if exa is using the minimum number of columns with headers
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
2021-04-09 14:29:31 +00:00
|
|
|
|
name = "‘COLUMNS=200 exa -lGh’ with one file don’t produce extra columns even if there place for more"
|
2021-01-10 15:52:49 +00:00
|
|
|
|
shell = "exa -lGh /testcases/files/10_bytes"
|
|
|
|
|
environment = { COLUMNS = "200" }
|
2021-04-09 15:24:33 +00:00
|
|
|
|
stdout = { file = "outputs/files_long_grid_header_1file.ansitxt" }
|
2021-01-10 15:52:49 +00:00
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
2021-04-09 14:29:31 +00:00
|
|
|
|
name = "‘COLUMNS=200 exa -lGh’ with several files don’t produce extra columns even if there place for more"
|
2021-01-10 15:52:49 +00:00
|
|
|
|
shell = "exa -lGh /testcases/files/10_{bytes,KiB}"
|
|
|
|
|
environment = { COLUMNS = "200" }
|
2021-04-09 15:24:33 +00:00
|
|
|
|
stdout = { file = "outputs/files_long_grid_header_2files.ansitxt" }
|
2021-01-10 15:52:49 +00:00
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
2021-04-09 15:40:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# check if EXA_GRID_ROWS is working
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=200 EXA_GRID_ROWS=2 exa -lG’ with three files produces a grid details of 1 column"
|
|
|
|
|
shell = "exa -lG /testcases/files/1_*"
|
|
|
|
|
environment = { COLUMNS = "200", EXA_GRID_ROWS = "2" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_exa_grid_rows_2_3files.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=200 EXA_GRID_ROWS=5 exa -lG’ with 15 files produces a grid details of 3 columns"
|
|
|
|
|
shell = "exa -lG /testcases/files/1*"
|
|
|
|
|
environment = { COLUMNS = "200", EXA_GRID_ROWS = "5" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_exa_grid_rows_5_15files.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘COLUMNS=200 EXA_GRID_ROWS=6 exa -lG’ with 15 files produces a grid details of 1 column"
|
|
|
|
|
shell = "exa -lG /testcases/files/1*"
|
|
|
|
|
environment = { COLUMNS = "200", EXA_GRID_ROWS = "6" }
|
|
|
|
|
stdout = { file = "outputs/files_long_grid_exa_grid_rows_6_15files.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'env', 'long', 'grid' ]
|