diff mbox series

tests: Inject test name also when the test fails

Message ID 20200628213046.2028271-1-hskinnemoen@google.com (mailing list archive)
State New, archived
Headers show
Series tests: Inject test name also when the test fails | expand

Commit Message

Havard Skinnemoen June 28, 2020, 9:30 p.m. UTC
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>
---
 tests/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini June 29, 2020, 3:17 p.m. UTC | #1
On 28/06/20 23:30, Havard Skinnemoen wrote:
> 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>
> ---
>  tests/Makefile.include | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 3f4448a20b..09df2d3f86 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -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","$@")
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 3f4448a20b..09df2d3f86 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -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","$@")