diff options
Diffstat (limited to 'tests/run.sh')
| -rw-r--r-- | tests/run.sh | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/run.sh b/tests/run.sh index 1003e87..0835d9a 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -5,17 +5,26 @@ export ducc="../../../build/$BIN" export testcase=$1 export tmp_dir="tests/tmp/$testcase" -test_file="tests/$testcase.sh" +c_test_file="tests/$testcase.c" +sh_test_file="tests/$testcase.sh" -if [[ ! -f "$test_file" ]]; then +if [[ -f "$c_test_file" ]]; then + source tests/helpers.sh + + echo "$c_test_file" + mkdir -p "$tmp_dir" + cd "$tmp_dir" + test_exit_code < "../../../$c_test_file" + cd "../../.." +elif [[ -f "$sh_test_file" ]]; then + source tests/helpers.sh + + echo "$sh_test_file" + mkdir -p "$tmp_dir" + cd "$tmp_dir" + source "../../../$sh_test_file" + cd "../../.." +else echo "no test $testcase" >&2 exit 1 fi - -source tests/helpers.sh - -echo "$test_file" -mkdir -p "$tmp_dir" -cd "$tmp_dir" -source "../../../$test_file" -cd "../../.." |
