Skip to content

Commit 32c78db

Browse files
authored
ci: run regression tests against oss-fuzz corpora (#115)
1 parent 105d4c1 commit 32c78db

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.gitlab-ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ stages:
66

77
before_script:
88
- apt update
9-
- apt install -y build-essential meson clang-tools clang-tidy libfuzzer-7-dev libubsan1 zlib1g-dev libpng-dev pkg-config gcovr wget tar curl
9+
- apt install -y build-essential meson git git-lfs unzip clang-tools clang-tidy libfuzzer-7-dev libubsan1 zlib1g-dev libpng-dev pkg-config gcovr wget tar curl
1010

1111
test:
1212
stage: test
1313
script:
14-
- CC=clang-7 CXX=clang++-7 meson -Ddev_build=true -Db_sanitize=address,undefined -Db_lundef=false --wrap-mode=forcefallback clang_build
14+
- CC=clang-7 CXX=clang++-7 meson -Ddev_build=true -Duse_miniz=true -Db_sanitize=address,undefined -Db_lundef=false --wrap-mode=forcefallback -Doptimization=1 -Doss_fuzz=true clang_build
1515
- cd clang_build
16-
- ninja test
1716
- ninja scan-build # this uses gcc due to a bug: https://github.com/mesonbuild/meson/issues/5716
18-
- meson configure -Duse_miniz=true
1917
- ninja test
2018
- meson configure -Db_sanitize=memory
2119
- MSAN_OPTIONS=exitcode=100 ninja test

tests/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ add_languages('cpp', native : false)
22
cpp = meson.get_compiler('cpp')
33

44
if cc.has_function('fmemopen', prefix : '#include <stdio.h>', args : '-D_GNU_SOURCE')
5-
repro_exe = executable(
5+
read_fuzzer = executable(
66
'fuzz_repro',
77
'fuzz_main.c', 'spng_read_fuzzer.c',
88
c_args : '-D_GNU_SOURCE',
@@ -27,6 +27,6 @@ if get_option('oss_fuzz') == true
2727
corpora = subproject('fuzzing_corpora').get_variable('corpora')
2828

2929
foreach case : corpora
30-
test('testcase', test_exe, args : case, should_fail : true)
30+
test('testcase', read_fuzzer, args : case)
3131
endforeach
3232
endif

0 commit comments

Comments
 (0)