From 54db532879ed3f6d76463a3ab3f3895bd41c861c Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Fri, 14 Feb 2025 19:01:21 +0100 Subject: feat(test): Add test runner (debug is ok, 2 failures in release) --- generate.fish | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 generate.fish (limited to 'generate.fish') diff --git a/generate.fish b/generate.fish new file mode 100644 index 0000000..1994cc9 --- /dev/null +++ b/generate.fish @@ -0,0 +1,24 @@ +echo "" > test.c; +set fs (ls test_*.c); +for f in $fs; + echo "#include \"$f\"" >> test.c; +end; +echo -e "" >> test.c +cat base_test.c >> test.c; +echo -e "" >> test.c; +echo "int main() {" >> test.c; +for f in $fs; + echo "Parsing $f"; + set funcs (rg 'char test_' $f); + for func in $funcs; + set pfunc (echo $func | awk '{match($0, /test_[^(]+/); print substr($0, RSTART, RLENGTH)}'); + echo "Found $pfunc in $f"; + echo " test($pfunc);" >> test.c + end; +end; +echo " + printf(\"Success: %d, Failures: %d\n\", success, failures); + + return failures; +} +" >> test.c; -- cgit v1.3