diff options
| author | Alex Richardson | 2020-09-25 10:12:56 +0100 |
|---|---|---|
| committer | Alex Richardson | 2020-09-25 12:30:09 +0100 |
| commit | 782d3860eb0134c81d4a4204b7caab72cda3bd1d (patch) | |
| tree | 7cdb5a20490ec77e846d60d8c00d1adb9ca1bafb /test/isabelle | |
| parent | e6dadf146f699a7ac28228659832d31100861d17 (diff) | |
tests: Move copy-pasted code into a shared helper .sh
Also fix a few shellcheck warnings related to printf while doing so.
Diffstat (limited to 'test/isabelle')
| -rwxr-xr-x | test/isabelle/run_tests.sh | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/test/isabelle/run_tests.sh b/test/isabelle/run_tests.sh index 7b3f7bc1..ebc3472c 100755 --- a/test/isabelle/run_tests.sh +++ b/test/isabelle/run_tests.sh @@ -13,36 +13,8 @@ NC='\033[0m' rm -f $DIR/tests.xml -pass=0 -fail=0 -XML="" - -function green { - (( pass += 1 )) - printf "$1: ${GREEN}$2${NC}\n" - XML+=" <testcase name=\"$1\"/>\n" -} - -function yellow { - (( fail += 1 )) - printf "$1: ${YELLOW}$2${NC}\n" - XML+=" <testcase name=\"$1\">\n <error message=\"$2\">$2</error>\n </testcase>\n" -} - -function red { - (( fail += 1 )) - printf "$1: ${RED}$2${NC}\n" - XML+=" <testcase name=\"$1\">\n <error message=\"$2\">$2</error>\n </testcase>\n" -} - -function finish_suite { - printf "$1: Passed ${pass} out of $(( pass + fail ))\n\n" - XML=" <testsuite name=\"$1\" tests=\"$(( pass + fail ))\" failures=\"${fail}\" timestamp=\"$(date)\">\n$XML </testsuite>\n" - printf "$XML" >> $DIR/tests.xml - XML="" - pass=0 - fail=0 -} +# shellcheck source=../test_helpers.sh +source "$SAILDIR/test/test_helpers.sh" SAILLIBDIR="$DIR/../../lib/" |
