2018-05-17 01:28:53 +02:00
|
|
|
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',
|
2018-05-17 01:28:53 +02:00
|
|
|
]
|
|
|
|
|
2020-03-24 16:38:40 +01:00
|
|
|
foreach file_name : tests
|
2020-07-06 20:59:56 +02:00
|
|
|
test_name = file_name.split('.')[0]
|
2018-05-17 01:28:53 +02:00
|
|
|
|
2020-07-06 20:10:51 +02:00
|
|
|
sources = [file_name]
|
|
|
|
fuzzer_ldflags = []
|
2020-07-14 16:59:58 +02:00
|
|
|
extra_cpp_args = []
|
2020-07-06 20:10:51 +02:00
|
|
|
|
|
|
|
if get_option('fuzzer_ldflags') == ''
|
|
|
|
sources += 'main.cc'
|
|
|
|
else
|
2020-07-07 22:36:30 +02:00
|
|
|
fuzzer_ldflags += get_option('fuzzer_ldflags').split()
|
2020-07-14 16:59:58 +02:00
|
|
|
extra_cpp_args += '-DHB_IS_IN_FUZZER'
|
2020-07-06 20:10:51 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
exe = executable(test_name, sources,
|
2020-07-14 16:59:58 +02:00
|
|
|
cpp_args: cpp_args + extra_cpp_args,
|
2018-11-14 21:19:36 +01:00
|
|
|
include_directories: [incconfig, incsrc],
|
2020-07-06 20:10:51 +02:00
|
|
|
link_args: fuzzer_ldflags,
|
2018-05-17 01:28:53 +02:00
|
|
|
link_with: [libharfbuzz, libharfbuzz_subset],
|
2020-03-24 19:05:41 +01:00
|
|
|
install: false,
|
2018-05-17 01:28:53 +02:00
|
|
|
)
|
2018-05-17 23:52:36 +02:00
|
|
|
set_variable('@0@_exe'.format(test_name.underscorify()), exe)
|
2018-05-17 01:28:53 +02:00
|
|
|
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'),
|
2018-05-17 01:28:53 +02:00
|
|
|
args: [
|
2018-05-17 23:52:36 +02:00
|
|
|
hb_shape_fuzzer_exe,
|
2018-05-17 01:28:53 +02:00
|
|
|
],
|
2020-07-22 14:53:22 +02:00
|
|
|
timeout: 60,
|
2018-05-18 01:25:22 +02:00
|
|
|
depends: [hb_shape_fuzzer_exe, libharfbuzz, libharfbuzz_subset],
|
2020-08-12 21:43:06 +02:00
|
|
|
workdir: join_paths(meson.current_build_dir(), '..', '..'),
|
2020-05-30 11:47:56 +02:00
|
|
|
env: env,
|
2020-06-21 00:04:59 +02:00
|
|
|
suite: ['fuzzing', 'slow'],
|
2020-05-30 11:47:56 +02:00
|
|
|
)
|
2018-05-17 01:28:53 +02:00
|
|
|
|
2020-03-24 16:11:53 +01:00
|
|
|
test('subset_fuzzer', find_program('run-subset-fuzzer-tests.py'),
|
2018-05-17 01:28:53 +02:00
|
|
|
args: [
|
2018-05-17 23:52:36 +02:00
|
|
|
hb_subset_fuzzer_exe,
|
2018-05-17 01:28:53 +02:00
|
|
|
],
|
2020-03-24 16:09:42 +01:00
|
|
|
# as the tests are ran concurrently let's raise acceptable time here
|
|
|
|
# ideally better to break and let meson handles them in parallel
|
2020-05-21 11:53:36 +02:00
|
|
|
timeout: 300,
|
2020-08-12 21:43:06 +02:00
|
|
|
workdir: join_paths(meson.current_build_dir(), '..', '..'),
|
2020-05-30 11:47:56 +02:00
|
|
|
env: env,
|
2020-06-21 00:04:59 +02:00
|
|
|
suite: ['fuzzing', 'slow'],
|
2020-05-30 11:47:56 +02:00
|
|
|
)
|
2020-03-24 16:38:40 +01:00
|
|
|
|
|
|
|
test('draw_fuzzer', find_program('run-draw-fuzzer-tests.py'),
|
|
|
|
args: [
|
|
|
|
hb_draw_fuzzer_exe,
|
|
|
|
],
|
2020-08-12 21:43:06 +02:00
|
|
|
workdir: join_paths(meson.current_build_dir(), '..', '..'),
|
2020-05-30 11:47:56 +02:00
|
|
|
env: env,
|
|
|
|
suite: ['fuzzing'],
|
|
|
|
)
|