]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: cleanup tests to use libcommon.la
authorKarel Zak <kzak@redhat.com>
Tue, 1 Jul 2025 15:52:40 +0000 (17:52 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 1 Sep 2025 11:49:48 +0000 (13:49 +0200)
This change simplifies future test work.

Signed-off-by: Karel Zak <kzak@redhat.com>
meson.build

index e3038240a8258ff846b635e6126e2570cc948c02..38adc8d07bac9f920aa7b3e75ae386c857451d27 100644 (file)
@@ -3487,6 +3487,7 @@ exe = executable(
   'lib/strutils.c',
   c_args : ['-DTEST_PROGRAM_STRUTILS'],
   include_directories : dir_include,
+  link_with : lib_common,
   build_by_default: program_tests)
 if not is_disabler(exe)
   exes += exe
@@ -3530,8 +3531,6 @@ if conf.get('HAVE_OPENAT').to_string() == '1' \
   exe = executable(
     'test_path',
     'lib/path.c',
-    'lib/fileutils.c',
-    have_cpu_set_t ? 'lib/cpuset.c' : [],
     c_args : ['-DTEST_PROGRAM_PATH'],
     include_directories : dir_include,
     link_with : lib_common,
@@ -3564,6 +3563,7 @@ if LINUX
     'lib/cpuset.c',
     c_args : ['-DTEST_PROGRAM_CPUSET'],
     include_directories : dir_include,
+    link_with : lib_common,
     build_by_default: program_tests)
   if not is_disabler(exe)
     exes += exe
@@ -3573,13 +3573,9 @@ endif
 exe = executable(
   'test_sysfs',
   'lib/sysfs.c',
-  'lib/path.c',
-  'lib/buffer.c',
-  'lib/mbsalign.c',
-  'lib/fileutils.c',
-  have_cpu_set_t ? 'lib/cpuset.c' : [],
   c_args : ['-DTEST_PROGRAM_SYSFS'],
   include_directories : dir_include,
+  link_with : lib_common,
   build_by_default: program_tests)
 if not is_disabler(exe)
   exes += exe
@@ -3610,6 +3606,7 @@ exe = executable(
   'lib/fileutils.c',
   c_args : ['-DTEST_PROGRAM_FILEUTILS'],
   include_directories : dir_include,
+  link_with : lib_common,
   build_by_default: program_tests)
 if not is_disabler(exe)
   exes += exe
@@ -3620,6 +3617,7 @@ exe = executable(
   'lib/canonicalize.c',
   c_args : ['-DTEST_PROGRAM_CANONICALIZE'],
   include_directories : dir_include,
+  link_with : lib_common,
   build_by_default: program_tests)
 if not is_disabler(exe)
   exes += exe
@@ -3628,9 +3626,9 @@ endif
 exe = executable(
   'test_timeutils',
   'lib/timeutils.c',
-  'lib/strutils.c',
   c_args : ['-DTEST_PROGRAM_TIMEUTILS'],
   include_directories : dir_include,
+  link_with : lib_common,
   build_by_default: program_tests)
 if not is_disabler(exe)
   exes += exe