From 1a0d61b33c2365cf413bf584289058d0d9097377 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 17 Jul 2024 22:02:47 +0300 Subject: make tests a bit more sensible + At least by my standards. Some amount of scripting going on, but should still be fine. Effectively, source.mk contains information to build the test, check.mk checks the generated log from running the test. As a results, check.mk should output OK into reports/$TEST/OK if everything went well, and anything else otherwise. The user can then look at reports/$TEST/log to see what went wrong. I expect to add some more features, such as starting QEMU with gdb and running a single test a bit easier than right now (same limitation as in the top level makefile, i.e. you have to specify make -f scripts/makefile $TEST from within `tests` and you must have ran `make check` at that point so that `tests.mk` is fully generated. Not huge issues, but slightly annoying, somewhat unsure how to work around them properly but we'll see. --- tests/hello-world/check.mk | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/hello-world/check.mk (limited to 'tests/hello-world/check.mk') diff --git a/tests/hello-world/check.mk b/tests/hello-world/check.mk new file mode 100644 index 0000000..7fbabc9 --- /dev/null +++ b/tests/hello-world/check.mk @@ -0,0 +1,5 @@ +REPORT := reports/hello-world +hello-world: do-hello-world + @grep 'Hello, world!' $(REPORT)/log > /dev/null \ + && echo "OK" > $(REPORT)/OK \ + || echo "ERR" > $(REPORT)/ERR -- cgit v1.3