#!/bin/bash -x # this script fetches the sources / binaries and makes basic preparations if [ "X$BASEDIR" == "X" ]; then BASEDIR=$HOME/testing fi set -e export BASEDIR cd $BASEDIR if [ ! -e $BASEDIR/config ]; then echo "ERROR: no config file '$BASEDIR/config' found." exit 1 fi . $BASEDIR/config RAW_LOG=$BASEDIR/output/rawlog.tests ###################### echo echo $SEPARATOR echo "TESTS '$TESTS_LIST' will be run." echo for TEST in $TESTS_LIST; do case "$TEST" in ver) echo "Test recognized as --version test" for FLAVOR in $FLAVORS_LIST; do TEST_OUT=$BASEDIR/output/test-$FLAVOR-$TEST.out echo "About to ask flavor '$FLAVOR' for --version..." # this test is NOT supposed to fail! (unlike others) $BASEDIR/runtimes/sablevm-${FLAVOR}/bin/sablevm --version >$TEST_OUT 2>&1 echo $TEST_OUT done echo "Version tests finished" echo ;; hello) echo "Test recognized as HelloWorld test" cd $BASEDIR/runtimes/sablevm-test-suite for FLAVOR in $FLAVORS_LIST; do TEST_OUT=$BASEDIR/output/test-$FLAVOR-$TEST.out echo "About to run 'HelloWorld' on flavor '$FLAVOR'..." $BASEDIR/runtimes/sablevm-${FLAVOR}/bin/sablevm -Y HelloWorld >$TEST_OUT 2>&1 \ || echo "FAILURE of EXECUTING HelloWorld test on '$FLAVOR' flavor!" if [ -e HelloWorld.output ]; then TMP_RES=`diff $TEST_OUT HelloWorld.output|wc -l` && true if [ $TMP_RES -eq 0 ]; then echo "SUCCESS running HelloWorld test on '$FLAVOR' flavor." else echo "FAILURE running HelloWorld test on '$FLAVOR' flavor (output doesn't match)." echo "SEE $TEST_OUT for detailed output of failed test." fi else echo "Warning: no HelloWorld.output file to compare output!" echo "SUCCESS running HelloWorld test on '$FLAVOR' flavor." fi done echo "HelloWorld tests finished" echo ;; btf) echo "Test recognized as Bytecode Testing Framework test" cd $BASEDIR/runtimes/sablevm-test-suite for FLAVOR in $FLAVORS_LIST; do TEST_OUT=$BASEDIR/output/test-$FLAVOR-$TEST.out echo "About to run 'BytecodeVerificationTest' on flavor '$FLAVOR'..." # TODO: we should KILL sablevm after some time here! $BASEDIR/runtimes/sablevm-${FLAVOR}/bin/sablevm -Y BytecodeVerificationTest >$TEST_OUT 2>&1 \ || echo "FAILURE of EXECUTING BytecodeVerificationTest test on '$FLAVOR' flavor!" if [ -e BytecodeVerificationTest.output ]; then TMP_RES=`diff $TEST_OUT BytecodeVerificationTest.output|wc -l` && true if [ $TMP_RES -eq 0 ]; then echo "SUCCESS running BytecodeVerificationTest test on '$FLAVOR' flavor." else echo "FAILURE running BytecodeVerificationTest test on '$FLAVOR' flavor (output doesn't match)." echo "SEE $TEST_OUT for detailed output of failed test." fi else echo "Warning: no BytecodeVerificationTest.output file to compare output!" echo "SUCCESS running BytecodeVerificationTest test on '$FLAVOR' flavor." fi done echo "BytecodeVerificationTest tests finished" echo ;; bench*) echo "Test recognized as Benchmarks" cd $BASEDIR/runtimes/benchmarks echo "About to run benchmarks '$BENCH_LIST' on flavors '$FLAVORS_LIST' for '$BENCH_TIMES' times..." ./cleanbench ./runbench-massive "$FLAVORS_LIST" "$BENCH_TESTS" "$BENCH_TIMES" ./copyresults echo "Benchmarks finished (see messages above)" echo ;; *) echo echo "Warning: Unknown test $TEST!" echo ;; esac done cd $BASEDIR echo "ALL '$TESTS_LIST' tests have been ran. See the results above." echo $SEPARATOR echo exit 0