diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 5c5ead4d850cc92efa57a004cc3cc8ab3172755a..fbb7d9cc33bef89d7f08af360f0dc7f8d450990e 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -73,6 +73,7 @@ class UnityTestRunnerGenerator all_files_used = [input_file, output_file] all_files_used += testfile_includes.map {|filename| filename + '.c'} unless testfile_includes.empty? all_files_used += @options[:includes] unless @options[:includes].empty? + all_files_used += headers[:linkonly] unless headers[:linkonly].empty? return all_files_used.uniq end @@ -146,7 +147,8 @@ class UnityTestRunnerGenerator #parse out includes includes = { :local => source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten, - :system => source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" } + :system => source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" }, + :linkonly => source.scan(/^TEST_FILE\(\s*\"\s*(.+)\.[cC]\w*\s*\"/).flatten } return includes end diff --git a/test/testdata/testRunnerGeneratorSmall.c b/test/testdata/testRunnerGeneratorSmall.c index 9f4ec195c2f07d817decb2984863849c3ae05f66..c683749480fc8b7794f1dc1a793322b2c70e1092 100644 --- a/test/testdata/testRunnerGeneratorSmall.c +++ b/test/testdata/testRunnerGeneratorSmall.c @@ -4,6 +4,8 @@ #include "unity.h" #include "Defs.h" +TEST_FILE("some_file.c") + /* Notes about prefixes: test - normal default prefix. these are "always run" tests for this procedure spec - normal default prefix. required to run default setup/teardown calls.