diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-08-28 02:39:42 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-08-28 02:39:42 +0200 |
| commit | 8e655a0786aec5e0215e09f2a9629c6f32e34793 (patch) | |
| tree | 0788634cf66fed9c1a1d264b5b8c30da49380559 /rakelib/gcc.rake | |
| parent | 4d4537866690a1ef3d882f5e9a6e01d8220a3650 (diff) | |
| download | elna-8e655a0786aec5e0215e09f2a9629c6f32e34793.tar.gz | |
Reject declarations shadowing imports
Diffstat (limited to 'rakelib/gcc.rake')
| -rw-r--r-- | rakelib/gcc.rake | 20 |
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 |
