diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2023-10-01 03:19:18 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-10-24 09:20:32 +0200 |
commit | 6de46d746e4932b7aa339fb251fc6b5f5cc51413 (patch) | |
tree | 479fe27da69b8225175d253b19287506632186f0 | |
parent | wsd: log TCP_NODELAY error only once (diff) | |
download | online-6de46d746e4932b7aa339fb251fc6b5f5cc51413.tar.gz online-6de46d746e4932b7aa339fb251fc6b5f5cc51413.zip |
wsd: test: better run_unit.sh
Unfotunately, if our custom test driver run_unit.sh
fails, the report isn't generated at all.
So, instead, we have to go back to parsing the trs
file to detect success and failure.
We now make fast-fail an option instead.
Also fixes a typo in run_unit_standalone.sh.
Change-Id: I337c2a3edceda01df5f9c13c83eb176930b07e34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
-rwxr-xr-x | scripts/run-wsdunit | 2 | ||||
-rwxr-xr-x | test/run_unit.sh.in | 8 | ||||
-rwxr-xr-x | test/run_unit_standalone.sh.in | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/scripts/run-wsdunit b/scripts/run-wsdunit index b0f0eab9ca..9e529b7033 100755 --- a/scripts/run-wsdunit +++ b/scripts/run-wsdunit @@ -35,7 +35,7 @@ do echo ">>> $(date +%b-%d) @ $(date +%H:%M:%S) Run #$i (of $limit):"; ./coolwsd --disable-cool-user-checking --cleanup &> /dev/null (cd test && ./run_unit.sh --test-name $name.la --log-file $name.log --trs-file $name.trs --color-tests yes --enable-hard-errors yes --expect-failure no -- ./$name.la) - if test $? -eq 0; then + if test $? -eq 0 && grep -q PASS test/$name.trs; then ((pass=pass+1)); fi; echo; diff --git a/test/run_unit.sh.in b/test/run_unit.sh.in index 0d4654b5c0..10ee948de9 100755 --- a/test/run_unit.sh.in +++ b/test/run_unit.sh.in @@ -20,6 +20,7 @@ lo_path="@LO_PATH@" valgrind_cmd="valgrind --tool=memcheck --trace-children=no -v --read-var-info=yes" verbose='' capabilities="@ENABLE_SETCAP@" +fail_fast='' if test "h$capabilities" != "htrue"; then capabilities=false @@ -38,6 +39,7 @@ print_help () echo " --trs-file <file> Records the results of a test for automake (default /dev/stderr)" echo " --gdb Run under gdb if enabled" echo " --valgrind Run under valgrind if enabled" + echo " --fail-fast If a test fails, subsequent tests will not run and no report is generated" echo " --verbose Print out more stuff - if you run out of things to read" exit 1 } @@ -52,6 +54,7 @@ while test $# -gt 0; do --trs-file) test_output=$2; shift;; --gdb) trace='gdb --args'; shift;; --valgrind) trace=$valgrind_cmd; shift;; + --fail-fast) fail_fast='true'; shift;; --verbose) verbose="--verbose";; --help) print_help ;; -*) ;; # ignore @@ -114,6 +117,9 @@ else echo "=============================================================" echo ":test-result: FAIL $tst" >> $test_output fi -exit 1 + +if test "z$fail_fast" == "ztrue"; then + exit 1 +fi # vim:set shiftwidth=4 expandtab: diff --git a/test/run_unit_standalone.sh.in b/test/run_unit_standalone.sh.in index ef80cb6efd..01084dbf1e 100755 --- a/test/run_unit_standalone.sh.in +++ b/test/run_unit_standalone.sh.in @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# DO NOT EDIT - this file is generated from run_unit.sh.in. +# DO NOT EDIT - this file is generated from run_unit_standalone.sh.in. # cmd_line="$0 $@" |