-
Notifications
You must be signed in to change notification settings - Fork 54
/
.travis-build.sh
executable file
·96 lines (75 loc) · 3.27 KB
/
.travis-build.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# Optional argument $1 is one of:
# all, quick-txt-diff, nonquick-txt-diff, non-txt-diff, misc, kvasir
# If it is omitted, this script does everything.
export GROUP=$1
if [[ "${GROUP}" == "" ]]; then
export GROUP=all
fi
if [[ "${GROUP}" != "all" && "${GROUP}" != "quick-txt-diff" && "${GROUP}" != "nonquick-txt-diff" && "${GROUP}" != "non-txt-diff" && "${GROUP}" != "misc" && "${GROUP}" != "kvasir" && "${GROUP}" != "dyncomp" ]]; then
echo "Bad argument '${GROUP}'; should be omitted or one of: all, quick-txt-diff, nonquick-txt-diff, non-txt-diff, misc, kvasir."
exit 1
fi
# Fail the whole script if any command fails
set -e
set -o pipefail
## Useful for debugging and sometimes for interpreting the script.
# # Output lines of this script as they are read.
# set -o verbose
# # Output expanded lines of this script as they are executed.
# set -o xtrace
export SHELLOPTS
make showvars compile daikon.jar
# The JDK was built already; there is no need to rebuild it again.
# Don't use "-d" to debug ant, because that results in a log so long
# that Travis truncates the log and terminates the job.
if [[ "${GROUP}" == "quick-txt-diff" || "${GROUP}" == "all" ]]; then
echo ".travis-build.sh is running quick-txt-diff tests"
make dyncomp-jdk
MAKE_VERSION=$(make --version 2>&1 | head -1)
if [[ $MAKE_VERSION =~ "GNU Make 4" ]]; then
MPARG_ARG="MPARG=-Otarget"
fi
make -C tests $MPARG_ARG quick-txt-diff results
fi
if [[ "${GROUP}" == "nonquick-txt-diff" || "${GROUP}" == "all" ]]; then
echo ".travis-build.sh is running nonquick-txt-diff tests"
make dyncomp-jdk
make -C tests MPARG=-j1 nonquick-txt-diff results
fi
if [[ "${GROUP}" == "non-txt-diff" || "${GROUP}" == "all" ]]; then
echo ".travis-build.sh is running non-txt-diff tests"
make -C tests non-txt-diff results
fi
if [[ "${GROUP}" == "misc" || "${GROUP}" == "all" ]]; then
## misc tests: miscellaneous tests that shouldn't depend on JDK version.
## (Maybe they don't even need the full ./.travis-build-without-test.sh .)
echo ".travis-build.sh is running misc tests"
# Code style & quality
make -C java error-prone
# Code formatting
make -C java check-format
# Documentation
make javadoc doc-all
if [ -d "/tmp/plume-scripts" ] ; then
(cd /tmp/plume-scripts && git pull -q) > /dev/null 2>&1
else
(cd /tmp && (git clone --depth=1 -q https://github.com/plume-lib/plume-scripts.git || (sleep 1m && git clone --depth=1 -q https://github.com/plume-lib/plume-scripts.git)))
fi
# For refactorings that touch a lot of code that you don't understand, create
# top-level file SKIP-REQUIRE-JAVADOC. Delete it after the pull request is merged.
if [ ! -f SKIP-REQUIRE-JAVADOC ]; then
(make -C java requireJavadocPrivate > /tmp/warnings.txt 2>&1) || true
/tmp/plume-scripts/ci-lint-diff /tmp/warnings.txt
fi
fi
if [[ "${GROUP}" == "kvasir" || "${GROUP}" == "all" ]]; then
echo ".travis-build.sh is running kvasir and DynComp tests"
# Running Kvasir tests here may seem redundant with the fjalar project's Travis
# build; however, it means that they are run on each branch and pull request.
# The Valgrind configure script fails if SHELLOPTS is defined.
export -n SHELLOPTS
make kvasir
make -C tests/dyncomp-tests regression-tests
make -C tests/kvasir-tests regression-tests
fi