ceedling 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/GIT_COMMIT_SHA +1 -1
  3. data/README.md +7 -4
  4. data/docs/Changelog.md +66 -38
  5. data/docs/KnownIssues.md +9 -0
  6. data/docs/ReleaseNotes.md +5 -1
  7. data/docs/mkdocs/getting-started/installation.md +8 -1
  8. data/docs/mkdocs/getting-started/quick-start.md +20 -2
  9. data/docs/mkdocs/help.md +2 -2
  10. data/docs/mkdocs/index.md +13 -6
  11. data/docs/mkdocs/overview/build-system.md +4 -4
  12. data/docs/mkdocs/plugins/bullseye.md +6 -0
  13. data/docs/mkdocs/plugins/command-hooks.md +20 -15
  14. data/docs/mkdocs/plugins/gcov/gcovr.md +130 -109
  15. data/docs/mkdocs/plugins/gcov/index.md +6 -0
  16. data/docs/mkdocs/plugins/index.md +40 -0
  17. data/docs/mkdocs/plugins/valgrind.md +6 -0
  18. data/docs/mkdocs/testing-guide/partials/index.md +22 -13
  19. data/lib/ceedling/config/configurator.rb +2 -1
  20. data/lib/ceedling/preprocess/preprocessinator.rb +3 -2
  21. data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +27 -13
  22. data/lib/ceedling/test_invoker/test_build_executor.rb +3 -4
  23. data/lib/ceedling/test_invoker/test_build_planner.rb +0 -2
  24. data/lib/ceedling/test_invoker/test_invoker_types.rb +1 -1
  25. data/lib/ceedling/tool_executor.rb +5 -0
  26. data/lib/version.rb +1 -1
  27. data/plugins/command_hooks/lib/command_hooks.rb +4 -0
  28. data/plugins/gcov/lib/console_reportinator.rb +3 -1
  29. data/plugins/gcov/lib/gcov.rb +3 -3
  30. data/plugins/gcov/lib/gcov_reportinator.rb +4 -0
  31. data/plugins/gcov/lib/gcovr_reportinator.rb +61 -14
  32. data/plugins/gcov/lib/reportgenerator_reportinator.rb +3 -1
  33. data/site-local/404.html +3 -3
  34. data/site-local/assets/javascripts/{bundle.79ae519e.min.js → bundle.d7400e89.min.js} +2 -2
  35. data/site-local/assets/javascripts/{bundle.79ae519e.min.js.map → bundle.d7400e89.min.js.map} +2 -2
  36. data/site-local/assets/stylesheets/main.ec1eaa64.min.css +1 -0
  37. data/site-local/assets/stylesheets/{main.484c7ddc.min.css.map → main.ec1eaa64.min.css.map} +1 -1
  38. data/site-local/configuration/environment-vars.html +3 -3
  39. data/site-local/configuration/global-collections.html +3 -3
  40. data/site-local/configuration/index.html +3 -3
  41. data/site-local/configuration/loading.html +3 -3
  42. data/site-local/configuration/mixins.html +3 -3
  43. data/site-local/configuration/parallel-builds.html +3 -3
  44. data/site-local/configuration/project-file.html +3 -3
  45. data/site-local/configuration/reference/cexception.html +3 -3
  46. data/site-local/configuration/reference/cmock.html +3 -3
  47. data/site-local/configuration/reference/defines.html +3 -3
  48. data/site-local/configuration/reference/environment.html +3 -3
  49. data/site-local/configuration/reference/extension.html +3 -3
  50. data/site-local/configuration/reference/files.html +3 -3
  51. data/site-local/configuration/reference/flags.html +3 -3
  52. data/site-local/configuration/reference/index.html +3 -3
  53. data/site-local/configuration/reference/libraries.html +3 -3
  54. data/site-local/configuration/reference/mixins.html +3 -3
  55. data/site-local/configuration/reference/paths.html +3 -3
  56. data/site-local/configuration/reference/plugins.html +3 -3
  57. data/site-local/configuration/reference/project.html +3 -3
  58. data/site-local/configuration/reference/release-build.html +3 -3
  59. data/site-local/configuration/reference/test-build.html +3 -3
  60. data/site-local/configuration/reference/test-runner.html +3 -3
  61. data/site-local/configuration/reference/tools.html +3 -3
  62. data/site-local/configuration/reference/unity.html +3 -3
  63. data/site-local/configuration/which-ceedling.html +3 -3
  64. data/site-local/development/index.html +3 -3
  65. data/site-local/development/plugins/configuration.html +3 -3
  66. data/site-local/development/plugins/index.html +3 -3
  67. data/site-local/development/plugins/plugin-subclass.html +3 -3
  68. data/site-local/development/plugins/rake-tasks.html +3 -3
  69. data/site-local/development/workflow.html +3 -3
  70. data/site-local/getting-started/command-line.html +3 -3
  71. data/site-local/getting-started/example-projects/cipher-quest.html +3 -3
  72. data/site-local/getting-started/example-projects/index.html +3 -3
  73. data/site-local/getting-started/example-projects/temp-sensor.html +3 -3
  74. data/site-local/getting-started/example-projects/wondrous-forest.html +3 -3
  75. data/site-local/getting-started/index.html +3 -3
  76. data/site-local/getting-started/installation.html +12 -4
  77. data/site-local/getting-started/quick-start.html +18 -4
  78. data/site-local/help.html +4 -4
  79. data/site-local/index.html +13 -8
  80. data/site-local/overview/build-system.html +6 -6
  81. data/site-local/overview/index.html +3 -3
  82. data/site-local/overview/test-environments.html +3 -3
  83. data/site-local/overview/tools-and-frameworks.html +3 -3
  84. data/site-local/plugins/beep.html +3 -3
  85. data/site-local/plugins/bullseye.html +9 -3
  86. data/site-local/plugins/command-hooks.html +42 -38
  87. data/site-local/plugins/compile-commands-json-db.html +3 -3
  88. data/site-local/plugins/cppcheck.html +3 -3
  89. data/site-local/plugins/dependencies.html +3 -3
  90. data/site-local/plugins/fff.html +3 -3
  91. data/site-local/plugins/gcov/examples.html +3 -3
  92. data/site-local/plugins/gcov/gcovr.html +325 -227
  93. data/site-local/plugins/gcov/index.html +9 -3
  94. data/site-local/plugins/gcov/overview.html +3 -3
  95. data/site-local/plugins/gcov/reportgenerator.html +3 -3
  96. data/site-local/plugins/gcov/reporting.html +3 -3
  97. data/site-local/plugins/gcov/setup.html +3 -3
  98. data/site-local/plugins/gcov/tool-versions.html +3 -3
  99. data/site-local/plugins/gcov/troubleshooting.html +3 -3
  100. data/site-local/plugins/index.html +79 -15
  101. data/site-local/plugins/module-generator.html +3 -3
  102. data/site-local/plugins/report-build-warnings-log.html +3 -3
  103. data/site-local/plugins/report-tests-gtestlike-stdout.html +3 -3
  104. data/site-local/plugins/report-tests-ide-stdout.html +3 -3
  105. data/site-local/plugins/report-tests-log-factory.html +3 -3
  106. data/site-local/plugins/report-tests-pretty-stdout.html +3 -3
  107. data/site-local/plugins/report-tests-raw-output-log.html +3 -3
  108. data/site-local/plugins/report-tests-teamcity-stdout.html +3 -3
  109. data/site-local/plugins/valgrind.html +9 -3
  110. data/site-local/project/release-history.html +3 -3
  111. data/site-local/project/upgrade.html +3 -3
  112. data/site-local/reference/build-directives.html +3 -3
  113. data/site-local/reference/command-line.html +3 -3
  114. data/site-local/reference/environment-vars.html +3 -3
  115. data/site-local/reference/gcov-plugin.html +3 -3
  116. data/site-local/reference/global-collections.html +3 -3
  117. data/site-local/reference/index.html +3 -3
  118. data/site-local/reference/partials-macros.html +3 -3
  119. data/site-local/reference/project-configuration.html +3 -3
  120. data/site-local/sitemap.xml.gz +0 -0
  121. data/site-local/snapshot/examples/cipher_quest/index.html +3 -3
  122. data/site-local/snapshot/examples/temp_sensor/index.html +3 -3
  123. data/site-local/snapshot/examples/wondrous_forest/index.html +3 -3
  124. data/site-local/testing-guide/build-directives.html +3 -3
  125. data/site-local/testing-guide/conventions.html +3 -3
  126. data/site-local/testing-guide/frameworks.html +3 -3
  127. data/site-local/testing-guide/index.html +3 -3
  128. data/site-local/testing-guide/partials/configuration.html +3 -3
  129. data/site-local/testing-guide/partials/conventions.html +3 -3
  130. data/site-local/testing-guide/partials/directives.html +3 -3
  131. data/site-local/testing-guide/partials/example.html +3 -3
  132. data/site-local/testing-guide/partials/index.html +25 -16
  133. data/site-local/testing-guide/partials/overview.html +3 -3
  134. data/site-local/testing-guide/partials/variables.html +3 -3
  135. data/site-local/testing-guide/test-cases.html +3 -3
  136. data/site-local/testing-guide/test-sample.html +3 -3
  137. data/site-local/testing-guide/test-suite-anatomy.html +3 -3
  138. data/spec/support/system/system_context.rb +3 -1
  139. data/spec/system/support/gcov_common_test_cases.rb +4 -1
  140. data/spec/units/preprocess/preprocessinator_file_assembler_spec.rb +155 -0
  141. data/spec/units/test_build_executor_spec.rb +114 -0
  142. data/vendor/unity/auto/generate_test_runner.rb +55 -5
  143. data/vendor/unity/src/unity.h +1 -1
  144. data/vendor/unity/test/testdata/testRunnerGeneratorEmpty.c +13 -0
  145. data/vendor/unity/test/tests/test_generate_test_runner.rb +11 -0
  146. metadata +9 -7
  147. data/site-local/assets/stylesheets/main.484c7ddc.min.css +0 -1
  148. data/vendor/unity/auto/run_test.erb +0 -37
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4673,7 +4673,7 @@ error.</p>
4673
4673
  <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4674
