test: build fuzzers with --werror if set
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 4 Jan 2022 11:51:44 +0000 (12:51 +0100)
committerEvgeny Vereshchagin <evvers@ya.ru>
Tue, 4 Jan 2022 15:49:56 +0000 (18:49 +0300)
to catch issues like systemd/systemd#21996.

test/fuzz/meson.build

index 30e26b09cff7c0fb3bea12e8c1d5946ee1dc1c54..706bdb329bda4d5050ed919d55ffe362721481a2 100644 (file)
@@ -7,7 +7,10 @@ sanitize_address_undefined = custom_target(
                    project_source_root,
                    '@OUTPUT@',
                    'fuzzers',
-                   '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@'.format(get_option('optimization')),
+                   '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@'.format(
+                           get_option('optimization'),
+                           get_option('werror') ? '--werror' : ''
+                   ),
                    ' '.join(cc.cmd_array()),
                    cxx_cmd])