Skip to content

Commit ba30b89

Browse files
committed
meson: run tests if with option program-tests
1 parent 922d025 commit ba30b89

File tree

3 files changed

+118
-64
lines changed

3 files changed

+118
-64
lines changed

libmount/meson.build

+17-15
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,22 @@ libmount_test_src_override = {
131131
'debug': 'init',
132132
}
133133

134-
foreach libmount_test: libmount_tests
135-
test_name = 'test_mount_' + libmount_test
136-
exe = executable(
137-
test_name,
138-
'src/' + libmount_test_src_override.get(libmount_test, libmount_test) + '.c',
139-
include_directories : [dir_include, dir_libblkid],
140-
link_with : [lib__mount, lib_common, lib_blkid_static],
141-
dependencies : lib__mount_deps,
142-
c_args : ['-DTEST_PROGRAM'],
143-
)
144-
# the test-setup expects the helpers in the toplevel build-directory
145-
link = meson.project_build_root() / test_name
146-
run_command('ln', '-srf', exe.full_path(), link,
147-
check : true)
148-
endforeach
134+
if program_tests
135+
foreach libmount_test: libmount_tests
136+
test_name = 'test_mount_' + libmount_test
137+
exe = executable(
138+
test_name,
139+
'src/' + libmount_test_src_override.get(libmount_test, libmount_test) + '.c',
140+
include_directories : [dir_include, dir_libblkid],
141+
link_with : [lib__mount, lib_common, lib_blkid_static],
142+
dependencies : lib__mount_deps,
143+
c_args : ['-DTEST_PROGRAM'],
144+
)
145+
# the test-setup expects the helpers in the toplevel build-directory
146+
link = meson.project_build_root() / test_name
147+
run_command('ln', '-srf', exe.full_path(), link,
148+
check : true)
149+
endforeach
150+
endif
149151

150152
subdir('python')

0 commit comments

Comments
 (0)