blob: 226d4c0154ee5e9756936a0c57b9ef47e36d3119 [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:
Yann Collet228a6d22019-11-26 10:24:09 -080028 - name: arm64 # ~2.5 mn
Bimba Shrestha4899b6f2019-10-23 10:43:20 -070029 os: linux
30 arch: arm64
31 script:
32 - make check
33
Bimba Shresthaeb76f782020-01-06 14:19:11 -080034 - name: make benchmarking
35 script:
36 - make benchmarking
37
38 - name: make test (complete)
Lzu Taob3be8992018-12-14 01:38:06 +070039 script:
Yann Collet7aaac3f2019-11-25 10:35:36 -080040 # DEVNULLRIGHTS : will request sudo rights to test permissions on /dev/null
41 - DEVNULLRIGHTS=test make test
Lzu Taob3be8992018-12-14 01:38:06 +070042
Yann Colletc6ae2e82020-04-28 18:29:20 -070043 - name: gcc-6 + gcc-7 + libzstdmt compilation # ~ 6mn
Lzu Taob3be8992018-12-14 01:38:06 +070044 script:
Yann Collet7d51e1a2018-12-24 04:15:41 -080045 - make gcc6install gcc7install
Lzu Taob3be8992018-12-14 01:38:06 +070046 - CC=gcc-6 CFLAGS=-Werror make -j all
47 - make clean
Yann Collet7d51e1a2018-12-24 04:15:41 -080048 - CC=gcc-7 CFLAGS=-Werror make -j all
Yann Colletc6ae2e82020-04-28 18:29:20 -070049 - make clean
50 - LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
Yann Collet7ea2ae62020-04-28 21:18:29 -070051 - make -C tests zbufftest-dll
52 # LDFLAGS=-Wl,--no-undefined : will make the linker fail if dll is underlinked
53 # zbufftest-dll : test that a user program can link to multi-threaded libzstd without specifying -pthread
Yann Collet515c2aa2018-12-24 02:56:21 -080054
Yann Collet228a6d22019-11-26 10:24:09 -080055 - name: gcc-8 + ASan + UBSan + Test Zstd # ~6.5mn
Lzu Taob3be8992018-12-14 01:38:06 +070056 script:
57 - make gcc8install
Yann Collet7d51e1a2018-12-24 04:15:41 -080058 - CC=gcc-8 CFLAGS="-Werror" make -j all
59 - make clean
60 - CC=gcc-8 make -j uasan-test-zstd </dev/null # test when stdin is not a tty
61
Yann Collet228a6d22019-11-26 10:24:09 -080062 - name: gcc-6 + ASan + UBSan + Test Zstd, 32bit mode # ~4mn
Yann Collet7d51e1a2018-12-24 04:15:41 -080063 script:
64 - make gcc6install libc6install
65 - CC=gcc-6 CFLAGS="-Werror -m32" make -j all32
66 - make clean
67 - CC=gcc-6 make -j uasan-test-zstd32 # note : can complain about pointer overflow
Yann Collet515c2aa2018-12-24 02:56:21 -080068
Yann Collet228a6d22019-11-26 10:24:09 -080069 - name: clang-3.8 + MSan + Test Zstd # ~3.5mn
Lzu Taob3be8992018-12-14 01:38:06 +070070 script:
71 - make clang38install
Yann Colletbad35bd2019-10-21 12:55:39 -070072 # External libraries must be turned off when using MSAN tests,
73 # because they are not msan-instrumented,
74 # so any data coming from these libraries is always considered "uninitialized"
75 - 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 +070076
Yann Collet228a6d22019-11-26 10:24:09 -080077 - name: Minimal Decompressor Macros # ~5mn
W. Felix Handte4e2f6c12018-12-05 14:04:57 -080078 script:
senhuang42adc53db2020-10-15 15:00:26 -040079 - make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
Yann Colleta9f7e772020-10-20 16:32:22 -070080 - make clean && make check ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
senhuang42adc53db2020-10-15 15:00:26 -040081 - make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
Yann Colleta9f7e772020-10-20 16:32:22 -070082 - make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
senhuang42adc53db2020-10-15 15:00:26 -040083 - make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG"
Yann Colleta9f7e772020-10-20 16:32:22 -070084 - make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG"
senhuang42adc53db2020-10-15 15:00:26 -040085 - make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
Yann Colleta9f7e772020-10-20 16:32:22 -070086 - make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
W. Felix Handte4e2f6c12018-12-05 14:04:57 -080087
Taylor Braun-Jones5b054d92020-03-23 16:08:52 -040088 - name: cmake build and test check # ~6mn
Lzu Taob3be8992018-12-14 01:38:06 +070089 script:
90 - make cmakebuild
91
Yann Collet228a6d22019-11-26 10:24:09 -080092 - name: static analyzer scanbuild # ~26mn
Yann Collet52dc6ff2019-11-27 14:39:43 -080093 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 +070094 script:
95 - make staticAnalyze
96
Yann Collet228a6d22019-11-26 10:24:09 -080097 - name: gcc-8 + ASan + UBSan + Fuzz Test # ~19mn
Lzu Taob3be8992018-12-14 01:38:06 +070098 script:
Yann Collet7d51e1a2018-12-24 04:15:41 -080099 - make gcc8install
100 - CC=gcc-8 make clean uasan-fuzztest
Yann Collet515c2aa2018-12-24 02:56:21 -0800101
Yann Collet228a6d22019-11-26 10:24:09 -0800102 - name: gcc-6 + ASan + UBSan + Fuzz Test 32bit # ~15.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700103 script:
104 - make gcc6install libc6install
Yann Collet7d51e1a2018-12-24 04:15:41 -0800105 - CC=gcc-6 CFLAGS="-O2 -m32" make uasan-fuzztest # can complain about pointer overflow
Yann Collet515c2aa2018-12-24 02:56:21 -0800106
Yann Collet228a6d22019-11-26 10:24:09 -0800107 - name: clang-3.8 + MSan + Fuzz Test # ~14.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700108 script:
109 - make clang38install
110 - CC=clang-3.8 make clean msan-fuzztest
Yann Collet515c2aa2018-12-24 02:56:21 -0800111
Yann Collet228a6d22019-11-26 10:24:09 -0800112 - name: ASan + UBSan + MSan + Regression Test # ~ 4.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700113 script:
114 - make -j uasanregressiontest
115 - make clean
116 - make -j msanregressiontest
117
Yann Collet87ae7b92019-11-26 10:30:11 -0800118 - name: C++, gnu90 and c99 compatibility # ~3mn
119 script:
120 - make cxxtest
121 - make clean
122 - make gnu90build
123 - make clean
124 - make c99build
125 - make clean
126 - make travis-install # just ensures `make install` works
127
Yann Colletd6e32af2019-11-27 12:44:02 -0800128 - name: mingw cross-compilation
129 script :
130 - sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix;
Yann Collet52dc6ff2019-11-27 14:39:43 -0800131 - CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CFLAGS="-Werror -O1" make zstd
Yann Colletd6e32af2019-11-27 12:44:02 -0800132
Yann Collet228a6d22019-11-26 10:24:09 -0800133 - name: Valgrind + Fuzz Test Stack Mode # ~ 7mn
Lzu Taob3be8992018-12-14 01:38:06 +0700134 script:
135 - make valgrindinstall
136 - make -C tests clean valgrindTest
137 - make clean
138 - make -C tests test-fuzzer-stackmode
139
Yann Collet228a6d22019-11-26 10:24:09 -0800140 - name: Qemu ARM emulation + Fuzz Test # ~13.5mn
Lzu Taob3be8992018-12-14 01:38:06 +0700141 script:
142 - make arminstall
143 - make armfuzz
Yann Colletc8d1fda2018-12-21 15:08:48 -0800144
W. Felix Handte976c0552019-12-05 17:14:57 -0500145 # Introduced to check compat with old toolchains, to prevent e.g. #1872
146 - name: ARM Build Test (on Trusty)
147 dist: trusty
148 script:
149 - make arminstall
150 - make armbuild
151
Yann Colletecaf3ce2019-11-26 16:44:56 -0800152 - name: Qemu PPC + Fuzz Test # ~13mn
153 dist: trusty # it seems ppc cross-compilation fails on "current"
Lzu Taob3be8992018-12-14 01:38:06 +0700154 script:
155 - make ppcinstall
156 - make ppcfuzz
Yann Colletc8d1fda2018-12-21 15:08:48 -0800157
Yann Collet228a6d22019-11-26 10:24:09 -0800158 # check release number (release only)
Lzu Taob3be8992018-12-14 01:38:06 +0700159 - name: Tag-Specific Test
160 if: tag =~ ^v[0-9]\.[0-9]
161 script:
162 - make -C tests checkTag
163 - tests/checkTag "$TRAVIS_BRANCH"
164
Yann Collet81dab452018-12-24 03:31:40 -0800165 # tests for master branch and cron job only
Yann Collet228a6d22019-11-26 10:24:09 -0800166 - name: OS-X # ~13mn
Yann Collet37466932019-12-14 13:29:24 -0800167 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800168 os: osx
169 script:
170 - make test
W. Felix Handte85801b92020-05-08 13:10:20 -0400171 - make -C lib all
Yann Collet81dab452018-12-24 03:31:40 -0800172
Bimba Shrestha6a4258a2020-02-05 16:55:00 -0800173 - name: zbuff test
174 if: branch = master
175 script:
Yann Collet14aaa522020-05-21 00:22:52 -0700176 - make -C tests test-zbuff
Bimba Shrestha6a4258a2020-02-05 16:55:00 -0800177
Yann Collet1d7adee2019-11-26 10:28:21 -0800178 - name: Versions Compatibility Test # 11.5mn
179 if: branch = master
180 script:
181 - make -C tests versionsTest
182
Yann Collet228a6d22019-11-26 10:24:09 -0800183 - name: thread sanitizer # ~29mn
Yann Collet66b21b62018-12-24 03:44:57 -0800184 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800185 script:
186 - make clang38install
187 - CC=clang-3.8 make tsan-test-zstream
Yann Collet7d51e1a2018-12-24 04:15:41 -0800188 - CC=clang-3.8 make tsan-fuzztest
Yann Collet81dab452018-12-24 03:31:40 -0800189
Yann Collet37466932019-12-14 13:29:24 -0800190 - name: PPC64LE + Fuzz test # ~13mn
191 if: branch = master
192 arch: ppc64le
193 script:
194 - cat /proc/cpuinfo
195 - make test
196
Yann Colleta63810e2020-05-21 10:26:40 -0700197 - name: Qemu PPC64 + Fuzz test # ~13mn, presumed Big-Endian (?)
198 dist: trusty # note : PPC64 cross-compilation for Qemu tests seems broken on Xenial
199 if: branch = master
200 script:
201 - make ppcinstall
202 - make ppc64fuzz
203
Yann Colletd6e32af2019-11-27 12:44:02 -0800204 # note : we already have aarch64 tests on hardware
205 - name: Qemu aarch64 + Fuzz Test (on Xenial) # ~14mn
206 if: branch = master
207 dist: xenial
208 script:
209 - make arminstall
210 - make aarch64fuzz
211
Yann Collet228a6d22019-11-26 10:24:09 -0800212 - name: zlib wrapper test # ~7.5mn
Yann Collet66b21b62018-12-24 03:44:57 -0800213 if: branch = master
Yann Collet81dab452018-12-24 03:31:40 -0800214 script:
215 - make gpp6install valgrindinstall
216 - make -C zlibWrapper test
217 - make -C zlibWrapper valgrindTest
218
Yann Colletb1546922020-11-30 05:32:43 -0800219 - name: LZ4, thread pool, and partial libs tests # ~4mn
Yann Collet7d51e1a2018-12-24 04:15:41 -0800220 if: branch = master
221 script:
222 - make lz4install
223 - make -C tests test-lz4
Yann Colletb1546922020-11-30 05:32:43 -0800224 - make check < /dev/null | tee # mess with lz4 console detection
Yann Collet7d51e1a2018-12-24 04:15:41 -0800225 - make clean
226 - make -C tests test-pool
227 - make clean
228 - bash tests/libzstd_partial_builds.sh
229
Yann Collet81dab452018-12-24 03:31:40 -0800230 # meson dedicated test
Yann Collet26b21e42020-05-21 14:19:28 -0700231 - name: Xenial (Meson + clang) # ~15mn
Yann Collet228a6d22019-11-26 10:24:09 -0800232 if: branch = master
Lzu Taob3be8992018-12-14 01:38:06 +0700233 dist: xenial
234 language: cpp
235 compiler: clang
Lzu Tao889a4922018-12-28 10:07:05 +0700236 install:
Lzu Taob3be8992018-12-14 01:38:06 +0700237 - sudo apt-get install -qq liblz4-dev valgrind tree
Lzu Tao4d156852019-06-29 01:42:17 +0700238 - |
239 travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' &&
240 unzip ~/ninja.zip -d ~/.local/bin
241 - |
242 travis_retry curl -o ~/get-pip.py -L 'https://bootstrap.pypa.io/get-pip.py' &&
243 python3 ~/get-pip.py --user &&
244 pip3 install --user meson
Lzu Taob3be8992018-12-14 01:38:06 +0700245 script:
Lzu Tao4d156852019-06-29 01:42:17 +0700246 - |
247 meson setup \
248 --buildtype=debugoptimized \
249 -Db_lundef=false \
250 -Dauto_features=enabled \
Lzu Tao8e590a12019-06-29 01:59:57 +0700251 -Dbin_programs=true \
252 -Dbin_tests=true \
253 -Dbin_contrib=true \
Lzu Tao4d156852019-06-29 01:42:17 +0700254 -Ddefault_library=both \
lzutao1d70bc32019-05-03 02:35:37 +0700255 build/meson builddir
Lzu Tao5d900ff2019-04-30 13:12:00 +0700256 - pushd builddir
lzutao1d70bc32019-05-03 02:35:37 +0700257 - ninja
258 - meson test --verbose --no-rebuild
Lzu Taob3be8992018-12-14 01:38:06 +0700259 - DESTDIR=./staging ninja install
260 - tree ./staging
lzutao1d70bc32019-05-03 02:35:37 +0700261 after_failure:
262 - cat "$TRAVIS_BUILD_DIR"/builddir/meson-logs/testlog.txt
Bimba Shrestha5228c072019-10-22 17:43:29 -0700263
Lzu Taob3be8992018-12-14 01:38:06 +0700264 allow_failures:
Lzu Tao889a4922018-12-28 10:07:05 +0700265 - env: ALLOW_FAILURES=true