forked from magic-lang/ooc-kean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·49 lines (49 loc) · 822 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
export OOC_LIBS=$(dirname `pwd`)
ARGS=""
TESTS_USE_FILE="tests.use"
if [ -e rock_arguments.txt ]
then
ARGS=$(cat rock_arguments.txt)
fi
FLAGS=${@:2}
TESTS=$@
case "$1" in
"nogpu")
;&
"")
;&
"all")
TESTS="./test"
;;
*)
TESTS="./test/$1"
;;
esac
FEATURES=""
if [[ $1 == "nogpu" ]]; then
FEATURES=$FEATURES" -DgpuOff"
fi
if [[ -d $TESTS ]]
then
TESTS=$(find $TESTS -name "*Test.ooc")
else
TESTS=$TESTS"Test.ooc"
fi
echo "SourcePath: ." > "$TESTS_USE_FILE"
for TEST in $TESTS
do
if [[ !( $1 == "nogpu" && $TEST == *"/gpu/"* ) ]]
then
echo "Imports: ${TEST%.*}" >> "$TESTS_USE_FILE"
fi
done
echo "Main: ./test/Tests.ooc" >> "$TESTS_USE_FILE"
rm -f .libs/tests-linux64.*
rock -q --gc=off $ARGS $FLAGS $FEATURES $TESTS_USE_FILE && ./Tests
if [[ !( $? == 0 ) ]]
then
exit 1
else
exit 0
fi