diff options
| author | Robert Norton | 2018-03-15 13:27:07 +0000 |
|---|---|---|
| committer | Robert Norton | 2018-03-15 13:27:07 +0000 |
| commit | 860034499374a4791371c3a2176497f45b2621a0 (patch) | |
| tree | 62ac86717ab42023ebab7ffe9bb8576ddd344922 | |
| parent | 3896c50644568214c06014eb54d27f86f3d446f3 (diff) | |
add test that cheri specs build (ocaml).
| -rwxr-xr-x | test/cheri/run_tests.sh | 73 | ||||
| -rwxr-xr-x | test/run_tests.sh | 6 |
2 files changed, 79 insertions, 0 deletions
diff --git a/test/cheri/run_tests.sh b/test/cheri/run_tests.sh new file mode 100755 index 00000000..29128a6d --- /dev/null +++ b/test/cheri/run_tests.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR +SAILDIR="$DIR/../.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +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 +} + +SAILLIBDIR="$DIR/../../lib/" + +printf "<testsuites>\n" >> $DIR/tests.xml + +cd $SAILDIR/riscv + +printf "Building CHERI 256 specification...\n" + +if make -C $SAILDIR/cheri cheri ; +then + green "Building CHERI 256 specification" "ok" +else + red "Building CHERI 256 specification" "fail" +fi + +printf "Building CHERI 128 specification...\n" + +if make -C $SAILDIR/cheri cheri128 ; +then + green "Building CHERI 128 specification" "ok" +else + red "Building CHERI 128 specification" "fail" +fi + +finish_suite "CHERI tests" + +printf "</testsuites>\n" >> $DIR/tests.xml + diff --git a/test/run_tests.sh b/test/run_tests.sh index 45013f0d..522e0952 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -40,3 +40,9 @@ printf "* RISCV spec tests *\n" printf "******************************************\n\n" ./test/riscv/run_tests.sh + +printf "******************************************\n" +printf "* CHERI spec tests *\n" +printf "******************************************\n\n" + +./test/cheri/run_tests.sh |
