diff --git a/meson.build b/meson.build index 6b36c78d3ed..5c8e7e7979e 100644 --- a/meson.build +++ b/meson.build @@ -4699,7 +4699,7 @@ check_help = find_program('tools/check-help.sh') check_version = find_program('tools/check-version.sh') foreach exec : public_programs - name = exec.full_path().split('/')[-1] + name = fs.name(exec.full_path()) if want_tests != 'false' test('check-help-' + name, check_help, diff --git a/src/systemd/meson.build b/src/systemd/meson.build index 5a8760deb52..85accfef286 100644 --- a/src/systemd/meson.build +++ b/src/systemd/meson.build @@ -84,7 +84,7 @@ endif foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path] foreach opt : opts std_name = opt.length() == 2 ? '_'.join(opt[1].split(':')) : '' - test('cc-' + header.split('/')[-1] + '_' + opt[0] + std_name, + test('cc-' + fs.name(header) + '_' + opt[0] + std_name, env, suite : 'headers', args : [cc.cmd_array(), diff --git a/src/udev/meson.build b/src/udev/meson.build index 369db33fe4a..96f7930e9ee 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -130,7 +130,7 @@ endif udev_prog_paths = {} foreach prog : udev_progs - name = prog[0].split('/')[0] + name = fs.stem(prog[0]) exe = executable( name, diff --git a/test/fuzz/meson.build b/test/fuzz/meson.build index a8fb71c566d..61a62a75a3c 100644 --- a/test/fuzz/meson.build +++ b/test/fuzz/meson.build @@ -83,8 +83,8 @@ foreach p : out.stdout().split() if p.contains('\\') continue endif - fuzzer = p.split('/')[-2] - fuzz_in = p.split('/')[-1] + fuzzer = fs.name(fs.parent(p)) + fuzz_in = fs.name(p) if fuzzer not in fuzz_regression_tests fuzz_regression_tests += {fuzzer: []} endif diff --git a/test/meson.build b/test/meson.build index 0b0a32c0d14..a049750116d 100644 --- a/test/meson.build +++ b/test/meson.build @@ -155,9 +155,7 @@ if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family()) foreach p : out.stdout().split() source = project_source_root / p - name = 'dmidecode_' + p.split('/')[-1].split('.')[0] - - test(name, + test('dmidecode_' + fs.stem(p), udev_dmi_memory_id_test, suite : 'dist', args : [udev_prog_paths['dmi_memory_id'].full_path(),