'systemd-runtest.env',
output : 'systemd-runtest.env',
command : ['sh', '-c', '{ ' +
- 'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(project_source_root, 'test')) +
- 'echo SYSTEMD_CATALOG_DIR=@0@; '.format(join_paths(project_build_root, 'catalog')) +
- '} >@OUTPUT@'],
+ 'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(project_source_root, 'test')) +
+ 'echo SYSTEMD_CATALOG_DIR=@0@; '.format(join_paths(project_build_root, 'catalog')) +
+ '} >@OUTPUT@'],
build_by_default : true)
-# We intentionally do not do inline initializations with definitions for
-# a bunch of _cleanup_ variables in tests, to ensure valgrind is triggered.
-# This triggers a lot of maybe-uninitialized false positives when the
-# combination of -O2 and -flto is used. Suppress them.
-no_uninit = '-O2' in get_option('c_args') and '-flto=auto' in get_option('c_args') ? cc.first_supported_argument('-Wno-maybe-uninitialized') : []
+test_cflags = ['-DTEST_CODE=1']
+# We intentionally do not do inline initializations with definitions for a
+# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
+# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
+# false positives when the combination of -O2 and -flto is used. Suppress them.
+if '-O2' in get_option('c_args') and '-flto=auto' in get_option('c_args')
+ test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
+endif
+
foreach tuple : tests
sources = tuple[0]
link_with = tuple.length() > 1 and tuple[1].length() > 0 ? tuple[1] : [libshared]