4674
 
4675
4675
 
4676
- <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
4676
+ <script src="../../assets/javascripts/bundle.d7400e89.min.js"></script>
4677
4677
 
4678
4678
 
4679
4679
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4441,7 +4441,7 @@ usage scenarios.</p>
4441
4441
  <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4442
4442
 
4443
4443
 
4444
- <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
4444
+ <script src="../../assets/javascripts/bundle.d7400e89.min.js"></script>
4445
4445
 
4446
4446
 
4447
4447
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4028,24 +4028,26 @@
4028
4028
  <p>A <em>Partial</em> is your C code sliced and diced to expose elements for testing
4029
4029
  that you could not otherwise access without rewriting your source code.
4030
4030
  Think of Partials as a unit testing scalpel.</p>
4031
- <p>Partials are useful when a module under test contains:</p>
4031
+ <p>Partials are useful when you need to test:</p>
4032
4032
  <ul>
4033
- <li><strong><code>static</code> or <code>inline</code> functions</strong> — These become accessible within
4034
- your test code.</li>
4033
+ <li><strong><code>static</code> or <code>inline</code> functions</strong> — These become accessible to
4034
+ your test code without modifying your source.</li>
4035
4035
  <li><strong>File-scoped <code>static</code> variables</strong> — The <code>static</code> keyword is stripped,
