summaryrefslogtreecommitdiff
path: root/test/aarch64_small
diff options
context:
space:
mode:
Diffstat (limited to 'test/aarch64_small')
-rwxr-xr-xtest/aarch64_small/run_tests.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/aarch64_small/run_tests.sh b/test/aarch64_small/run_tests.sh
new file mode 100755
index 00000000..cc6f223e
--- /dev/null
+++ b/test/aarch64_small/run_tests.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+set -e
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+cd $DIR
+SAILDIR="$DIR/../.."
+
+RED='\033[0;91m'
+GREEN='\033[0;92m'
+YELLOW='\033[0;93m'
+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
+}
+
+printf "<testsuites>\n" >> $DIR/tests.xml
+
+if make -B -C ../../aarch64_small SAIL="$SAILDIR/sail"
+then
+ green "built aarch64_small to lem" "ok"
+else
+ red "failed to build lem" "fail"
+fi
+
+finish_suite "aarch64_small tests"
+
+printf "</testsuites>\n" >> $DIR/tests.xml