aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/Makefile
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2018-05-21 10:38:37 +0100
committerAlex Bennée <alex.bennee@linaro.org>2018-06-20 20:22:34 +0100
commit607bf9b5a5245563a80cb9484f2fd85d58c46fdc (patch)
tree929327d71eae2409a588c6729fc69d7d320ba6b0 /tests/tcg/Makefile
parent8ba0a8206a3f7b9870890c99d3222eceffd018a9 (diff)
downloadqemu-607bf9b5a5245563a80cb9484f2fd85d58c46fdc.zip
qemu-607bf9b5a5245563a80cb9484f2fd85d58c46fdc.tar.gz
qemu-607bf9b5a5245563a80cb9484f2fd85d58c46fdc.tar.bz2
tests/tcg: add run, diff, and skip helper macros
As we aren't using the default runners for all the test cases it is easy to miss out things like timeouts. To help with this we add some helpers and use them so we only need to make core changes in one place. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'tests/tcg/Makefile')
-rw-r--r--tests/tcg/Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
index e7dbcdb..bf06415 100644
--- a/tests/tcg/Makefile
+++ b/tests/tcg/Makefile
@@ -34,6 +34,15 @@
quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
+# $1 = test name, $2 = cmd, $3 = desc
+run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
+
+# $1 = test name, $2 = reference
+diff-out = $(call quiet-command, diff -u $1.out $2 | head -n 10,"DIFF","$1.out with $2")
+
+# $1 = test name, $2 = reason
+skip-test = @printf " SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2
+
# Tests we are building
TESTS=
@@ -84,9 +93,7 @@ RUN_TESTS=$(patsubst %,run-%, $(TESTS))
RUN_TESTS+=$(EXTRA_RUNS)
run-%: %
- $(call quiet-command, \
- timeout $(TIMEOUT) $(QEMU) $< > $<.out, \
- "TEST", "$< on $(TARGET_NAME)")
+ $(call run-test, $<, $(QEMU) $<, "$< on $(TARGET_NAME)")
.PHONY: run
run: $(RUN_TESTS)