From 782d3860eb0134c81d4a4204b7caab72cda3bd1d Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 25 Sep 2020 10:12:56 +0100 Subject: tests: Move copy-pasted code into a shared helper .sh Also fix a few shellcheck warnings related to printf while doing so. --- test/isabelle/run_tests.sh | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'test/isabelle') 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+=" \n" -} - -function yellow { - (( fail += 1 )) - printf "$1: ${YELLOW}$2${NC}\n" - XML+=" \n $2\n \n" -} - -function red { - (( fail += 1 )) - printf "$1: ${RED}$2${NC}\n" - XML+=" \n $2\n \n" -} - -function finish_suite { - printf "$1: Passed ${pass} out of $(( pass + fail ))\n\n" - XML=" \n$XML \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/" -- cgit v1.2.3