Refactored a handful of things in tests

- Now test errors have correct line reporting! #line directives
  are passed to the compiler that reference the relevant line in
  the test case shell script.

  --- Multi-block directory ---
  ./tests/test_dirs.sh:109: assert failed with 0, expected 1
      lfs_unmount(&lfs) => 1

- Cleaned up the number of implicit global variables provided to
  tests. A lot of these were infrequently used and made it difficult
  to remember what was provided. This isn't an MCU, so there's very
  little cost to stack allocations when needed.

- Minimized the results.py script (previously stats.py) output to
  match minimization of test output.
This commit is contained in:
Christopher Haster
2019-07-26 11:11:34 -05:00
parent 1aaf1cb6c0
commit 72e3bb4448
18 changed files with 1011 additions and 936 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/bash
set -eu
export TEST_FILE=$0
trap 'export TEST_LINE=$LINENO' DEBUG
echo "=== Orphan tests ==="
rm -rf blocks
@@ -41,5 +43,4 @@ scripts/test.py << TEST
lfs_unmount(&lfs) => 0;
TEST
echo "--- Results ---"
scripts/stats.py
scripts/results.py