• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1tests = [
2  'hb-shape-fuzzer.cc',
3  'hb-subset-fuzzer.cc',
4  'hb-set-fuzzer.cc',
5  'hb-draw-fuzzer.cc',
6]
7
8foreach file_name : tests
9  test_name = file_name.split('.')[0]
10
11  sources = [file_name]
12  fuzzer_ldflags = []
13  extra_cpp_args = []
14
15  if get_option('fuzzer_ldflags') == ''
16    sources += 'main.cc'
17  else
18    fuzzer_ldflags += get_option('fuzzer_ldflags').split()
19    extra_cpp_args += '-DHB_IS_IN_FUZZER'
20  endif
21
22  exe = executable(test_name, sources,
23    cpp_args: cpp_args + extra_cpp_args,
24    include_directories: [incconfig, incsrc],
25    link_args: fuzzer_ldflags,
26    link_with: [libharfbuzz, libharfbuzz_subset],
27    install: false,
28  )
29  set_variable('@0@_exe'.format(test_name.underscorify()), exe)
30endforeach
31
32env = environment()
33env.set('srcdir', meson.current_source_dir())
34
35test('shape_fuzzer', find_program('run-shape-fuzzer-tests.py'),
36  args: [
37    hb_shape_fuzzer_exe,
38  ],
39  timeout: 300,
40  depends: [hb_shape_fuzzer_exe, libharfbuzz, libharfbuzz_subset],
41  workdir: join_paths(meson.current_build_dir(), '..', '..'),
42  env: env,
43  suite: ['fuzzing', 'slow'],
44)
45
46test('subset_fuzzer', find_program('run-subset-fuzzer-tests.py'),
47  args: [
48    hb_subset_fuzzer_exe,
49  ],
50  # as the tests are ran concurrently let's raise acceptable time here
51  # ideally better to break and let meson handles them in parallel
52  timeout: 300,
53  workdir: join_paths(meson.current_build_dir(), '..', '..'),
54  env: env,
55  suite: ['fuzzing', 'slow'],
56)
57
58test('draw_fuzzer', find_program('run-draw-fuzzer-tests.py'),
59  args: [
60    hb_draw_fuzzer_exe,
61  ],
62  workdir: join_paths(meson.current_build_dir(), '..', '..'),
63  env: env,
64  suite: ['fuzzing'],
65)
66