From 7790e27b3423901e2080bfd3c600a65a48d42886 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 1 May 2026 18:37:38 +0300 Subject: start adding proper tests --- tests/scripts/gen-xfail | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 tests/scripts/gen-xfail (limited to 'tests/scripts/gen-xfail') diff --git a/tests/scripts/gen-xfail b/tests/scripts/gen-xfail new file mode 100755 index 0000000..c4cf382 --- /dev/null +++ b/tests/scripts/gen-xfail @@ -0,0 +1,29 @@ +#!/bin/sh + +mkdir -p $(for d in "${@}"; do echo "$d"; done \ + | sed "s|,.*||" | uniq | sed "s|^|reports/|") + +for s in "${@}" +do + NAME=${s%%,*} + EMSG=${s#${NAME},} + echo ".PHONY: $NAME" >> tests.mk + echo "$NAME:" >> tests.mk + echo " ../fwd $NAME/$NAME.fwd \\" >> tests.mk + echo " > reports/$NAME/gen.c 2> reports/$NAME/log \\" >> tests.mk + echo " && echo 'Wrong retval' > reports/$NAME/OK \\" >> tests.mk + echo " || :" >> tests.mk + echo " grep '$EMSG' reports/$NAME/log > /dev/null \\" >> tests.mk + echo " && echo OK > reports/$NAME/OK \\" >> tests.mk + echo " || echo EMSG > reports/$NAME/OK" >> tests.mk +done + +echo -n "TESTS +=" >> tests.mk +for s in "${@}" +do + NAME=${s%%,*} + echo -n " $NAME" >> tests.mk +done + +# append newline +echo "" >> tests.mk -- cgit v1.2.3