From 5317f7c795830d7662a8c3e4b9f154dbb13bf6da Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 30 Jan 2021 22:18:43 -0500 Subject: [PATCH] bash_tap: Implement mechanism to mark a test as expected failure Test author can now mark a bash tap test as expected failure by setting EXPFAIL environment variable to a non-zero value. --- test/bash_tap.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/bash_tap.sh b/test/bash_tap.sh index 3e53c84e3..70a2a2803 100644 --- a/test/bash_tap.sh +++ b/test/bash_tap.sh @@ -7,7 +7,14 @@ function bashtap_on_error { # A command in the parent script failed, interpret this as a test failure. # $bashtap_line contains the last executed line, or an error. echo -n "$bashtap_output" - echo "not ok 1 - ${bashtap_line}" + + # Determine if this failure was expected + if [[ ! -z "$EXPFAIL" ]] + then + todo_suffix=" # TODO" + fi + + echo "not ok 1 - ${bashtap_line}${todo_suffix}" bashtap_clean_tmpdir }