harfbuzz/test/fuzzing/meson.build

88 lines
2.2 KiB
Meson
Raw Permalink Normal View History

tests = [
2020-03-24 16:38:40 +01:00
'hb-shape-fuzzer.cc',
'hb-subset-fuzzer.cc',
'hb-set-fuzzer.cc',
'hb-draw-fuzzer.cc',
]
if get_option('experimental_api')
tests += 'hb-repacker-fuzzer.cc'
endif
2020-03-24 16:38:40 +01:00
foreach file_name : tests
test_name = file_name.split('.')[0]
sources = [file_name]
fuzzer_ldflags = []
2020-07-14 16:59:58 +02:00
extra_cpp_args = []
if get_option('fuzzer_ldflags') == ''
sources += 'main.cc'
else
fuzzer_ldflags += get_option('fuzzer_ldflags').split()
2020-07-14 16:59:58 +02:00
extra_cpp_args += '-DHB_IS_IN_FUZZER'
endif
if get_option('experimental_api')
extra_cpp_args += '-DHB_EXPERIMENTAL_API'
endif
exe = executable(test_name, sources,
2020-07-14 16:59:58 +02:00
cpp_args: cpp_args + extra_cpp_args,
include_directories: [incconfig, incsrc],
link_args: fuzzer_ldflags,
link_with: [libharfbuzz, libharfbuzz_subset],
install: false,
)
2018-05-17 23:52:36 +02:00
set_variable('@0@_exe'.format(test_name.underscorify()), exe)
endforeach
2018-05-17 23:52:36 +02:00
env = environment()
env.set('srcdir', meson.current_source_dir())
2020-03-24 16:11:53 +01:00
test('shape_fuzzer', find_program('run-shape-fuzzer-tests.py'),
args: [
2018-05-17 23:52:36 +02:00
hb_shape_fuzzer_exe,
],
2021-03-15 23:19:40 +01:00
timeout: 300,
depends: [hb_shape_fuzzer_exe, libharfbuzz, libharfbuzz_subset],
workdir: meson.current_build_dir() / '..' / '..',
env: env,
suite: ['fuzzing', 'slow'],
)
2020-03-24 16:11:53 +01:00
test('subset_fuzzer', find_program('run-subset-fuzzer-tests.py'),
args: [
2018-05-17 23:52:36 +02:00
hb_subset_fuzzer_exe,
],
# as the tests are ran concurrently let's raise acceptable time here
# ideally better to break and let meson handles them in parallel
timeout: 300,
workdir: meson.current_build_dir() / '..' / '..',
env: env,
suite: ['fuzzing', 'slow'],
)
2020-03-24 16:38:40 +01:00
if get_option('experimental_api')
test('repacker_fuzzer', find_program('run-repacker-fuzzer-tests.py'),
args: [
hb_repacker_fuzzer_exe,
],
# as the tests are ran concurrently let's raise acceptable time here
# ideally better to break and let meson handles them in parallel
timeout: 300,
workdir: meson.current_build_dir() / '..' / '..',
env: env,
suite: ['fuzzing', 'slow'],
)
endif
2020-03-24 16:38:40 +01:00
test('draw_fuzzer', find_program('run-draw-fuzzer-tests.py'),
args: [
hb_draw_fuzzer_exe,
],
workdir: meson.current_build_dir() / '..' / '..',
env: env,
suite: ['fuzzing'],
)