aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/Makefile.target
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-09-29 12:42:03 +0100
committerAlex Bennée <alex.bennee@linaro.org>2022-10-06 11:53:40 +0100
commitc6cf8a20521c7114893042cb7c75866bd07838ae (patch)
treec41a24825625f1d6d4ebd10f8b51a2b7adc7d839 /tests/tcg/Makefile.target
parent37b0dba45c4e44a02000a4170f25af0110f501d5 (diff)
tests/tcg: clean up calls to run-test
Almost all invocations of run-test have either "$* on $(TARGET_NAME)" or "$< on $(TARGET_NAME)" as the last argument. So provide a default test name, while allowing an escape hatch for custom names. As an additional simplification, remove the need to do shell quoting. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220929114231.583801-24-alex.bennee@linaro.org>
Diffstat (limited to 'tests/tcg/Makefile.target')
-rw-r--r--tests/tcg/Makefile.target21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index c14eca82c2..cd0a2ad873 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -41,14 +41,16 @@ endif
# for including , in command strings
COMMA := ,
-quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
+quiet-@ = $(if $(V),,@$(if $1,printf " %-7s %s\n" "$(strip $1)" "$(strip $2)" && ))
+quiet-command = $(call quiet-@,$2,$3)$1
# $1 = test name, $2 = cmd, $3 = desc
ifeq ($(filter %-softmmu, $(TARGET)),)
run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out, \
- "TEST",$3)
+ TEST,$(or $3, $*, $<) on $(TARGET_NAME))
else
-run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2, \
+ TEST,$(or $3, $*, $<) on $(TARGET_NAME))
endif
# $1 = test name, $2 = reference
@@ -56,7 +58,7 @@ endif
# we know it failed and then force failure at the end.
diff-out = $(call quiet-command, diff -q $1.out $2 || \
(diff -u $1.out $2 | head -n 10 && false), \
- "DIFF","$1.out with $2")
+ DIFF,$1.out with $2)
# $1 = test name, $2 = reason
skip-test = @printf " SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2
@@ -155,21 +157,19 @@ RUN_TESTS+=$(EXTRA_RUNS)
ifeq ($(filter %-softmmu, $(TARGET)),)
run-%: %
- $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)")
+ $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<)
run-plugin-%:
$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
-d plugin -D $*.pout \
- $(call strip-plugin,$<), \
- "$* on $(TARGET_NAME)")
+ $(call strip-plugin,$<))
else
run-%: %
$(call run-test, $<, \
$(QEMU) -monitor none -display none \
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
- $(QEMU_OPTS) $<, \
- "$< on $(TARGET_NAME)")
+ $(QEMU_OPTS) $<)
run-plugin-%:
$(call run-test, $@, \
@@ -177,8 +177,7 @@ run-plugin-%:
-chardev file$(COMMA)path=$@.out$(COMMA)id=output \
-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
-d plugin -D $*.pout \
- $(QEMU_OPTS) $(call strip-plugin,$<), \
- "$* on $(TARGET_NAME)")
+ $(QEMU_OPTS) $(call strip-plugin,$<))
endif
gdb-%: %