Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/MesonGeneratorRunner.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,22 @@ Once you have the generator you need to pass it the absolute path of your test f

test_runner = meson.source_root() / 'test/test_example.c'

You can then include `test_runner` as a normal dependency to your builds. Meson will create the test runner in a private directory for each build target. It's only meant to be used as part of the build, so if you need to refer to the runner after the build, you won't be able to use the generator.
You can then include `test_runner` as a normal dependency to your builds. Meson will create the test runner in a private directory for each build target. It's only meant to be used as part of the build, so if you need to refer to the runner after the build, you won't be able to use the generator.

For cases where the generator's fixed output name is not suitable, the runner program is also available directly:

runner_program = unity_proj.get_variable('gen_test_runner_exe')

You can use it in a `custom_target()` to control the output name and pass any supported runner option:

test_runner = custom_target(
'test_example_runner',
input: 'test/test_example.c',
output: 'test_example_runner.c',
command: [
runner_program,
'--use_param_tests=1',
'@INPUT@',
'@OUTPUT@',
],
)
4 changes: 4 additions & 0 deletions docs/UnityChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Prior to 2008, the project was an internal project and not released to the publi

### Unity 2.7.2

New Features:

- Meson subprojects can access the test runner generator program directly for custom targets (#835). @Firat17aze

Significant Bugfixes:

- Default `UNITY_INCLUDE_EXEC_TIME` macros compile as ISO C99, are statement-safe, and accept `-Wsign-conversion` (#838)
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ endif

# Create a generator that can be used by consumers of our build system to generate
# test runners.
gen_test_runner_exe = find_program('auto/generate_test_runner.rb')
gen_test_runner = generator(
find_program('auto/generate_test_runner.rb'),
gen_test_runner_exe,
output: '@BASENAME@_Runner.c',
arguments: ['@EXTRA_ARGS@', '@INPUT@', '@OUTPUT@']
)