forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
165 lines (156 loc) · 4.89 KB
/
.travis.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
dist: xenial
language: d
git:
depth: 50
matrix:
include:
- os: linux
d: ldc
env: LLVM_VERSION=9.0.0 OPTS="-DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON"
- os: linux
d: ldc-beta
env: LLVM_VERSION=8.0.0 OPTS="-DBUILD_SHARED_LIBS=OFF"
# FIXME: strange crashes, possibly due to C++ compiler mismatch
#- os: linux
# d: ldc
# env: LLVM_VERSION=7.0.1 OPTS="-DBUILD_SHARED_LIBS=ON"
- os: linux
d: ldc-beta
env: LLVM_VERSION=6.0.1 OPTS="-DBUILD_SHARED_LIBS=OFF -DLIB_SUFFIX=64 -DRT_SUPPORT_SANITIZERS=ON"
- os: linux
d: ldc
env: LLVM_VERSION=5.0.2 OPTS="-DBUILD_SHARED_LIBS=ON -DLIB_SUFFIX=64"
- os: linux
d: ldc-0.17.6
env: LLVM_VERSION=4.0.0 OPTS="-DLIB_SUFFIX=64"
- os: linux
d: dmd
env: LLVM_VERSION=3.9.1
- os: osx
osx_image: xcode10.3
d: dmd
env: LLVM_VERSION=10.0.0 OPTS="-DBUILD_SHARED_LIBS=ON -DRT_SUPPORT_SANITIZERS=ON"
- os: osx
osx_image: xcode10.3
d: ldc-beta
env: LLVM_VERSION=7.0.0 OPTS="-DBUILD_SHARED_LIBS=OFF"
cache:
directories:
- llvm-10.0.0
- llvm-9.0.0
- llvm-8.0.0
- llvm-7.0.1
- llvm-7.0.0
- llvm-6.0.1
- llvm-5.0.2
- llvm-4.0.0
- llvm-3.9.1
addons:
apt:
packages:
- gdb
- ninja-build
# Download & extract prebuilt vanilla LLVM if not in cache
before_install:
- export LLVM_ROOT_DIR="$PWD/llvm-$LLVM_VERSION"
- |
if [ ! -e "$LLVM_ROOT_DIR/bin/llvm-config" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export LLVM_ARCH="x86_64-linux-gnu-ubuntu-16.04"
elif [ "$LLVM_VERSION" = "9.0.0" ]; then
export LLVM_ARCH="x86_64-darwin-apple"
else
export LLVM_ARCH="x86_64-apple-darwin"
fi
if [ "${LLVM_VERSION:0:1}" = "1" ]; then
# v10+
wget -O llvm.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/clang+llvm-$LLVM_VERSION-$LLVM_ARCH.tar.xz
else
wget -O llvm.tar.xz http://releases.llvm.org/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-$LLVM_ARCH.tar.xz
fi
mkdir -p $LLVM_ROOT_DIR
tar -xf llvm.tar.xz --strip 1 -C $LLVM_ROOT_DIR
rm llvm.tar.xz
fi
install:
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Install pip
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
rm get-pip.py
# Download & extract Ninja & add to PATH
wget -O ninja-mac.zip https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-mac.zip
mkdir ninja
tar -xf ninja-mac.zip -C ninja
rm ninja-mac.zip
export PATH="$PWD/ninja:$PATH"
fi
# Install lit
- pip install --user lit
- python -c "import lit; lit.main();" --version . | head -n 1
script:
- unset LD_LIBRARY_PATH
- cmake --version
- ninja --version
- |
cmake -G Ninja . \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ROOT_DIR=$LLVM_ROOT_DIR \
-DLDC_INSTALL_LTOPLUGIN=ON \
-DLDC_INSTALL_LLVM_RUNTIME_LIBS=ON \
$OPTS
# Build LDC & LDC D unittests & defaultlib unittest runners
- |
numJobs=3
# The OSX VM has only 4 GB of memory (Linux: 7.5)
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
numJobs=2
fi
ninja -j$numJobs all ldc2-unittest all-test-runners
- bin/ldc2 -version || exit 1
# Run LDC D unittests
- ctest --output-on-failure -R "ldc2-unittest"
# Run LIT testsuite
- ctest -V -R "lit-tests"
# Run DMD testsuite
- |
if [[ "$($DC --version | head -n 1)" == *0.17.* ]]; then
# The -lowmem tests don't work with an ltsmaster host compiler
rm tests/d2/dmd-testsuite/runnable/{testptrref,xtest46}_gc.d
rm tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d
# The @live tests neither (LDC segfaults)
rm tests/d2/dmd-testsuite/compilable/ob1.d
rm tests/d2/dmd-testsuite/fail_compilation/fob{1,2}.d
fi
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
# dmd-testsuite-debug only to reduce time-outs
DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "build-run-dmd-testsuite|dmd-testsuite-debug"
else
if [ "$LLVM_VERSION" = "3.9.1" ]; then
# FIXME: assertion failure for runnable/mars1.d with DMD/LLVM 3.9.1
# job (debug only, release passes)
rm tests/d2/dmd-testsuite/runnable/mars1.d
fi
DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "dmd-testsuite"
fi
# Run defaultlib unittests & druntime stand-alone tests
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"
after_success:
- |
if [[ "$OPTS" == *-DTEST_COVERAGE?ON* ]]; then
coveralls -e runtime -e tests -e vcbuild --gcov gcov-4.9 --gcov-options '\-lp' > /dev/null 2>&1
fi
notifications:
email:
recipients:
on_success: never
on_failure: change
irc:
channels:
- "irc.freenode.org#ldc"
on_success: always
on_failure: always
use_notice: false
skip_join: true