forked from grails/grails-database-migration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.sh
executable file
·56 lines (51 loc) · 1.25 KB
/
run_tests.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
50
51
52
53
54
55
56
#!/bin/bash +xe
HIBERNATE4_PLUGIN=":hibernate4:4.3.5.2"
PREVIOUS_JAVA_OPTS="${JAVA_OPTS}"
runall=0
skip_hibernate4=0
skip_cli=0
# parse options
while getopts ":a:h:c" Option
do
case $Option in
a )
runall=1
;;
h )
skip_hibernate4=1
;;
c )
skip_cli=1
;;
esac
done
shift $(($OPTIND - 1))
run_tests() {
set -e -x
[ -d target ] && rm -rf target
./grailsw clean --non-interactive
./grailsw compile --non-interactive
./grailsw maven-install --non-interactive
./grailsw test-app :integration --non-interactive
if [[ $skip_cli -ne 1 ]]; then
./grailsw test-app :cli --non-interactive
fi
set +e +x
}
run_tests
if [[ $skip_hibernate4 -ne 1 ]]; then
echo "Run with hibernate4"
export JAVA_OPTS="-DhibernatePluginVersion=$HIBERNATE4_PLUGIN ${JAVA_OPTS}"
run_tests
export JAVA_OPTS="${PREVIOUS_JAVA_OPTS}"
fi
if [[ $runall -eq 1 ]]; then
echo "Running mysql testapp"
cd testapp
echo "Run with hibernate3"
./run_test_app.sh
if [[ $skip_hibernate4 -ne 1 ]]; then
echo "Run with hibernate4"
./run_test_app.sh -DhibernatePluginVersion=$HIBERNATE4_PLUGIN
fi
fi