blob: ce69723d3187449a00cdcd0a703955dad3bbe757 [file] [log] [blame]
Sean Purcelldaec40d2017-03-07 12:08:15 -08001# Medium Tests: Run on all commits/PRs to dev branch
2
Yann Collet4856a002015-01-24 01:58:16 +01003language: c
Lzu Tao0a25b132018-11-28 13:06:18 +07004
Sean Purcelldaec40d2017-03-07 12:08:15 -08005git:
6 depth: 1
7
8branches:
9 only:
10 - dev
11 - master
Yann Colleted1a4292018-06-27 16:57:28 -070012 - travisTest
Przemyslaw Skibinski0b48a592016-11-14 13:07:45 +010013
Lzu Taob3be8992018-12-14 01:38:06 +070014addons:
15 apt:
16 update: true
17
18env:
19 global:
20 - FUZZERTEST=-T2mn
21 ZSTREAM_TESTTIME=-T2mn
22 DECODECORPUS_TESTTIME=-T1mn
23
Lzu Taob3be8992018-12-14 01:38:06 +070024
25matrix:
26 fast_finish: true
27 include:
Bimba Shrestha1bc56df2020-03-03 15:22:35 -080028 - name: icc
29 compiler: icc
30 env:
31 - C_COMPILER=icc
32 - CXX_COMPILER=icpc
Bimba Shrestha1bc56df2020-03-03 15:22:35 -080033 install:
34 - source /opt/intel/inteloneapi/compiler/latest/env/vars.sh
35 addons:
36 apt:
37 sources:
38 - sourceline: 'deb https://apt.repos.intel.com/oneapi all main'
39 key_url: 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'
40 packages:
41 - intel-oneapi-icc
42 script: make check
43
Yann Collet228a6d22019-11-26 10:24:09 -080044 - name: arm64 # ~2.5 mn
Bimba Shrestha4899b6f2019-10-23 10:43:20 -070045 os: linux
46 arch: arm64
47 script:
48 - make check
49
Bimba Shresthaeb76f782020-01-06 14:19:11 -080050 - name: make benchmarking
51 script:
52 - make benchmarking
53
54 - name: make test (complete)
Lzu Taob3be8992018-12-14 01:38:06 +070055 script:
Yann Collet7aaac3f2019-11-25 10:35:36 -080056 # DEVNULLRIGHTS : will request sudo rights to test permissions on /dev/null
57 - DEVNULLRIGHTS=test make test
Lzu Taob3be8992018-12-14 01:38:06 +070058
Yann Colletc6ae2e82020-04-28 18:29:20 -070059 - name: gcc-6 + gcc-7 + libzstdmt compilation # ~ 6mn
Lzu Taob3be8992018-12-14 01:38:06 +070060 script:
Yann Collet7d51e1a2018-12-24 04:15:41 -080061 - make gcc6install gcc7install
Lzu Taob3be8992018-12-14 01:38:06 +070062 - CC=gcc-6 CFLAGS=-Werror make -j all
63 - make clean
Yann Collet7d51e1a2018-12-24 04:15:41 -080064 - CC=gcc-7 CFLAGS=-Werror make -j all
Yann Colletc6ae2e82020-04-28 18:29:20 -070065 - make clean
66 - LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
Yann Collet7ea2ae62020-04-28 21:18:29 -070067 - make -C tests zbufftest-dll
68 # LDFLAGS=-Wl,--no-undefined : will make the linker fail if dll is underlinked
69 # zbufftest-dll : test that a user program can link to multi-threaded libzstd without specifying -pthread
Yann Collet515c2aa2018-12-24 02:56:21 -080070
Yann Collet228a6d22019-11-26 10:24:09 -080071 - name: gcc-8 + ASan + UBSan + Test Zstd # ~6.5mn
Lzu Taob3be8992018-12-14 01:38:06 +070072 script:
73 - make gcc8install
Yann Collet7d51e1a2018-12-24 04:15:41 -080074 - CC=gcc-8 CFLAGS="-Werror" make -j all
75 - make clean
76 - CC=gcc-8 make -j uasan-test-zstd </dev/null # test when stdin is not a tty
77
Yann Collet228a6d22019-11-26 10:24:09 -080078 - name: gcc-6 + ASan + UBSan + Test Zstd, 32bit mode # ~4mn
Yann Collet7d51e1a2018-12-24 04:15:41 -080079 script:
80 - make gcc6install libc6install
81 - CC=gcc-6 CFLAGS="-Werror -m32" make -j all32
82 - make clean
83 - CC=gcc-6 make -j uasan-test-zstd32 # note : can complain about pointer overflow
Yann Collet515c2aa2018-12-24 02:56:21 -080084
Yann Collet228a6d22019-11-26 10:24:09 -080085 - name: clang-3.8 + MSan + Test Zstd # ~3.5mn
Lzu Taob3be8992018-12-14 01:38:06 +070086 script:
87 - make clang38install
Yann Colletbad35bd2019-10-21 12:55:39 -070088 # External libraries must be turned off when using MSAN tests,
89 # because they are not msan-instrumented,
90 # so any data coming from these libraries is always considered "uninitialized"
91 - CC=clang-3.8 make clean msan-test-zstd HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0
Lzu Taob3be8992018-12-14 01:38:06 +070092
Yann Collet228a6d22019-11-26 10:24:09 -080093 - name: Minimal Decompressor Macros # ~5mn
W. Felix Handte4e2f6c12018-12-05 14:04:57 -080094 script:
95 - make clean
W. Felix Handte0b810352020-05-04 11:22:07 -040096 - make -j all check ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
W. Felix Handte4e2f6c12018-12-05 14:04:57 -080097 - make clean
W. Felix Handte0b810352020-05-04 11:22:07 -040098 - make -j all check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
W. Felix Handte4e2f6c12018-12-05 14:04:57 -080099 - make clean
W. Felix Handte0b810352020-05-04 11:22:07 -0400100 - make -j all check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG"
Yann Collet515c2aa2018-12-24 02:56:21 -0800101 - make clean
W. Felix Handte0b810352020-05-04 11:22:07 -0400102 - make -j all check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
W. Felix Handte4e2f6c12018-12-05 14:04:57 -0800103
Taylor Braun-Jones5b054d92020-03-23 16:08:52 -0400104 - name: cmake build and test check # ~6mn
Lzu Taob3be8992018-12-14 01:38:06 +0700105 script:
106 - make cmakebuild
107
Yann Collet228a6d22019-11-26 10:24:09 -0800108 - name: static analyzer scanbuild # ~26mn
Yann Collet52dc6ff2019-11-27 14:39:43 -0800109 dist: trusty # note : it's important to pin down a version of static analyzer, since different versions report different false positives
Lzu Taob3be8992018-12-14 01:38:06 +0700110 script:
111 - make staticAnalyze
112
Yann Collet228a6d22019-11-26 10:24:09 -0800113 - name: gcc-8 + ASan + UBSan + Fuzz Test # ~19mn
Lzu Taob3be8992018-12-14 01:38:06 +0700114 script:
Yann Collet7d51e1a2018-12-24 04:15:41 -0800115 - make gcc8install
116 - CC=gcc-8 make clean uasan-fuzztest
Yann Collet515c2aa2018-12-24 02:56:21 -0800117
Yann Collet228a6d22019-11-26 10:24:09 -0800118 - name: gcc-6 + ASan + UBSan + Fuzz Test 32bit # ~15.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700119 script:
120 - make gcc6install libc6install
Yann Collet7d51e1a2018-12-24 04:15:41 -0800121 - CC=gcc-6 CFLAGS="-O2 -m32" make uasan-fuzztest # can complain about pointer overflow
Yann Collet515c2aa2018-12-24 02:56:21 -0800122
Yann Collet228a6d22019-11-26 10:24:09 -0800123 - name: clang-3.8 + MSan + Fuzz Test # ~14.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700124 script:
125 - make clang38install
126 - CC=clang-3.8 make clean msan-fuzztest
Yann Collet515c2aa2018-12-24 02:56:21 -0800127
Yann Collet228a6d22019-11-26 10:24:09 -0800128 - name: ASan + UBSan + MSan + Regression Test # ~ 4.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700129 script:
130 - make -j uasanregressiontest
131 - make clean
132 - make -j msanregressiontest
133
Yann Collet87ae7b92019-11-26 10:30:11 -0800134 - name: C++, gnu90 and c99 compatibility # ~3mn
135 script:
136 - make cxxtest
137 - make clean
138 - make gnu90build
139 - make clean
140 - make c99build
141 - make clean
142 - make travis-install # just ensures `make install` works
143
Yann Colletd6e32af2019-11-27 12:44:02 -0800144 - name: mingw cross-compilation
145 script :
146 - sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix;
Yann Collet52dc6ff2019-11-27 14:39:43 -0800147 - CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CFLAGS="-Werror -O1" make zstd
Yann Colletd6e32af2019-11-27 12:44:02 -0800148
Yann Collet228a6d22019-11-26 10:24:09 -0800149 - name: Valgrind + Fuzz Test Stack Mode # ~ 7mn
Lzu Taob3be8992018-12-14 01:38:06 +0700150 script:
151 - make valgrindinstall
152 - make -C tests clean valgrindTest
153 - make clean
154 - make -C tests test-fuzzer-stackmode
155
Yann Collet228a6d22019-11-26 10:24:09 -0800156 - name: Qemu ARM emulation + Fuzz Test # ~13.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700157 script:
158 - make arminstall
159 - make armfuzz
Yann Colletc8d1fda2018-12-21 15:08:48 -0800160
W. Felix Handte976c0552019-12-05 17:14:57 -0500161 # Introduced to check compat with old toolchains, to prevent e.g. #1872
162 - name: ARM Build Test (on Trusty)
163 dist: trusty
164 script:
165 - make arminstall
166 - make armbuild
167
Yann Colletecaf3ce2019-11-26 16:44:56 -0800168 - name: Qemu PPC + Fuzz Test # ~13mn
169 dist: trusty # it seems ppc cross-compilation fails on "current"
Lzu Taob3be8992018-12-14 01:38:06 +0700170 script:
171 - make ppcinstall
172 - make ppcfuzz
Yann Colletc8d1fda2018-12-21 15:08:48 -0800173
Yann Collet228a6d22019-11-26 10:24:09 -0800174 # check release number (release only)
Lzu Taob3be8992018-12-14 01:38:06 +0700175 - name: Tag-Specific Test
176 if: tag =~ ^v[0-9]\.[0-9]
177 script:
178 - make -C tests checkTag
179 - tests/checkTag "$TRAVIS_BRANCH"
180
Yann Collet81dab452018-12-24 03:31:40 -0800181 # tests for master branch and cron job only
Yann Collet228a6d22019-11-26 10:24:09 -0800182 - name: OS-X # ~13mn
Yann Collet37466932019-12-14 13:29:24 -0800183 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800184 os: osx
185 script:
186 - make test
W. Felix Handte85801b92020-05-08 13:10:20 -0400187 - make -C lib all
Yann Collet81dab452018-12-24 03:31:40 -0800188
Bimba Shrestha6a4258a2020-02-05 16:55:00 -0800189 - name: zbuff test
190 if: branch = master
191 script:
Yann Collet14aaa522020-05-21 00:22:52 -0700192 - make -C tests test-zbuff
Bimba Shrestha6a4258a2020-02-05 16:55:00 -0800193
Yann Collet1d7adee2019-11-26 10:28:21 -0800194 - name: Versions Compatibility Test # 11.5mn
195 if: branch = master
196 script:
197 - make -C tests versionsTest
198
Yann Collet228a6d22019-11-26 10:24:09 -0800199 - name: thread sanitizer # ~29mn
Yann Collet66b21b62018-12-24 03:44:57 -0800200 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800201 script:
202 - make clang38install
203 - CC=clang-3.8 make tsan-test-zstream
Yann Collet7d51e1a2018-12-24 04:15:41 -0800204 - CC=clang-3.8 make tsan-fuzztest
Yann Collet81dab452018-12-24 03:31:40 -0800205
Yann Collet37466932019-12-14 13:29:24 -0800206 - name: Qemu PPC64 + Fuzz test # ~13mn
Yann Collet7d51e1a2018-12-24 04:15:41 -0800207 if: branch = master
208 script:
209 - make ppcinstall
210 - make ppc64fuzz
211
Yann Collet37466932019-12-14 13:29:24 -0800212 - name: PPC64LE + Fuzz test # ~13mn
213 if: branch = master
214 arch: ppc64le
215 script:
216 - cat /proc/cpuinfo
217 - make test
218
Yann Colletd6e32af2019-11-27 12:44:02 -0800219 # note : we already have aarch64 tests on hardware
220 - name: Qemu aarch64 + Fuzz Test (on Xenial) # ~14mn
221 if: branch = master
222 dist: xenial
223 script:
224 - make arminstall
225 - make aarch64fuzz
226
Yann Collet228a6d22019-11-26 10:24:09 -0800227 - name: zlib wrapper test # ~7.5mn
Yann Collet66b21b62018-12-24 03:44:57 -0800228 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800229 script:
230 - make gpp6install valgrindinstall
231 - make -C zlibWrapper test
232 - make -C zlibWrapper valgrindTest
233
Yann Collet228a6d22019-11-26 10:24:09 -0800234 - name: LZ4, thread pool, and partial libs tests # ~2mn
Yann Collet7d51e1a2018-12-24 04:15:41 -0800235 if: branch = master
236 script:
237 - make lz4install
238 - make -C tests test-lz4
239 - make clean
240 - make -C tests test-pool
241 - make clean
242 - bash tests/libzstd_partial_builds.sh
243
Yann Collet81dab452018-12-24 03:31:40 -0800244 # meson dedicated test
Yann Collet228a6d22019-11-26 10:24:09 -0800245 - name: Xenial (Meson + clang) # ~8mn
246 if: branch = master
Lzu Taob3be8992018-12-14 01:38:06 +0700247 dist: xenial
248 language: cpp
249 compiler: clang
Lzu Tao889a4922018-12-28 10:07:05 +0700250 install:
Lzu Taob3be8992018-12-14 01:38:06 +0700251 - sudo apt-get install -qq liblz4-dev valgrind tree
Lzu Tao4d156852019-06-29 01:42:17 +0700252 - |
253 travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' &&
254 unzip ~/ninja.zip -d ~/.local/bin
255 - |
256 travis_retry curl -o ~/get-pip.py -L 'https://bootstrap.pypa.io/get-pip.py' &&
257 python3 ~/get-pip.py --user &&
258 pip3 install --user meson
Lzu Taob3be8992018-12-14 01:38:06 +0700259 script:
Lzu Tao4d156852019-06-29 01:42:17 +0700260 - |
261 meson setup \
262 --buildtype=debugoptimized \
263 -Db_lundef=false \
264 -Dauto_features=enabled \
Lzu Tao8e590a12019-06-29 01:59:57 +0700265 -Dbin_programs=true \
266 -Dbin_tests=true \
267 -Dbin_contrib=true \
Lzu Tao4d156852019-06-29 01:42:17 +0700268 -Ddefault_library=both \
lzutao1d70bc32019-05-03 02:35:37 +0700269 build/meson builddir
Lzu Tao5d900ff2019-04-30 13:12:00 +0700270 - pushd builddir
lzutao1d70bc32019-05-03 02:35:37 +0700271 - ninja
272 - meson test --verbose --no-rebuild
Lzu Taob3be8992018-12-14 01:38:06 +0700273 - DESTDIR=./staging ninja install
274 - tree ./staging
lzutao1d70bc32019-05-03 02:35:37 +0700275 after_failure:
276 - cat "$TRAVIS_BUILD_DIR"/builddir/meson-logs/testlog.txt
Bimba Shrestha5228c072019-10-22 17:43:29 -0700277
Lzu Taob3be8992018-12-14 01:38:06 +0700278 allow_failures:
Lzu Tao889a4922018-12-28 10:07:05 +0700279 - env: ALLOW_FAILURES=true