From b750101eb236130cf056c675997decbac904cc49 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:35:18 +0200 Subject: Adding upstream version 252.22. Signed-off-by: Daniel Baumann --- test/fuzz/meson.build | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/fuzz/meson.build (limited to 'test/fuzz/meson.build') diff --git a/test/fuzz/meson.build b/test/fuzz/meson.build new file mode 100644 index 0000000..80362d4 --- /dev/null +++ b/test/fuzz/meson.build @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +sanitize_address_undefined = custom_target( + 'sanitize-address-undefined-fuzzers', + output : 'sanitize-address-undefined-fuzzers', + command : [meson_build_sh, + project_source_root, + '@OUTPUT@', + 'fuzzers', + '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ -Dc_args=@2@ -Dcpp_args=@2@ -Dskip-deps=@3@'.format( + get_option('optimization'), + get_option('werror') ? '--werror' : '', + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', + get_option('skip-deps') + ), + ' '.join(cc.cmd_array()), + cxx_cmd]) + +sanitizers = [['address,undefined', sanitize_address_undefined]] + +if git.found() and fs.exists(project_source_root / '.git') + out = run_command(env, '-u', 'GIT_WORK_TREE', + git, '--git-dir=@0@/.git'.format(project_source_root), + 'ls-files', ':/test/fuzz/*/*', + check: true) +else + out = run_command(sh, '-c', 'cd "@0@"; echo test/fuzz/*/*'.format(project_source_root), check: true) +endif + +fuzz_regression_tests = [] +foreach p : out.stdout().split() + # Remove the last entry which is ''. + # + # Also, backslashes get mangled, so skip test. See + # https://github.com/mesonbuild/meson/issues/1564. + if not p.contains('\\') + fuzz_regression_tests += p + endif +endforeach -- cgit v1.2.3