forked from nativelibs4java/BridJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runTestsCLI
26 lines (18 loc) · 1.36 KB
/
runTestsCLI
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
#!/bin/bash
if [[ ! -f junit.jar ]] ; then cp ~/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar junit.jar ; fi
if [[ ! -f jna.jar ]] ; then cp ~/.m2/repository/net/java/dev/jna/jna/3.2.7/jna-3.2.7.jar jna.jar ; fi
if [[ ! -f javolution.jar ]] ; then cp ~/.m2/repository/javolution/javolution/5.5.1/javolution-5.5.1.jar javolution.jar ; fi
MVN_VERSION="`cat pom.xml | grep '<version' | head -n 1 | sed -e 's/.*<version>\(.*\)<\/version>.*/\1/g'`"
mvn clean package -DskipTests
echo "#\n# ARM binaries :"
unzip -l target/bridj-$MVN_VERSION.jar | grep arm
if [[ "$1" == "copy" ]] ; then
for F in junit.jar jna.jar javolution.jar target/bridj-$MVN_VERSION.jar target/bridj-$MVN_VERSION-tests.jar ; do
scp $F mobile@iphone:src/nativelibs4java/Runtime/BridJ/$F ;
done ;
else
#export JUNIT_TEST_CLASSES="`find target/test-classes/org/bridj/*Test.class | sed 's/\.class//' | sed 's/target\/test-classes\/org\/bridj\///' | tr / .`"
#export JUNIT_TEST_CLASSES="`find target/test-classes/org/bridj/*Test.class | sed 's/\.class//' | sed 's/target\/test-classes\///' | tr / .`"
JUNIT_TESTS="`unzip -l target/bridj-$MVN_VERSION-tests.jar | grep '.*Test.class' | grep -v '\\$' | sed 's/.*org/org/' | sed 's/\.class//' | tr / . `"
java -cp target/bridj-$MVN_VERSION.jar:target/bridj-$MVN_VERSION-tests.jar:junit.jar:jna.jar:javolution.jar org.junit.runner.JUnitCore $JUNIT_TESTS ;
fi