From 41d24c967eb5fce3f811fc567f60204c77dada15 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 8 Jan 2026 00:18:34 +0900 Subject: refactor: rewrite some tests in C --- tests/run.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'tests/run.sh') 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 "../../.." -- cgit v1.2.3-70-g09d2