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>pull/7520/head
parent
7e105e1651
commit
6de46d746e
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 $@"
|
||||
|
|
Loading…
Reference in New Issue