diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-20 16:08:48 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-12-08 13:55:21 +0100 |
| commit | ca1f89a7fad186eb2bd4da86d0cd28b5a0137bef (patch) | |
| tree | 028f3ff79d836c599af18138f63218c5730bfb82 /validation | |
| parent | 1af475f2ef8fa9f4bcc3a3cb048c1566b49baa71 (diff) | |
| download | sparse-dev-ca1f89a7fad186eb2bd4da86d0cd28b5a0137bef.tar.gz | |
testsuite: allow to test only a subdir
During development, it is very useful to be able to run only
some of the tests, maybe a whole class.
Help this by allowing to run the testsuite on only a subdir
of the 'validation/' directory.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rwxr-xr-x | validation/test-suite | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/validation/test-suite b/validation/test-suite index 854ad8ad..098cc786 100755 --- a/validation/test-suite +++ b/validation/test-suite @@ -238,6 +238,7 @@ echo " -q|--quiet Be extra quiet while running the tests." echo echo "commands:" echo " [file ...] Runs the test suite on the given file(s)." +echo " If a directory is given, run only those files." echo " If no file is given, run the whole testsuite." echo " single file Run the test in 'file'." echo " format file [name [cmd]] Help writing a new test case using cmd." @@ -517,10 +518,6 @@ while [ "$#" -gt "0" ]; do shift continue ;; - *.c) - tests_list="$@" - break - ;; single|--single) arg_file "$2" @@ -537,10 +534,25 @@ while [ "$#" -gt "0" ]; do do_format "$@" exit 0 ;; - help | *) + help) do_usage exit 1 ;; + + *.c) + tests_list="$tests_list $1" + shift + continue + ;; + *) + if [ ! -d "$1" ]; then + do_usage + exit 1 + fi + tests_list="$tests_list $(find "$1" -name '*.c' | sort)" + shift + continue + ;; esac break done |
