Skip to content

Commit 31f5b47

Browse files
committed
Add generator code to build file and make script executable
1 parent 61f4428 commit 31f5b47

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

auto/generate_test_runner.rb

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/ruby
2+
13
# ==========================================
24
# Unity Project - A Test Framework for C
35
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams

meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,15 @@ project('unity', 'c',
1212

1313
subdir('src')
1414
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
15+
16+
17+
# Get the generate_test_runner script relative to itself or the parent project if it is being used as a subproject
18+
# NOTE: This could be (and probably is) a complete hack - but I haven't yet been able to find a better way....
19+
if meson.is_subproject()
20+
gen_test_runner_path = find_program(meson.source_root() / 'subprojects/unity/auto/generate_test_runner.rb')
21+
else
22+
gen_test_runner_path = find_program('subprojects/unity/auto/generate_test_runner.rb')
23+
endif
24+
25+
# Create a generator that we can access from the parent project
26+
gen_test_runner = generator(gen_test_runner_path, output: '@BASENAME@_Runner.c', arguments: ['@INPUT@', '@OUTPUT@'] )

0 commit comments

Comments
 (0)