blob: a4046287feab309e8c1c8e4b97a8938f8247fa26 [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: PPC64LE + Fuzz test # ~13mn
207 if: branch = master
208 arch: ppc64le
209 script:
210 - cat /proc/cpuinfo
211 - make test
212
Yann Colleta63810e2020-05-21 10:26:40 -0700213 - name: Qemu PPC64 + Fuzz test # ~13mn, presumed Big-Endian (?)
214 dist: trusty # note : PPC64 cross-compilation for Qemu tests seems broken on Xenial
215 if: branch = master
216 script:
217 - make ppcinstall
218 - make ppc64fuzz
219
Yann Colletd6e32af2019-11-27 12:44:02 -0800220 # note : we already have aarch64 tests on hardware
221 - name: Qemu aarch64 + Fuzz Test (on Xenial) # ~14mn
222 if: branch = master
223 dist: xenial
224 script:
225 - make arminstall
226 - make aarch64fuzz
227
Yann Collet228a6d22019-11-26 10:24:09 -0800228 - name: zlib wrapper test # ~7.5mn
Yann Collet66b21b62018-12-24 03:44:57 -0800229 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800230 script:
231 - make gpp6install valgrindinstall
232 - make -C zlibWrapper test
233 - make -C zlibWrapper valgrindTest
234
Yann Collet228a6d22019-11-26 10:24:09 -0800235 - name: LZ4, thread pool, and partial libs tests # ~2mn
Yann Collet7d51e1a2018-12-24 04:15:41 -0800236 if: branch = master
237 script:
238 - make lz4install
239 - make -C tests test-lz4
240 - make clean
241 - make -C tests test-pool
242 - make clean
243 - bash tests/libzstd_partial_builds.sh
244
Yann Collet81dab452018-12-24 03:31:40 -0800245 # meson dedicated test
Yann Collet26b21e42020-05-21 14:19:28 -0700246 - name: Xenial (Meson + clang) # ~15mn
Yann Collet228a6d22019-11-26 10:24:09 -0800247 if: branch = master
Lzu Taob3be8992018-12-14 01:38:06 +0700248 dist: xenial
249 language: cpp
250 compiler: clang
Lzu Tao889a4922018-12-28 10:07:05 +0700251 install:
Lzu Taob3be8992018-12-14 01:38:06 +0700252 - sudo apt-get install -qq liblz4-dev valgrind tree
Lzu Tao4d156852019-06-29 01:42:17 +0700253 - |
254 travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' &&
255 unzip ~/ninja.zip -d ~/.local/bin
256 - |
257 travis_retry curl -o ~/get-pip.py -L 'https://bootstrap.pypa.io/get-pip.py' &&
258 python3 ~/get-pip.py --user &&
259 pip3 install --user meson
Lzu Taob3be8992018-12-14 01:38:06 +0700260 script:
Lzu Tao4d156852019-06-29 01:42:17 +0700261 - |
262 meson setup \
263 --buildtype=debugoptimized \
264 -Db_lundef=false \
265 -Dauto_features=enabled \
Lzu Tao8e590a12019-06-29 01:59:57 +0700266 -Dbin_programs=true \
267 -Dbin_tests=true \
268 -Dbin_contrib=true \
Lzu Tao4d156852019-06-29 01:42:17 +0700269 -Ddefault_library=both \
lzutao1d70bc32019-05-03 02:35:37 +0700270 build/meson builddir
Lzu Tao5d900ff2019-04-30 13:12:00 +0700271 - pushd builddir
lzutao1d70bc32019-05-03 02:35:37 +0700272 - ninja
273 - meson test --verbose --no-rebuild
Lzu Taob3be8992018-12-14 01:38:06 +0700274 - DESTDIR=./staging ninja install
275 - tree ./staging
lzutao1d70bc32019-05-03 02:35:37 +0700276 after_failure:
277 - cat "$TRAVIS_BUILD_DIR"/builddir/meson-logs/testlog.txt
Bimba Shrestha5228c072019-10-22 17:43:29 -0700278
Lzu Taob3be8992018-12-14 01:38:06 +0700279 allow_failures:
Lzu Tao889a4922018-12-28 10:07:05 +0700280 - env: ALLOW_FAILURES=true