4036
- and the variable is automatically made <code>extern</code> for easy access within
4037
- your test code.</li>
4036
+ and the variable is automatically made <code>extern</code> for your test code
4037
+ with no changes to the source under test.</li>
4038
4038
  <li><strong>Function-scoped <code>static</code> variables</strong> — These are promoted from
4039
4039
  function scope to module scope so they can be accessed in your
4040
- test code. Apart from necessary renaming, this works identically to
4041
- file-scoped <code>static</code> variables.</li>
4040
+ test code just like file-scoped <code>static</code> variables.</li>
4041
+ <li><strong>Same-module mocked functions</strong> — You can mix and match tested and
4042
+ mocked functions from the same source module. Partials allow mocking
4043
+ functions inside a module that are called by other functions inside
4044
+ the same module.</li>
4042
4045
  </ul>
4043
- <div class="admonition warning">
4044
- <p class="admonition-title">Limitations of Partials</p>
4045
- <p>Partials are new to Ceedling with 1.1.0. Carving up C code is tricky
4046
- business. Complex code <em>may</em> break Ceedling’s lexing or its assumptions
4047
- on symbol ordering. Some issues may be <a href="../../help.html">bugs to be reported</a>
4048
- while others may be complexities that Partials are simply unable to resolve.</p>
4046
+ <div class="admonition tip">
4047
+ <p class="admonition-title">Tip</p>
4048
+ <p>See the <a href="../../getting-started/example-projects/wondrous-forest.html"><code>wondrous_forest</code></a>
4049
+ example available within Ceedling for a working example project
4050
+ demonstrating Partials in action.</p>
4049
4051
  </div>
