-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrunTest-old.sh
More file actions
executable file
·58 lines (50 loc) · 1.57 KB
/
runTest-old.sh
File metadata and controls
executable file
·58 lines (50 loc) · 1.57 KB
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
50
51
52
53
54
55
56
57
58
#!/bin/bash
workingDir="`dirname \"$0\"`"
cd "$workingDir" || exit 1
ant compile-tests
if [[ $? != 0 ]]
then
echo "---------------------------------------------------------------------------------"
echo "! Compilation failed, aborting test";
else
for ARG in $*
do
# Split class and function names if needed
#----------------------------------------------------------
if [[ $ARG == *"#"* ]]
then
TESTCLASS=`(echo $ARG | cut -d"#" -f 1)`
TESTFUNCTION=`(echo $ARG | cut -d"#" -f 2)`
else
TESTCLASS="$ARG";
TESTFUNCTION="";
fi
# Ensure test classes ends with the _test suffixes, and picodedTest prefix
#------------------------------------------------------------------------------
_TEST="_test";
if [[ $TESTCLASS =~ \_test$ ]]
then
TESTCLASS="$TESTCLASS";
else
TESTCLASS="$TESTCLASS$_TEST";
fi
if [[ $TESTCLASS == picodedTests* ]]
then
TESTCLASS="$TESTCLASS";
else
TESTCLASS="picodedTests.$TESTCLASS";
fi
# Runs the test
#----------------------------------------------------------
echo "Test Class: $TESTCLASS"
if [[ -z "$TESTFUNCTION" ]]
then
echo "---------------------------------------------------------------------------------"
java -cp "./build-tools/junit/*:./bin/libs/*:./bin/classes" org.junit.runner.JUnitCore "$TESTCLASS"
else
echo "Function: $TESTFUNCTION"
echo "---------------------------------------------------------------------------------"
java -cp "./build-tools/junit/*:./bin/libs/*:./bin/classes" picoded.JUnit.SingleJUnitTestRunner "$TESTCLASS#$TESTFUNCTION"
fi
done
fi