1#!/bin/bash 2 3verbose="no" 4 5if [ ! -f config.mak ]; then 6 echo "run ./configure && make first. See ./configure -h" 7 exit 1 8fi 9source config.mak 10source scripts/functions.bash 11 12function usage() 13{ 14cat <<EOF 15 16Usage: $0 [-g group] [-h] [-v] 17 18 -g: Only execute tests in the given group 19 -h: Output this help text 20 -v: Enables verbose mode 21 22Set the environment variable QEMU=/path/to/qemu-system-ARCH to 23specify the appropriate qemu binary for ARCH-run. 24 25EOF 26} 27 28RUNTIME_arch_run="./$TEST_DIR/run" 29source scripts/runtime.bash 30 31while getopts "g:hv" opt; do 32 case $opt in 33 g) 34 only_group=$OPTARG 35 ;; 36 h) 37 usage 38 exit 39 ;; 40 v) 41 verbose="yes" 42 ;; 43 *) 44 exit 1 45 ;; 46 esac 47done 48 49RUNTIME_log_stderr () { cat >> test.log; } 50RUNTIME_log_stdout () { 51 if [ "$PRETTY_PRINT_STACKS" = "yes" ]; then 52 ./scripts/pretty_print_stacks.py $1 >> test.log 53 else 54 cat >> test.log 55 fi 56} 57 58 59config=$TEST_DIR/unittests.cfg 60rm -f test.log 61printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log 62for_each_unittest $config run 63