From f139fff6ae7063c1965fa3085bb2585d7d838d72 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 30 Oct 2024 13:34:18 +0200 Subject: rpc actually marks and unmarks stack regions + Processes won't be able to read previous stack frames etc --- tests/scripts/gen-tests | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 tests/scripts/gen-tests (limited to 'tests/scripts/gen-tests') diff --git a/tests/scripts/gen-tests b/tests/scripts/gen-tests new file mode 100755 index 0000000..7095e30 --- /dev/null +++ b/tests/scripts/gen-tests @@ -0,0 +1,29 @@ +#!/bin/sh + +mkdir -p $(for d in "${@}"; do echo $d; done | sed "s|^|build/|") +mkdir -p $(for d in "${@}"; do echo $d; done | sed "s|^|reports/|") + +for NAME in "${@}"; do + echo "build/$NAME/init.d:" >> tests.mk + echo "-include build/$NAME/init.d" >> tests.mk + + echo "build/$NAME/init: $NAME/init.c \$(COMMON) \$(KMI)" >> tests.mk + echo " \$(COMPILE_TEST) $NAME/init.c \$(COMMON) -o build/$NAME/init" >> tests.mk + + echo "build/$NAME/initrd: build/$NAME/init" >> tests.mk + echo " echo build/$NAME/init | \$(GEN_INITRD) build/$NAME/initrd" >> tests.mk + + echo "reports/$NAME/log: build/$NAME/initrd" >> tests.mk + echo " timeout --foreground 30s \$(QEMU) \ + build/$NAME/initrd > reports/$NAME/log" >> tests.mk + + echo "reports/$NAME/OK: reports/$NAME/log" >> tests.mk + echo " grep 'BUG' reports/$NAME/log \\" >> tests.mk + echo " && echo 'BUG' > reports/$NAME/log \\" >> tests.mk + echo " || tail -n1 reports/$NAME/log | tr -d '\\\\r' \\" >> tests.mk + echo " > reports/$NAME/OK" >> tests.mk + + echo "TESTS += $NAME" >> tests.mk + echo ".PHONY: $NAME" >> tests.mk + echo "$NAME: reports/$NAME/OK" >> tests.mk +done -- cgit v1.3