OSDN Git Service

tests: Inject test name also when the test fails
authorHavard Skinnemoen <hskinnemoen@google.com>
Sun, 28 Jun 2020 21:30:46 +0000 (14:30 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jul 2020 22:02:15 +0000 (18:02 -0400)
If a test is unsuccessful, the result is "not ok", which does not match
the regex because it includes a space.

This regex matches both "ok" and "not ok".

Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
Message-Id: <20200628213046.2028271-1-hskinnemoen@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/Makefile.include

index 3f4448a..09df2d3 100644 (file)
@@ -637,7 +637,7 @@ define do_test_tap
           { export MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$(( $${RANDOM:-0} % 255 + 1))} $2; \
             $(foreach COMMAND, $1, \
              $(COMMAND) -m=$(SPEED) -k --tap < /dev/null \
-             | sed "s/^[a-z][a-z]* [0-9]* /&$(notdir $(COMMAND)) /" || true; ) } \
+             | sed "s/^\(not \)\?ok [0-9]* /&$(notdir $(COMMAND)) /" || true; ) } \
              | ./scripts/tap-merge.pl | tee "$@" \
              | ./scripts/tap-driver.pl $(if $(V),, --show-failures-only), \
          "TAP","$@")