-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathtest.sh
executable file
·59 lines (48 loc) · 1.22 KB
/
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
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Runs through a series of tests using multiple versions of gradle to
# ensure the plugin works in all of the expected versions.
#
# You can expect the tests to run for 20 to 30 seconds _per_ version.
set -eu
VERSIONS=(
2.14.1
2.13
2.12
2.11
2.10
2.9
2.8
2.7
2.6
2.5
2.4
)
main(){
echo "## Building plugin and running unit tests"
assemble_plugin
cd src/test/gradle
for GRADLE_VERSION in ${VERSIONS[*]}; do
echo
echo "###################### $GRADLE_VERSION ######################"
write_wrapper_props_file "$GRADLE_VERSION"
integration_tests
done
echo "## All tests passed"
}
assemble_plugin(){
./gradlew clean check jar
}
integration_tests(){
cp really-executable.base.sh really-executable.sh
echo "## Building and verifying capsules"
./gradlew clean buildAll runScript -PtestScript=TestCapsule.groovy
echo "## Modifying some files and rebuilding"
cp really-executable.modified.sh really-executable.sh
./gradlew buildAll runScript -PtestScript=TestModifications.groovy
}
write_wrapper_props_file(){
cat gradle/wrapper/gradle-wrapper.properties.base | \
sed "s/gradle-[0-9.]*-bin.zip/gradle-$1-bin.zip/" \
> gradle/wrapper/gradle-wrapper.properties
}
main