meson: Enable testing in CI (#1609)

* tests: Fix shellcheck warnings in playTests.sh

* tests: Do not use ../programs which is relative to tests dirs

This commit fixes error when running playTests.sh in Meson.
Mesonbuild runs out of tree, so ./datagen not in `zstd/tests` dir,
it lies in <mesonbuilddir>/tests. This leads to ../programs invalid.

* tests: Replace relative paths for zstd/tests dir

* playTests: Set shell options explicitly, not in shebang

* playTests: Replace echo -e with printf

* meson: Fix test-zstd

Use std=gnu99 to build and test just like `make test`.

* meson: Fix legacy test

* meson: Enable testing in CI

Run build under release mode for faster test time.

* meson: Increase timeout time for test-zstream
This commit is contained in:
lzutao 2019-05-03 02:35:37 +07:00 committed by Nick Terrell
parent f8178ec74e
commit 1d70bc3ba9
4 changed files with 299 additions and 284 deletions

View File

@ -190,14 +190,19 @@ matrix:
&& python3 ~/get-pip.py --user
&& pip3 install --user meson
script:
- meson setup --buildtype=debug
- meson setup
--buildtype=debugoptimized
-Db_lundef=false
-Dauto_features=enabled
-Dbuild_{programs,tests,contrib}=true
-Ddefault_library=both
build/meson builddir
- pushd builddir
- ninja
- meson test --verbose --no-rebuild
- DESTDIR=./staging ninja install
- tree ./staging
after_failure:
- cat "$TRAVIS_BUILD_DIR"/builddir/meson-logs/testlog.txt
allow_failures:
- env: ALLOW_FAILURES=true

View File

@ -12,7 +12,7 @@ project('zstd',
['c', 'cpp'],
license: ['BSD', 'GPLv2'],
default_options : [
'c_std=c99',
'c_std=gnu99',
'cpp_std=c++11',
'buildtype=release'
],

View File

@ -112,6 +112,7 @@ invalidDictionaries = executable('invalidDictionaries',
dependencies: [ libzstd_dep ],
install: false)
if 0 < legacy_level and legacy_level <= 4
legacy_sources = [join_paths(zstd_rootdir, 'tests/legacy.c')]
legacy = executable('legacy',
legacy_sources,
@ -119,6 +120,7 @@ legacy = executable('legacy',
#c_args: '-DZSTD_LEGACY_SUPPORT=4',
dependencies: [ libzstd_dep ],
install: false)
endif
decodecorpus_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
join_paths(zstd_rootdir, 'programs/timefn.c'),
@ -177,7 +179,8 @@ if host_machine_os != os_windows
args: ZSTDRTTEST,
env: ['ZSTD=' + zstd.full_path()],
depends: [datagen],
timeout: 600) # Timeout should work on HDD drive
workdir: meson.current_build_dir(),
timeout: 2800) # Timeout should work on HDD drive
endif
test('test-fullbench-1',
@ -195,7 +198,7 @@ if use_zlib
test('test-fuzzer',
fuzzer,
args: ['-v', FUZZERTEST] + FUZZER_FLAGS,
timeout: 240)
timeout: 480)
endif
test('test-zbuff',
@ -205,7 +208,7 @@ test('test-zbuff',
test('test-zstream-1',
zstreamtest,
args: ['-v', ZSTREAM_TESTTIME] + FUZZER_FLAGS,
timeout: 120)
timeout: 240)
test('test-zstream-2',
zstreamtest,
args: ['-mt', '-t1', ZSTREAM_TESTTIME] + FUZZER_FLAGS,
@ -217,7 +220,9 @@ test('test-zstream-3',
test('test-longmatch', longmatch, timeout: 36)
test('test-invalidDictionaries', invalidDictionaries) # should be fast
test('test-symbols', symbols) # should be fast
if 0 < legacy_level and legacy_level <= 4
test('test-legacy', legacy) # should be fast
endif
test('test-decodecorpus',
decodecorpus,
args: ['-t', DECODECORPUS_TESTTIME],

File diff suppressed because it is too large Load Diff