4050
4052
  <hr />
4051
4053
  <div class="grid cards">
@@ -4089,6 +4091,13 @@ via Partials.</p>
4089
4091
  </li>
4090
4092
  </ul>
4091
4093
  </div>
4094
+ <div class="admonition warning">
4095
+ <p class="admonition-title">Limitations of Partials</p>
4096
+ <p>Partials are new to Ceedling with 1.1.0. Carving up C code is tricky
4097
+ business. Complex code <em>may</em> break Ceedling’s lexing or certain assumptions.
4098
+ Some issues may be <a href="../../help.html">bugs to be reported</a> while others may
4099
+ be complexities that Partials are simply unable to resolve.</p>
4100
+ </div>
4092
4101
  <p><br/><br/></p>
4093
4102
 
4094
4103
 
@@ -4160,7 +4169,7 @@ via Partials.</p>
4160
4169
  <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4161
4170
 
4162
4171
 
4163
- <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
4172
+ <script src="../../assets/javascripts/bundle.d7400e89.min.js"></script>
4164
4173
 
4165
4174
 
4166
4175
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4315,7 +4315,7 @@ incorporate them into your tests except with the accompanying macros.</p>
4315
4315
  <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4316
4316
 
4317
4317
 
4318
- <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
4318
+ <script src="../../assets/javascripts/bundle.d7400e89.min.js"></script>
4319
4319
 
4320
4320
 
4321
4321
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4541,7 +4541,7 @@ in the source file).</p>
4541
4541
  <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4542
4542
 
4543
4543
 
4544
- <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
4544
+ <script src="../../assets/javascripts/bundle.d7400e89.min.js"></script>
4545
4545
 
4546
4546
 
