Make separate helper scripts for testing compiler and runtime

This commit is contained in:
Max Brunsfeld 2014-07-17 19:14:17 -07:00
parent 779bf0d745
commit 02904085c2
8 changed files with 60 additions and 24 deletions

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
set -e
make compiler_specs
time out/Default/compiler_specs
make runtime_specs
time out/Default/runtime_specs

6
script/test_all.sh Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e
script/test_compiler.sh
script/test_runtime.sh

7
script/test_compiler.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e -u
make compiler_specs
source `dirname $0`/util/run_tests.sh
run_tests out/Default/compiler_specs "$@"

7
script/test_runtime.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e -u
make runtime_specs
source `dirname $0`/util/run_tests.sh
run_tests out/Default/runtime_specs "$@"

37
script/util/run_tests.sh Normal file
View file

@ -0,0 +1,37 @@
function run_tests {
local cmd=$1
shift
local debug=
local args=
while getopts "dvf:" option; do
case ${option} in
d)
debug=true
;;
f)
args="$args --only='${OPTARG}'"
;;
v)
args="$args --reporter=spec"
;;
*)
exit
;;
esac
done
if [[ -n $debug ]]; then
if which -s gdb; then
eval gdb $cmd -- $args
elif which -s lldb; then
eval lldb $cmd -- $args
else
echo "No debugger found"
exit 1
fi
else
eval time $cmd $args
fi
}