aboutsummaryrefslogtreecommitdiff
path: root/rakelib
diff options
context:
space:
mode:
Diffstat (limited to 'rakelib')
-rw-r--r--rakelib/gcc.rake20
1 files changed, 13 insertions, 7 deletions
diff --git a/rakelib/gcc.rake b/rakelib/gcc.rake
index db832e1..30175eb 100644
--- a/rakelib/gcc.rake
+++ b/rakelib/gcc.rake
@@ -249,13 +249,19 @@ namespace :gcc do
modules.each do |extra|
cp_r extra, test_target
end
- extra_sources = test_target.glob("**/*.elna")
- .map { |extra| %("#{extra.relative_path_from test_target}") }
-
- convert_test main, (test_target + 'sut.elna'), category, [
- "(* { dg-additional-options \"-I#{test_target.expand_path}\" } *)",
- "(* { dg-additional-sources #{extra_sources * ' '} } *)"
- ]
+ extra_lines = ["(* { dg-additional-options \"-I#{test_target.expand_path}\" } *)"]
+
+ # Only 'runnable' tests link the helper modules into an executable,
+ # so only they need the helper sources compiled as separate
+ # translation units via dg-additional-sources. Elna resolves imports
+ # on its own, so passing it as an additional source there would add a
+ # second positional.
+ if category == 'runnable'
+ extra_sources = test_target.glob("**/*.elna")
+ .map { |extra| %("#{extra.relative_path_from test_target}") }
+ extra_lines << "(* { dg-additional-sources #{extra_sources * ' '} } *)"
+ end
+ convert_test main, (test_target + 'sut.elna'), category, extra_lines
else
convert_test test_path, test_target, category
end