4547
4547
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4429,7 +4429,7 @@ and details on how everything fits together.</p>
4429
4429
  <script id="__config" type="application/json">{"annotate": null, "base": "..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4430
4430
 
4431
4431
 
4432
- <script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
4432
+ <script src="../assets/javascripts/bundle.d7400e89.min.js"></script>
4433
4433
 
4434
4434
 
4435
4435
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4258,7 +4258,7 @@ to be reported to the developer at the command line.</p>
4258
4258
  <script id="__config" type="application/json">{"annotate": null, "base": "..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4259
4259
 
4260
4260
 
4261
- <script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
4261
+ <script src="../assets/javascripts/bundle.d7400e89.min.js"></script>
4262
4262
 
4263
4263
 
4264
4264
  </body>
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <link rel="icon" href="../assets/images/favicon.png">
24
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
24
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.7">
25
25
 
26
26
 
27
27
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
 
32
- <link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
32
+ <link rel="stylesheet" href="../assets/stylesheets/main.ec1eaa64.min.css">
33
33
 
34
34
 
35
35
  <link rel="stylesheet" href="../assets/stylesheets/palette.ab4e12ef.min.css">
@@ -4242,7 +4242,7 @@ executables and tallying all the test results.</p>
4242
4242
  <script id="__config" type="application/json">{"annotate": null, "base": "..", "features": ["navigation.tabs", "navigation.sections", "navigation.top", "navigation.indexes", "navigation.path", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate"], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "latest", "provider": "mike"}}</script>
4243
4243
 
4244
4244
 
4245
- <script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
4245
+ <script src="../assets/javascripts/bundle.d7400e89.min.js"></script>
4246
4246
 
4247
4247
 
4248
4248
  </body>
@@ -48,7 +48,9 @@ class SystemContext
48
48
  begin
49
49
  %w{BUNDLE_GEMFILE BUNDLE_BIN_PATH RUBYOPT}.each { |k| ENV.delete(k) }
50
50
  deploy_output = `bundle config set --local path '#{shared_gem.install_dir}' 2>&1`
51
- deploy_output += `bundle install 2>&1`
51
+ # --prefer-local: Without it, Bundler resolves gems (e.g. `erb`) fresh from
52
+ # rubygems repository even when Ruby's default-gem copy satisfies the Gemfile constraint.
53
+ deploy_output += `bundle install --prefer-local 2>&1`
52
54
  raise VerificationFailed, "bundle install failed:\n#{deploy_output}" unless $?.success?
53
55
 
54
56
  verify = `bundle exec ruby -S ceedling version 2>&1`
@@ -246,11 +246,14 @@ module GcovCommonTestCases
246
246
  }
247
247
  })
248
248
 
249
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
249
+ output = `bundle exec ruby -S ceedling gcov:all --verbosity=obnoxious 2>&1`
250
250
  if @gcov_reports.include? :gcovr
251
251
  # Config file honored (fix applied): strict mode exits non-zero on duplicate functions.
252
252
  # Config file overridden by Ceedling CLI (bug): merge-use-line-max exits 0.
253
253
  expect($?.exitstatus).not_to eq(0)
254
+
255
+ # No `--exclude` should appear on the gcovr command line when a config file is in use.
256
+ expect(output).not_to match(/--exclude/)
254
257
  end
255
258
  end
256
259
  end
@@ -260,4 +260,159 @@ RSpec.describe PreprocessinatorFileAssembler do
260
260
 
261
261
  end
262
262
 
263
+
264
+ # ===========================================================================
265
+ describe '#collect_mockable_header_file_contents' do
266
+ # ===========================================================================
267
+
268
+ let(:test) { 'test_module' }
269
+ let(:filepath) { '/src/module.h' }
270
+ let(:directives_only_filepath) { '/build/directives/module.h' }
271
+ let(:preprocessed_filepath) { '/build/full_expansion/module.h' }
272
+ let(:flags) { [] }
273
+ let(:defines) { [] }
274
+ let(:include_paths) { [] }
275
+
276
+ before :each do
277
+ allow(@file_path_utils).to receive(:form_preprocessed_file_full_expansion_filepath)
278
+ .with(filepath, test).and_return(preprocessed_filepath)
279
+ allow(@configurator).to receive(:tools_test_file_full_preprocessor).and_return(:full_preprocessor)
280
+ allow(@tool_executor).to receive(:build_command_line).and_return('gcc -E ...')
281
+ allow(@tool_executor).to receive(:exec)
282
+ stub_file_open(preprocessed_filepath, "# 1 \"#{filepath}\"\nint x;\n", 'r')
283
+ end
284
+
285
+ def call_collect_mockable(fallback:, extras:)
286
+ subject.collect_mockable_header_file_contents(
287
+ test: test,
288
+ filepath: filepath,
289
+ directives_only_filepath: directives_only_filepath,
290
+ fallback: fallback,
291
+ flags: flags,
292
+ defines: defines,
293
+ include_paths: include_paths,
294
+ extras: extras
295
+ )
296
+ end
297
+
298
+ context 'when extras are not requested' do
299
+
300
+ it 'returns an empty extras list and a nil include guard' do
301
+ _contents, extras, include_guard = call_collect_mockable(fallback: true, extras: false)
302
+ expect(extras).to eq([])
303
+ expect(include_guard).to be_nil
304
+ end
305
+
306
+ it 'does not read the original file to look for an include guard' do
307
+ expect(@file_wrapper).not_to receive(:read)
308
+ call_collect_mockable(fallback: true, extras: false)
309
+ end
310
+
311
+ end
312
+
313
+ context 'when extras are requested' do
314
+
315
+ let(:header_with_guard) do
316
+ <<~C
317
+ #ifndef FOO_H
318
+ #define FOO_H
319
+
320
+ void foo(void);
321
+
322
+ #endif
323
+ C
324
+ end
325
+
326
+ it 'extracts the include guard from the original file in fallback mode' do
327
+ allow(@file_wrapper).to receive(:read).with(filepath, 2048).and_return(header_with_guard)
328
+ stub_file_open(filepath, header_with_guard, 'rb')
329
+
330
+ _contents, _extras, include_guard = call_collect_mockable(fallback: true, extras: true)
331
+ expect(include_guard).to eq('FOO_H')
332
+ end
333
+
334
+ it 'extracts the include guard from the original file in directives-only mode' do
335
+ allow(@file_wrapper).to receive(:read).with(filepath, 2048).and_return(header_with_guard)
336
+ stub_file_open(directives_only_filepath, header_with_guard, 'r')
337
+
338
+ _contents, _extras, include_guard = call_collect_mockable(fallback: false, extras: true)
339
+ expect(include_guard).to eq('FOO_H')
340
+ end
341
+
342
+ it 'returns a nil include guard when the original file has no #ifndef/#define guard pair' do
343
+ header_without_guard = "#pragma once\n\nvoid foo(void);\n"
344
+ allow(@file_wrapper).to receive(:read).with(filepath, 2048).and_return(header_without_guard)
345
+ stub_file_open(filepath, header_without_guard, 'rb')
346
+
347
+ _contents, _extras, include_guard = call_collect_mockable(fallback: true, extras: true)
348
+ expect(include_guard).to be_nil
349
+ end
350
+
351
+ end
352
+
353
+ end
354
+
355
+
356
+ # ===========================================================================
357
+ describe '#assemble_preprocessed_header_file' do
358
+ # ===========================================================================
359
+
360
+ let(:preprocessed_filepath) { '/build/mocks/test_module/module.h' }
361
+
362
+ def stub_file_write(filepath)
363
+ output = StringIO.new
364
+ allow(@file_wrapper).to receive(:open).with(filepath, 'w').and_yield(output)
365
+ output
366
+ end
367
+
368
+ it 'writes the given include guard name as the #ifndef/#define/#endif guard' do
369
+ output = stub_file_write(preprocessed_filepath)
370
+
371
+ subject.assemble_preprocessed_header_file(
372
+ filename: 'module.h',
373
+ preprocessed_filepath: preprocessed_filepath,
374
+ contents: ['void foo(void);'],
375
+ extras: [],
376
+ includes: [],
377
+ include_guard: 'FOO_H'
378
+ )
379
+
380
+ expect(output.string).to include("#ifndef FOO_H\n")
381
+ expect(output.string).to include("#define FOO_H\n")
382
+ expect(output.string).to include('#endif // FOO_H')
383
+ end
384
+
385
+ it 'derives a synthetic include guard from the filename when none is given' do
386
+ output = stub_file_write(preprocessed_filepath)
387
+
388
+ subject.assemble_preprocessed_header_file(
389
+ filename: 'module.h',
390
+ preprocessed_filepath: preprocessed_filepath,
391
+ contents: ['void foo(void);'],
392
+ extras: [],
393
+ includes: []
394
+ )
395
+
396
+ expect(output.string).to include("#ifndef __CEEDLING_GENERATED_MODULE_H__\n")
397
+ expect(output.string).to include("#define __CEEDLING_GENERATED_MODULE_H__\n")
398
+ end
399
+
400
+ it 'writes provided includes and contents between the guard lines' do
401
+ output = stub_file_write(preprocessed_filepath)
402
+
403
+ subject.assemble_preprocessed_header_file(
404
+ filename: 'module.h',
405
+ preprocessed_filepath: preprocessed_filepath,
406
+ contents: ['void foo(void);'],
407
+ extras: [],
408
+ includes: ['#include "bar.h"'],
409
+ include_guard: 'FOO_H'
410
+ )
411
+
412
+ expect(output.string).to include('#include "bar.h"')
413
+ expect(output.string).to include('void foo(void);')
414
+ end
415
+
416
+ end
417
+
263
418
  end
@@ -0,0 +1,114 @@
1
+ # =========================================================================
2
+ # Ceedling - Test-Centered Build System for C
3
+ # ThrowTheSwitch.org
4
+ # Copyright (c) 2010-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
5
+ # SPDX-License-Identifier: MIT
6
+ # =========================================================================
7
+
8
+ require 'spec_helper'
9
+ require 'ceedling/test_invoker/test_build_executor'
10
+ require 'ceedling/test_invoker/test_invoker_types'
11
+
12
+ PROJECT_BUILD_VENDOR_UNITY_PATH = 'build/vendor/unity' unless defined?(PROJECT_BUILD_VENDOR_UNITY_PATH)
13
+ UNITY_C_FILE = 'unity.c' unless defined?(UNITY_C_FILE)
14
+
15
+ describe TestBuildExecutor do
16
+ before(:each) do
17
+ @configurator = double( "Configurator" )
18
+ @loginator = double( "Loginator" )
19
+ @reportinator = double( "Reportinator" )
20
+ @batchinator = double( "Batchinator" )
21
+ @preprocessinator = double( "Preprocessinator" )
22
+ @partializer = double( "Partializer" )
23
+ @generator = double( "Generator" )
24
+ @test_context_extractor = double( "TestContextExtractor" )
25
+ @plugin_manager = double( "PluginManager" )
26
+ @file_path_utils = double( "FilePathUtils" )
27
+ @file_finder = double( "FileFinder" )
28
+ @file_wrapper = double( "FileWrapper" )
29
+
30
+ @tools_test_compiler = { name: 'fake compiler' }
31
+ @tools_test_assembler = { name: 'fake assembler' }
32
+
33
+ allow(@configurator).to receive(:extension_assembly).and_return( '.asm' )
34
+ allow(@configurator).to receive(:tools_test_compiler).and_return( @tools_test_compiler )
35
+ allow(@configurator).to receive(:tools_test_assembler).and_return( @tools_test_assembler )
36
+ allow(@configurator).to receive(:project_use_mocks).and_return( false )
37
+ allow(@configurator).to receive(:project_use_exceptions).and_return( false )
38
+ allow(@configurator).to receive(:collection_all_support).and_return( [] )
39
+
40
+ allow(@file_path_utils).to receive(:form_test_build_list_filepath).and_return( 'build/list' )
41
+ allow(@file_path_utils).to receive(:form_test_dependencies_filepath).and_return( 'build/deps' )
42
+
43
+ @executor = described_class.new(
44
+ {
45
+ :configurator => @configurator,
46
+ :loginator => @loginator,
47
+ :reportinator => @reportinator,
48
+ :batchinator => @batchinator,
49
+ :preprocessinator => @preprocessinator,
50
+ :partializer => @partializer,
51
+ :generator => @generator,
52
+ :test_context_extractor => @test_context_extractor,
53
+ :plugin_manager => @plugin_manager,
54
+ :file_path_utils => @file_path_utils,
55
+ :file_finder => @file_finder,
56
+ :file_wrapper => @file_wrapper
57
+ }
58
+ )
59
+
60
+ testable = TestInvokerTypes::Testable.new(
61
+ :compile_defines => [],
62
+ :search_paths => [],
63
+ :compile_flags => [],
64
+ :assembler_flags => []
65
+ )
66
+
67
+ @state = TestInvokerTypes::PipelineState.new( :testables => { :a_test => testable } )
68
+ end
69
+
70
+ context "#compile_test_component" do
71
+ it "compiles a C source file with the configured test compiler tool" do
72
+ allow(@file_wrapper).to receive(:extname).with( 'src/foo.c' ).and_return( '.c' )
73
+ allow(@configurator).to receive(:test_build_use_assembly).and_return( false )
74
+
75
+ expect(@generator).to receive(:generate_object_file_c) do |**args|
76
+ expect( args[:tool] ).to eq( @tools_test_compiler )
77
+ end
78
+ expect(@generator).to_not receive(:generate_object_file_asm)
79
+
80
+ @executor.send(
81
+ :compile_test_component,
82
+ :context => :test, :test => :a_test, :source => 'src/foo.c', :object => 'build/foo.o', :state => @state
83
+ )
84
+ end
85
+
86
+ it "assembles an assembly source file with the configured test assembler tool when assembly support is enabled" do
87
+ allow(@file_wrapper).to receive(:extname).with( 'src/foo.asm' ).and_return( '.asm' )
88
+ allow(@configurator).to receive(:test_build_use_assembly).and_return( true )
89
+
90
+ expect(@generator).to receive(:generate_object_file_asm) do |**args|
91
+ expect( args[:tool] ).to eq( @tools_test_assembler )
92
+ end
93
+ expect(@generator).to_not receive(:generate_object_file_c)
94
+
95
+ @executor.send(
96
+ :compile_test_component,
97
+ :context => :test, :test => :a_test, :source => 'src/foo.asm', :object => 'build/foo.o', :state => @state
98
+ )
99
+ end
100
+
101
+ it "does not compile an assembly source file when assembly support is disabled" do
102
+ allow(@file_wrapper).to receive(:extname).with( 'src/foo.asm' ).and_return( '.asm' )
103
+ allow(@configurator).to receive(:test_build_use_assembly).and_return( false )
104
+
105
+ expect(@generator).to_not receive(:generate_object_file_c)
106
+ expect(@generator).to_not receive(:generate_object_file_asm)
107
+
108
+ @executor.send(
109
+ :compile_test_component,
110
+ :context => :test, :test => :a_test, :source => 'src/foo.asm', :object => 'build/foo.o', :state => @state
111
+ )
112
+ end
113
+ end
114
+ end