9
9
# CPP linter script
10
10
- &linter-stage
11
11
stage : test ubuntu + gcc compilation with extra flags for debug + Linter
12
- env :
13
- - NAME="CPP-LINT"
14
- - BUILD_PURPOSE="lint"
15
12
addons :
16
13
apt :
17
14
packages :
18
15
- libwww-perl
19
16
script :
20
- - cp -r lib/cbmc/scripts . && scripts/travis_lint.sh
17
+ - cp -r lib/cbmc/scripts .
18
+ && sed -i '/git fetch --unshallow/d' scripts/travis_lint.sh
19
+ && scripts/travis_lint.sh
21
20
before_cache :
21
+ env :
22
+ - BUILD_PURPOSE="lint"
22
23
23
24
# Test - Ubuntu Linux with glibc using g++-5
24
25
- stage : test ubuntu + gcc compilation with extra flags for debug + Linter
@@ -33,16 +34,12 @@ jobs:
33
34
- ubuntu-toolchain-r-test
34
35
packages :
35
36
- libwww-perl
36
- - libthread-pool-simple-perl
37
37
- g++-5
38
- - libubsan0
39
- - parallel
40
38
before_install :
41
39
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
42
40
env :
43
41
- COMPILER="ccache g++-5"
44
42
- BUILD_PURPOSE="test"
45
- - OS="ubuntu"
46
43
47
44
# Test - OS X using g++
48
45
- stage : compile with extra flags for debug
@@ -51,13 +48,11 @@ jobs:
51
48
compiler : gcc
52
49
cache : ccache
53
50
before_install :
54
- - HOMEBREW_NO_AUTO_UPDATE=1 brew install jq ccache parallel cpanm
55
- - sudo cpanm Thread::Pool::Simple
51
+ - HOMEBREW_NO_AUTO_UPDATE=1 brew install jq ccache
56
52
- export PATH=/usr/local/opt/ccache/libexec:$PATH
57
53
env :
58
54
- COMPILER="ccache g++"
59
55
- BUILD_PURPOSE="test"
60
- - OS="osx"
61
56
62
57
# Test - OS X using clang++
63
58
- stage : compile with extra flags for debug
@@ -66,13 +61,11 @@ jobs:
66
61
compiler : clang
67
62
cache : ccache
68
63
before_install :
69
- - HOMEBREW_NO_AUTO_UPDATE=1 brew install jq ccache parallel cpanm
70
- - sudo cpanm Thread::Pool::Simple
64
+ - HOMEBREW_NO_AUTO_UPDATE=1 brew install jq ccache
71
65
- export PATH=/usr/local/opt/ccache/libexec:$PATH
72
66
env :
73
67
- COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
74
68
- BUILD_PURPOSE="test"
75
- - OS="osx"
76
69
77
70
# Test - Ubuntu Linux with glibc using clang++-3.7
78
71
- stage : compile with extra flags for debug
@@ -88,20 +81,52 @@ jobs:
88
81
- llvm-toolchain-precise-3.7
89
82
packages :
90
83
- libwww-perl
91
- - libthread-pool-simple-perl
92
84
- clang-3.7
93
85
- libstdc++-5-dev
94
- - libubsan0
95
- - parallel
96
86
before_install :
97
87
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
98
88
env :
99
89
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
100
90
- BUILD_PURPOSE="test"
101
91
- CCACHE_CPP2=yes
102
- - OS="ubuntu"
103
92
104
93
install :
105
94
- ccache --max-size=1G
95
+ - perl -pe 's/git\@github.com:/https:\/\/github.com\//' -i .gitmodules
96
+ - |
97
+ # Fetch forks. If this is a PR or a master/develop branch, CBMC submodule has to refer to
98
+ # 'diffblue/cbmc' not to a fork so no need to fetch anything
99
+ set -euo pipefail
100
+ if [[ "${TRAVIS_PULL_REQUEST}" == "false" && ! ( "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" =~ ^(master|develop)$ ) ]]
101
+ then
102
+ # Get list of all contributors who have cbmc forks, to fetch these.
103
+ CONTRIBUTORS=$(mktemp)
104
+ # Note: the following curl might not return all entries
105
+ # if there is too many contributors/forks, so we might need
106
+ # to adapt this as DiffBlue grows :-)
107
+ curl -H "Authorization: token ${GITHUB_TOKEN}" \
108
+ "https://api.github.com/repos/diffblue/musketeer/contributors?per_page=100" \
109
+ | jq -r '.[] | .login' \
110
+ | sort > ${CONTRIBUTORS}
111
+
112
+ export USERS
113
+ USERS=$(cat ${CONTRIBUTORS} | tr "\n" " ")
114
+
115
+ echo "List of forks to pull >${USERS}<"
116
+ else
117
+ echo "No forks will be fetched"
118
+ fi
119
+ set +u
106
120
- make -C src setup-cbmc
107
- - make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g ${EXTRA_CXXFLAGS}" -j2
121
+ - |
122
+ # Compile for test builds
123
+ ( set -euo pipefail
124
+ if [[ "${BUILD_PURPOSE}" =~ ^(test)$ ]]
125
+ then
126
+ make -C src "CXX=${COMPILER}" "CXXFLAGS=-Wall -Werror -pedantic -O2 -g" -j2
127
+ fi
128
+ set +u
129
+ )
130
+
131
+ script :
132
+ - make -C regression test
0 commit comments