ceedling 1.1.0 → 1.1.2

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 (172) hide show
  1. checksums.yaml +4 -4
  2. data/GIT_COMMIT_SHA +1 -1
  3. data/README.md +10 -7
  4. data/assets/broken_uncovered_file.c +13 -0
  5. data/assets/test_example_file_2.c +22 -0
  6. data/assets/tests_with_partials_coverage/src/blanks.c +10 -0
  7. data/assets/tests_with_partials_coverage/src/blanks.h +1 -0
  8. data/assets/tests_with_partials_coverage/src/counter.c +12 -0
  9. data/assets/tests_with_partials_coverage/src/counter.h +1 -0
  10. data/assets/tests_with_partials_coverage/src/decorators.c +11 -0
  11. data/assets/tests_with_partials_coverage/src/decorators.h +4 -0
  12. data/assets/tests_with_partials_coverage/test/test_blanks.c +8 -0
  13. data/assets/tests_with_partials_coverage/test/test_counter.c +9 -0
  14. data/assets/tests_with_partials_coverage/test/test_decorators.c +8 -0
  15. data/docs/Changelog.md +80 -38
  16. data/docs/KnownIssues.md +9 -0
  17. data/docs/ReleaseNotes.md +5 -1
  18. data/docs/mkdocs/getting-started/installation.md +8 -1
  19. data/docs/mkdocs/getting-started/quick-start.md +20 -2
  20. data/docs/mkdocs/help.md +2 -2
  21. data/docs/mkdocs/index.md +13 -6
  22. data/docs/mkdocs/overview/build-system.md +4 -4
  23. data/docs/mkdocs/plugins/bullseye.md +6 -0
  24. data/docs/mkdocs/plugins/command-hooks.md +20 -15
  25. data/docs/mkdocs/plugins/gcov/gcovr.md +130 -109
  26. data/docs/mkdocs/plugins/gcov/index.md +6 -0
  27. data/docs/mkdocs/plugins/index.md +40 -0
  28. data/docs/mkdocs/plugins/valgrind.md +6 -0
  29. data/docs/mkdocs/testing-guide/partials/index.md +22 -13
  30. data/lib/ceedling/c_extractor/c_extractor_declarations.rb +3 -1
  31. data/lib/ceedling/c_extractor/c_extractor_preprocessing.rb +20 -7
  32. data/lib/ceedling/config/configurator.rb +2 -1
  33. data/lib/ceedling/generators/generator_partials.rb +13 -3
  34. data/lib/ceedling/objects.yml +1 -0
  35. data/lib/ceedling/preprocess/preprocessinator.rb +3 -2
  36. data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +37 -15
  37. data/lib/ceedling/preprocess/preprocessinator_reconstructor.rb +23 -15
  38. data/lib/ceedling/test_invoker/test_build_executor.rb +3 -4
  39. data/lib/ceedling/test_invoker/test_build_planner.rb +0 -2
  40. data/lib/ceedling/test_invoker/test_invoker_types.rb +1 -1
  41. data/lib/ceedling/tool_executor.rb +5 -0
  42. data/lib/version.rb +1 -1
  43. data/plugins/command_hooks/lib/command_hooks.rb +4 -0
  44. data/plugins/gcov/lib/console_reportinator.rb +3 -1
  45. data/plugins/gcov/lib/gcov.rb +3 -3
  46. data/plugins/gcov/lib/gcov_reportinator.rb +4 -0
  47. data/plugins/gcov/lib/gcovr_reportinator.rb +61 -14
  48. data/plugins/gcov/lib/reportgenerator_reportinator.rb +3 -1
  49. data/site-local/404.html +3 -3
  50. data/site-local/assets/javascripts/{bundle.79ae519e.min.js → bundle.d7400e89.min.js} +2 -2
  51. data/site-local/assets/javascripts/{bundle.79ae519e.min.js.map → bundle.d7400e89.min.js.map} +2 -2
  52. data/site-local/assets/stylesheets/main.ec1eaa64.min.css +1 -0
  53. data/site-local/assets/stylesheets/{main.484c7ddc.min.css.map → main.ec1eaa64.min.css.map} +1 -1
  54. data/site-local/configuration/environment-vars.html +3 -3
  55. data/site-local/configuration/global-collections.html +3 -3
  56. data/site-local/configuration/index.html +3 -3
  57. data/site-local/configuration/loading.html +3 -3
  58. data/site-local/configuration/mixins.html +3 -3
  59. data/site-local/configuration/parallel-builds.html +3 -3
  60. data/site-local/configuration/project-file.html +3 -3
  61. data/site-local/configuration/reference/cexception.html +3 -3
  62. data/site-local/configuration/reference/cmock.html +3 -3
  63. data/site-local/configuration/reference/defines.html +3 -3
  64. data/site-local/configuration/reference/environment.html +3 -3
  65. data/site-local/configuration/reference/extension.html +3 -3
  66. data/site-local/configuration/reference/files.html +3 -3
  67. data/site-local/configuration/reference/flags.html +3 -3
  68. data/site-local/configuration/reference/index.html +3 -3
  69. data/site-local/configuration/reference/libraries.html +3 -3
  70. data/site-local/configuration/reference/mixins.html +3 -3
  71. data/site-local/configuration/reference/paths.html +3 -3
  72. data/site-local/configuration/reference/plugins.html +3 -3
  73. data/site-local/configuration/reference/project.html +3 -3
  74. data/site-local/configuration/reference/release-build.html +3 -3
  75. data/site-local/configuration/reference/test-build.html +3 -3
  76. data/site-local/configuration/reference/test-runner.html +3 -3
  77. data/site-local/configuration/reference/tools.html +3 -3
  78. data/site-local/configuration/reference/unity.html +3 -3
  79. data/site-local/configuration/which-ceedling.html +3 -3
  80. data/site-local/development/index.html +3 -3
  81. data/site-local/development/plugins/configuration.html +3 -3
  82. data/site-local/development/plugins/index.html +3 -3
  83. data/site-local/development/plugins/plugin-subclass.html +3 -3
  84. data/site-local/development/plugins/rake-tasks.html +3 -3
  85. data/site-local/development/workflow.html +3 -3
  86. data/site-local/getting-started/command-line.html +3 -3
  87. data/site-local/getting-started/example-projects/cipher-quest.html +3 -3
  88. data/site-local/getting-started/example-projects/index.html +3 -3
  89. data/site-local/getting-started/example-projects/temp-sensor.html +3 -3
  90. data/site-local/getting-started/example-projects/wondrous-forest.html +3 -3
  91. data/site-local/getting-started/index.html +3 -3
  92. data/site-local/getting-started/installation.html +12 -4
  93. data/site-local/getting-started/quick-start.html +18 -4
  94. data/site-local/help.html +4 -4
  95. data/site-local/index.html +13 -8
  96. data/site-local/overview/build-system.html +6 -6
  97. data/site-local/overview/index.html +3 -3
  98. data/site-local/overview/test-environments.html +3 -3
  99. data/site-local/overview/tools-and-frameworks.html +3 -3
  100. data/site-local/plugins/beep.html +3 -3
  101. data/site-local/plugins/bullseye.html +9 -3
  102. data/site-local/plugins/command-hooks.html +42 -38
  103. data/site-local/plugins/compile-commands-json-db.html +3 -3
  104. data/site-local/plugins/cppcheck.html +3 -3
  105. data/site-local/plugins/dependencies.html +3 -3
  106. data/site-local/plugins/fff.html +3 -3
  107. data/site-local/plugins/gcov/examples.html +3 -3
  108. data/site-local/plugins/gcov/gcovr.html +325 -227
  109. data/site-local/plugins/gcov/index.html +9 -3
  110. data/site-local/plugins/gcov/overview.html +3 -3
  111. data/site-local/plugins/gcov/reportgenerator.html +3 -3
  112. data/site-local/plugins/gcov/reporting.html +3 -3
  113. data/site-local/plugins/gcov/setup.html +3 -3
  114. data/site-local/plugins/gcov/tool-versions.html +3 -3
  115. data/site-local/plugins/gcov/troubleshooting.html +3 -3
  116. data/site-local/plugins/index.html +79 -15
  117. data/site-local/plugins/module-generator.html +3 -3
  118. data/site-local/plugins/report-build-warnings-log.html +3 -3
  119. data/site-local/plugins/report-tests-gtestlike-stdout.html +3 -3
  120. data/site-local/plugins/report-tests-ide-stdout.html +3 -3
  121. data/site-local/plugins/report-tests-log-factory.html +3 -3
  122. data/site-local/plugins/report-tests-pretty-stdout.html +3 -3
  123. data/site-local/plugins/report-tests-raw-output-log.html +3 -3
  124. data/site-local/plugins/report-tests-teamcity-stdout.html +3 -3
  125. data/site-local/plugins/valgrind.html +9 -3
  126. data/site-local/project/release-history.html +3 -3
  127. data/site-local/project/upgrade.html +3 -3
  128. data/site-local/reference/build-directives.html +3 -3
  129. data/site-local/reference/command-line.html +3 -3
  130. data/site-local/reference/environment-vars.html +3 -3
  131. data/site-local/reference/gcov-plugin.html +3 -3
  132. data/site-local/reference/global-collections.html +3 -3
  133. data/site-local/reference/index.html +3 -3
  134. data/site-local/reference/partials-macros.html +3 -3
  135. data/site-local/reference/project-configuration.html +3 -3
  136. data/site-local/sitemap.xml.gz +0 -0
  137. data/site-local/snapshot/examples/cipher_quest/index.html +3 -3
  138. data/site-local/snapshot/examples/temp_sensor/index.html +3 -3
  139. data/site-local/snapshot/examples/wondrous_forest/index.html +3 -3
  140. data/site-local/testing-guide/build-directives.html +3 -3
  141. data/site-local/testing-guide/conventions.html +3 -3
  142. data/site-local/testing-guide/frameworks.html +3 -3
  143. data/site-local/testing-guide/index.html +3 -3
  144. data/site-local/testing-guide/partials/configuration.html +3 -3
  145. data/site-local/testing-guide/partials/conventions.html +3 -3
  146. data/site-local/testing-guide/partials/directives.html +3 -3
  147. data/site-local/testing-guide/partials/example.html +3 -3
  148. data/site-local/testing-guide/partials/index.html +25 -16
  149. data/site-local/testing-guide/partials/overview.html +3 -3
  150. data/site-local/testing-guide/partials/variables.html +3 -3
  151. data/site-local/testing-guide/test-cases.html +3 -3
  152. data/site-local/testing-guide/test-sample.html +3 -3
  153. data/site-local/testing-guide/test-suite-anatomy.html +3 -3
  154. data/spec/support/system/system_context.rb +3 -1
  155. data/spec/system/gcov_deployment_spec.rb +20 -6
  156. data/spec/system/support/gcov_common_test_cases.rb +34 -45
  157. data/spec/system/support/gcov_partials_test_cases.rb +116 -0
  158. data/spec/units/c_extractor/c_extractor_declarations_spec.rb +128 -0
  159. data/spec/units/c_extractor/c_extractor_definitions_spec.rb +7 -0
  160. data/spec/units/c_extractor/c_extractor_integration_spec.rb +17 -0
  161. data/spec/units/c_extractor/c_extractor_preprocessing_spec.rb +46 -0
  162. data/spec/units/generators/generator_partials_spec.rb +32 -6
  163. data/spec/units/preprocess/preprocessinator_file_assembler_spec.rb +250 -1
  164. data/spec/units/preprocess/preprocessinator_reconstructor_spec.rb +151 -1
  165. data/spec/units/test_build_executor_spec.rb +114 -0
  166. data/vendor/unity/auto/generate_test_runner.rb +55 -5
  167. data/vendor/unity/src/unity.h +1 -1
  168. data/vendor/unity/test/testdata/testRunnerGeneratorEmpty.c +13 -0
  169. data/vendor/unity/test/tests/test_generate_test_runner.rb +11 -0
  170. metadata +22 -7
  171. data/site-local/assets/stylesheets/main.484c7ddc.min.css +0 -1
  172. 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`
@@ -7,11 +7,13 @@
7
7
 
8
8
  require 'spec_system_helper'
9
9
  require_relative 'support/gcov_common_test_cases'
10
+ require_relative 'support/gcov_partials_test_cases'
10
11
 
11
12
  ceedling_system_tests do
12
13
  describe "Gcov" do
13
14
  include CommonSystemTestCases
14
15
  include GcovCommonTestCases
16
+ include GcovPartialsTestCases
15
17
  before :all do
16
18
  determine_reports_to_test
17
19
  @c = SystemContext.new
@@ -50,6 +52,18 @@ ceedling_system_tests do
50
52
  test_case :create_html_report_100_coverage_excluding_crashing_test_case
51
53
  end
52
54
 
55
+ describe "Coverage reporting with Partials" do
56
+ before do
57
+ @c.with_context do
58
+ @c.ceedling_appcmd_exec("new --local #{@proj_name}")
59
+ end
60
+ end
61
+
62
+ test_case :gcov_partials_coverage_blank_lines_in_function_body
63
+ test_case :gcov_partials_coverage_decorators_on_own_lines
64
+ test_case :gcov_partials_coverage_function_scope_static_promotion
65
+ end
66
+
53
67
  describe "Backtrace with GDB" do
54
68
  include_context "requires gdb"
55
69
 
@@ -78,7 +92,7 @@ ceedling_system_tests do
78
92
  # than resetting, crashing the test executable before Unity can print
79
93
  # its statistics line.
80
94
  FileUtils.rm_rf('temp_sensor')
81
- output = `bundle exec ruby -S ceedling example temp_sensor 2>&1`
95
+ output = @c.ceedling_appcmd_exec("example temp_sensor")
82
96
  expect(output).to match(/created/)
83
97
  end
84
98
  end
@@ -86,7 +100,7 @@ ceedling_system_tests do
86
100
  it "should be testable" do
87
101
  @c.with_context do
88
102
  Dir.chdir "temp_sensor" do
89
- @output = `bundle exec ruby -S ceedling --mixin=add_gcov gcov:all 2>&1`
103
+ @output = @c.ceedling_build_exec("gcov:all --mixin=add_gcov")
90
104
  # Validate full test suite results
91
105
  expect(@output).to match(/TESTED:\s+86/)
92
106
  expect(@output).to match(/PASSED:\s+86/)
@@ -107,7 +121,7 @@ ceedling_system_tests do
107
121
  it "should be able to test a single module (it should INHERIT file-specific flags)" do
108
122
  @c.with_context do
109
123
  Dir.chdir "temp_sensor" do
110
- @output = `bundle exec ruby -S ceedling --mixin=add_gcov gcov:TemperatureCalculator 2>&1`
124
+ @output = @c.ceedling_build_exec("gcov:TemperatureCalculator --mixin=add_gcov")
111
125
  expect(@output).to match(/TESTED:\s+2/)
112
126
  expect(@output).to match(/PASSED:\s+2/)
113
127
 
@@ -119,7 +133,7 @@ ceedling_system_tests do
119
133
  it "should be able to test multiple files matching a pattern" do
120
134
  @c.with_context do
121
135
  Dir.chdir "temp_sensor" do
122
- @output = `bundle exec ruby -S ceedling --mixin=add_gcov gcov:pattern[Temp] 2>&1`
136
+ @output = @c.ceedling_build_exec("gcov:pattern[Temp] --mixin=add_gcov")
123
137
  expect(@output).to match(/TESTED:\s+6/)
124
138
  expect(@output).to match(/PASSED:\s+6/)
125
139
 
@@ -132,7 +146,7 @@ ceedling_system_tests do
132
146
  it "should be able to test all files matching in a path" do
133
147
  @c.with_context do
134
148
  Dir.chdir "temp_sensor" do
135
- @output = `bundle exec ruby -S ceedling --mixin=add_gcov gcov:path[adc] 2>&1`
149
+ @output = @c.ceedling_build_exec("gcov:path[adc] --mixin=add_gcov")
136
150
  expect(@output).to match(/TESTED:\s+24/)
137
151
  expect(@output).to match(/PASSED:\s+24/)
138
152
 
@@ -147,7 +161,7 @@ ceedling_system_tests do
147
161
  it "should be able to test specific test cases in a file" do
148
162
  @c.with_context do
149
163
  Dir.chdir "temp_sensor" do
150
- @output = `bundle exec ruby -S ceedling --mixin=add_gcov gcov:path[adc] --test-case="RunShouldNot" 2>&1`
164
+ @output = @c.ceedling_build_exec('gcov:path[adc] --mixin=add_gcov --test-case="RunShouldNot"')
151
165
  expect(@output).to match(/TESTED:\s+2/)
152
166
  expect(@output).to match(/PASSED:\s+2/)
153
167
 
@@ -18,8 +18,8 @@ module GcovCommonTestCases
18
18
  FileUtils.cp test_asset_path("example_file.c"), 'src/'
19
19
  FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/'
20
20
 
21
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
22
- expect($?.exitstatus).to match(0) # Since test cases either pass or are ignored, Ceedling exits with success
21
+ output = @c.ceedling_build_exec("gcov:all")
22
+ expect(@c.last_exit_status).to eq(0) # Since test cases either pass or are ignored, Ceedling exits with success
23
23
  expect(output).to match(/TESTED:\s+\d/)
24
24
  expect(output).to match(/PASSED:\s+\d/)
25
25
  expect(output).to match(/FAILED:\s+\d/)
@@ -36,8 +36,8 @@ module GcovCommonTestCases
36
36
  FileUtils.cp test_asset_path("example_file.c"), 'src/'
37
37
  FileUtils.cp test_asset_path("test_example_file.c"), 'test/'
38
38
 
39
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
40
- expect($?.exitstatus).to match(1) # Unit test failures => Ceedling exit code 1
39
+ output = @c.ceedling_build_exec("gcov:all")
40
+ expect(@c.last_exit_status).to eq(1) # Unit test failures => Ceedling exit code 1
41
41
  expect(output).to match(/TESTED:\s+\d/)
42
42
  expect(output).to match(/PASSED:\s+\d/)
43
43
  expect(output).to match(/FAILED:\s+\d/)
@@ -122,8 +122,8 @@ module GcovCommonTestCases
122
122
  FileUtils.cp test_asset_path("example_file.c"), 'src/'
123
123
  FileUtils.cp test_asset_path("test_example_file_boom.c"), 'test/'
124
124
 
125
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
126
- expect($?.exitstatus).to match(1) # Since a test explodes, Ceedling exits with error
125
+ output = @c.ceedling_build_exec("gcov:all")
126
+ expect(@c.last_exit_status).to eq(1) # Since a test explodes, Ceedling exits with error
127
127
  expect(output).to match(/(?:ERROR: Ceedling Failed)|(?:Ceedling could not complete operations because of errors)/)
128
128
  end
129
129
  end
@@ -133,8 +133,8 @@ module GcovCommonTestCases
133
133
  @c.with_context do
134
134
  Dir.chdir @proj_name do
135
135
  prep_project_yml_for_coverage
136
- output = `bundle exec ruby -S ceedling help 2>&1`
137
- expect($?.exitstatus).to match(0)
136
+ output = @c.ceedling_appcmd_exec("help")
137
+ expect(@c.last_exit_status).to eq(0)
138
138
  expect(output).to match(/ceedling gcov:\*/i)
139
139
  expect(output).to match(/ceedling gcov:all/i)
140
140
  end
@@ -149,7 +149,7 @@ module GcovCommonTestCases
149
149
  FileUtils.cp test_asset_path("example_file.c"), 'src/'
150
150
  FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/'
151
151
 
152
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
152
+ output = @c.ceedling_build_exec("gcov:all")
153
153
  if @gcov_reports.include? :gcovr
154
154
  expect(output).to match(/Generating HTML coverage report in 'build\/artifacts\/gcov\/gcovr\/'\.\.\./)
155
155
  expect(File.exist?('build/artifacts/gcov/gcovr/GcovCoverageResults.html')).to eq true
@@ -170,8 +170,8 @@ module GcovCommonTestCases
170
170
  FileUtils.cp test_asset_path("example_file_with_stdio.c"), 'src/'
171
171
  FileUtils.cp test_asset_path("test_example_file_with_stdio.c"), 'test/'
172
172
 
173
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
174
- expect($?.exitstatus).to match(0)
173
+ output = @c.ceedling_build_exec("gcov:all")
174
+ expect(@c.last_exit_status).to eq(0)
175
175
  # Console summary must report coverage for the source file, not a warning.
176
176
  # When <stdio.h> is included, gcov may list a system header (e.g. _stdio.h)
177
177
  # as the first File entry — the fix ensures the correct source is found.
@@ -194,8 +194,8 @@ module GcovCommonTestCases
194
194
 
195
195
  @c.merge_project_yml_for_test({ :project => { :use_partials => true } })
196
196
 
197
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
198
- expect($?.exitstatus).to match(0)
197
+ output = @c.ceedling_build_exec("gcov:all")
198
+ expect(@c.last_exit_status).to eq(0)
199
199
  # Coverage must be reported for the Partial (gcov references the original
200
200
  # module via #line remapping); no spurious "Found no coverage results" warning.
201
201
  expect(output).to match(/Lines executed:/)
@@ -216,18 +216,7 @@ module GcovCommonTestCases
216
216
  # coverage entries: Ceedling builds one executable per test file, and both
217
217
  # link against example_file.c, producing two sets of .gcda coverage data
218
218
  # for the same functions.
219
- File.write('test/test_example_file_2.c', <<~C)
220
- #include "unity.h"
221
- #include "example_file.h"
222
-
223
- void setUp(void) {}
224
- void tearDown(void) {}
225
-
226
- void test_difference_between_two_numbers(void)
227
- {
228
- TEST_ASSERT_EQUAL_INT(0, difference_between_numbers(1, 1));
229
- }
230
- C
219
+ FileUtils.cp test_asset_path("test_example_file_2.c"), 'test/'
231
220
 
232
221
  # 'strict' causes gcovr to exit non-zero when the same function appears in
233
222
  # multiple test executables' coverage data. Ceedling's default is
@@ -246,11 +235,14 @@ module GcovCommonTestCases
246
235
  }
247
236
  })
248
237
 
249
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
238
+ output = @c.ceedling_build_exec("gcov:all --verbosity=obnoxious")
250
239
  if @gcov_reports.include? :gcovr
251
240
  # Config file honored (fix applied): strict mode exits non-zero on duplicate functions.
252
241
  # Config file overridden by Ceedling CLI (bug): merge-use-line-max exits 0.
253
- expect($?.exitstatus).not_to eq(0)
242
+ expect(@c.last_exit_status).not_to eq(0)
243
+
244
+ # No `--exclude` should appear on the gcovr command line when a config file is in use.
245
+ expect(output).not_to match(/--exclude/)
254
246
  end
255
247
  end
256
248
  end
@@ -266,8 +258,8 @@ module GcovCommonTestCases
266
258
 
267
259
  @c.merge_project_yml_for_test({:project => { :use_backtrace => :gdb }})
268
260
 
269
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
270
- expect($?.exitstatus).to match(1) # Ceedling should exit with error because of failed test due to crash
261
+ output = @c.ceedling_build_exec("gcov:all")
262
+ expect(@c.last_exit_status).to eq(1) # Ceedling should exit with error because of failed test due to crash
271
263
  expect(output).to match(/crashed/i)
272
264
  expect(output).to match(/Unit test failures/)
273
265
  expect(File.exist?('./build/gcov/results/test_example_file_crash_sigsegv.fail'))
@@ -300,8 +292,8 @@ module GcovCommonTestCases
300
292
 
301
293
  @c.merge_project_yml_for_test({:project => { :use_backtrace => :gdb }})
302
294
 
303
- output = `bundle exec ruby -S ceedling gcov:all --exclude_test_case=test_add_numbers_adds_numbers 2>&1`
304
- expect($?.exitstatus).to match(1) # Ceedling should exit with error because of failed test due to crash
295
+ output = @c.ceedling_build_exec("gcov:all --exclude_test_case=test_add_numbers_adds_numbers")
296
+ expect(@c.last_exit_status).to eq(1) # Ceedling should exit with error because of failed test due to crash
305
297
  expect(output).to match(/Test Case Crashed/i)
306
298
  expect(output).to match(/Unit test failures/)
307
299
  expect(File.exist?('./build/gcov/results/test_example_file_crash_sigsegv.fail'))
@@ -342,8 +334,8 @@ module GcovCommonTestCases
342
334
  updated_test_file.insert(updated_test_file.length(), add_test_case)
343
335
  File.write('test/test_example_file_crash_sigsegv.c', updated_test_file.join("\n"), mode: 'w')
344
336
 
345
- output = `bundle exec ruby -S ceedling gcov:all --exclude_test_case=test_add_numbers_will_fail 2>&1`
346
- expect($?.exitstatus).to match(0)
337
+ output = @c.ceedling_build_exec("gcov:all --exclude_test_case=test_add_numbers_will_fail")
338
+ expect(@c.last_exit_status).to eq(0)
347
339
  expect(File.exist?('./build/gcov/results/test_example_file_crash_sigsegv.pass'))
348
340
  expect(output).to match(/TESTED:\s+2/)
349
341
  expect(output).to match(/PASSED:\s+2/)
@@ -374,8 +366,8 @@ module GcovCommonTestCases
374
366
  # Untested — no test references this source file.
375
367
  FileUtils.cp test_asset_path("uncovered_example_file.c"), 'src/'
376
368
 
377
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
378
- expect($?.exitstatus).to match(0)
369
+ output = @c.ceedling_build_exec("gcov:all")
370
+ expect(@c.last_exit_status).to eq(0)
379
371
  expect(output).not_to match(/Untested Source Files/)
380
372
  expect(output).not_to match(/Processing Untested Sources/)
381
373
  expect(output).not_to match(/uncovered_example_file/)
@@ -394,8 +386,8 @@ module GcovCommonTestCases
394
386
  # Untested — no test references this source file.
395
387
  FileUtils.cp test_asset_path("uncovered_example_file.c"), 'src/'
396
388
 
397
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
398
- expect($?.exitstatus).to match(0)
389
+ output = @c.ceedling_build_exec("gcov:all")
390
+ expect(@c.last_exit_status).to eq(0)
399
391
  # Immediate warning-level filepath listing (no compilation attempted).
400
392
  expect(output).to match(/Untested.+not.+coverage report/)
401
393
  expect(output).to match(/uncovered_example_file\.c/)
@@ -418,13 +410,10 @@ module GcovCommonTestCases
418
410
 
419
411
  # Untested source with a syntax error — fails to compile regardless of
420
412
  # any :defines/:flags, deliberately triggering the guidance notice.
421
- File.write('src/broken_uncovered_file.c', <<~C)
422
- int broken_uncovered_function(int a, int b) {
423
- return a + b // Missing semicolon and closing brace: guaranteed compile error.
424
- C
413
+ FileUtils.cp test_asset_path("broken_uncovered_file.c"), 'src/'
425
414
 
426
- output = `bundle exec ruby -S ceedling gcov:all 2>&1`
427
- expect($?.exitstatus).not_to eq(0) # Fail-fast: compile failure fails the build
415
+ output = @c.ceedling_build_exec("gcov:all")
416
+ expect(@c.last_exit_status).not_to eq(0) # Fail-fast: compile failure fails the build
428
417
  expect(output).to match(/Compiling.+with coverage failed/)
429
418
  expect(output).to match(/:untested_sources.*:compile/)
430
419
  # Avoid unicode character matching in log matching, since some shells may not support them.
@@ -447,8 +436,8 @@ module GcovCommonTestCases
447
436
 
448
437
  # Run the standalone task directly — no prior `gcov:all` in this invocation,
449
438
  # so no test fixture is ever built or executed.
450
- output = `bundle exec ruby -S ceedling gcov:untested_sources 2>&1`
451
- expect($?.exitstatus).to match(0)
439
+ output = @c.ceedling_build_exec("gcov:untested_sources")
440
+ expect(@c.last_exit_status).to eq(0)
452
441
  expect(output).not_to match(/TESTED:\s+\d/) # No test build/run occurred
453
442
  expect(File.exist?('build/gcov/out/uncovered_example_file.o')).to eq true
454
443
  end