Skip to content

Commit

Permalink
meson: use fs.stem() to get the test name
Browse files Browse the repository at this point in the history
Apart from looking way nicer, it also gets rid of a deprecation warning
with meson >= 1.3.0:

...
Configuring config.h using configuration
meson.build:75: DEPRECATION: Project uses feature that was always broken, and is now deprecated since '1.3.0': str.format: Value other than strings, integers, bools, options, dictionaries and lists thereof..
Build targets in project: 3
WARNING: Broken features used:
 * 1.3.0: {'str.format: Value other than strings, integers, bools, options, dictionaries and lists thereof.'}

Docs: https://mesonbuild.com/Fs-module.html#stem
  • Loading branch information
mrc0mmand committed Dec 20, 2023
1 parent b440bf5 commit 9e448b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ config_h = configure_file(
output : 'config.h',
configuration : conf)

fs = import('fs')

add_project_arguments('-include', 'config.h', language : 'c')

subdir('src')
Expand Down Expand Up @@ -72,7 +74,7 @@ install_data('src/dfuzzer.conf', install_dir : get_option('sysconfdir'))

foreach tuple : tests
sources = tuple[0]
name = '@0@'.format(sources[0]).split('/')[-1].split('.')[0]
name = fs.stem(sources[0])

exe = executable(
name,
Expand Down

0 comments on commit 9e448b0

Please sign in to comment.