ceedling 1.1.6 → 1.1.7

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/GIT_COMMIT_SHA +1 -1
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +2 -0
  5. data/README.md +4 -1
  6. data/docs/Changelog.md +11 -0
  7. data/docs/KnownIssues.md +1 -0
  8. data/docs/mkdocs/configuration/project-file.md +25 -7
  9. data/docs/mkdocs/configuration/reference/cexception.md +1 -1
  10. data/docs/mkdocs/configuration/reference/cmock.md +1 -1
  11. data/docs/mkdocs/configuration/reference/unity.md +1 -1
  12. data/docs/mkdocs/getting-started/quick-start.md +11 -8
  13. data/docs/mkdocs/plugins/gcov/gcovr.md +324 -189
  14. data/docs/mkdocs/plugins/gcov/reportgenerator.md +113 -31
  15. data/docs/mkdocs/reference/gcov-plugin.md +21 -3
  16. data/docs/mkdocs/snapshot/plugins/gcov/config/defaults.yml +0 -1
  17. data/lib/ceedling/generators/generator_test_results_backtrace.rb +16 -8
  18. data/lib/ceedling/plugins/plugin_reportinator.rb +9 -0
  19. data/lib/ceedling/plugins/report_tests_stdout_plugin.rb +1 -1
  20. data/lib/version.rb +1 -1
  21. data/plugins/gcov/config/defaults.yml +0 -1
  22. data/plugins/gcov/lib/gcov.rb +35 -16
  23. data/plugins/gcov/lib/gcovr_reportinator.rb +31 -1
  24. data/plugins/valgrind/lib/valgrind.rb +1 -1
  25. data/site-local/configuration/project-file.html +78 -8
  26. data/site-local/configuration/reference/cexception.html +5 -5
  27. data/site-local/configuration/reference/cmock.html +5 -5
  28. data/site-local/configuration/reference/unity.html +5 -5
  29. data/site-local/getting-started/quick-start.html +13 -9
  30. data/site-local/plugins/gcov/gcovr.html +1215 -255
  31. data/site-local/plugins/gcov/reportgenerator.html +404 -46
  32. data/site-local/reference/gcov-plugin.html +40 -7
  33. data/site-local/sitemap.xml.gz +0 -0
  34. data/site-local/snapshot/plugins/gcov/config/defaults.yml +0 -1
  35. data/spec/support/system/system_context.rb +7 -3
  36. data/spec/system/deployment_as_gem_spec.rb +2 -0
  37. data/spec/system/deployment_as_vendor_spec.rb +2 -0
  38. data/spec/system/gcov_deployment_spec.rb +2 -0
  39. data/spec/system/support/common_test_cases.rb +42 -0
  40. data/spec/system/support/gcov_common_test_cases.rb +52 -0
  41. data/spec/units/generators/generator_test_results_backtrace_spec.rb +51 -0
  42. data/spec/units/plugin_reportinator_spec.rb +38 -0
  43. metadata +4 -2
@@ -32,10 +32,11 @@ using a Gcovr config file, you must provide explicit exclusion patterns matching
32
32
  your project layout (example below).
33
33
 
34
34
  ```ini
35
- [gcovr]
36
35
  ; You will need to revise these example exclude patterns to match your
37
36
  ; project directories and file naming as they cannot be automatically
38
37
  ; provided to Gcovr when a Gcovr configuration file is in use.
38
+ ;
39
+ ; Note: Format is flat `key = value` lines with no `[section]` header.
39
40
 
40
41
  ; Test path(s) exclusions for 'test_' files with .c extensions.
41
42
  exclude = .*test.*/test_.+\.c$
@@ -44,12 +45,17 @@ exclude = .*test.*/test_.+\.c$
44
45
  exclude = .*build/.+\.c$
45
46
  ```
46
47
 
47
- ### Plugin project configuration
48
+ ## Plugin configuration
48
49
 
49
- The following is an exhaustive commented version of all GCovr configuration
50
- options exposed through your project configuration file. Only specify those
51
- you need or those whose defaults you need to override. You do not need to
52
- include all these options in your Gcov plugin configuration.
50
+ The following options are exposed through your project configuration file, all
51
+ beneath `:gcov` `:gcovr`. Only specify those you need or those whose defaults
52
+ you need to override. You do not need to include all these options in your
53
+ Gcov plugin configuration.
54
+
55
+ ### `:report_root`
56
+
57
+ The root directory of your source files. File names are reported relative to
58
+ this root. `:report_root` is also the default `:report_include`.
53
59
 
54
60
  !!! warning "`gcovr` accepts only one reporting root path"
55
61
  `gcovr` accepts only a single path for `:report_root`. In unusual project
@@ -57,216 +63,345 @@ include all these options in your Gcov plugin configuration.
57
63
  _all_ source files and selectively exclude paths or files from coverage
58
64
  reporting (see `:report_exclude` and `:exclude_directories`).
59
65
 
60
- ```yaml
61
- :gcov:
62
- :gcovr:
63
- # The root directory of your source files. Defaults to ".", the current directory.
64
- # File names are reported relative to this root. The report_root is the default report_include.
65
- # Default if unspecified: "."
66
- :report_root: <path>
67
-
68
- # Load the specified configuration file. (gcovr --config)
69
- # Defaults to gcovr.cfg in the report_root directory if that file exists.
70
- #
71
- # When :config_file is set, Ceedling passes only --root and --config to
72
- # gcovr and defers all other configuration to the file. This prevents
73
- # Ceedling from overriding config file values with its CLI arguments. Only
74
- # :report_root is still applied because Ceedling may invoke gcovr from a
75
- # different working directory than your project root.
76
- #
77
- # To preserve the plugin’s base filtering behavior, include the following
78
- # patterns in your config file (adjust paths to match your project’s
79
- # :test_file_prefix, test paths, and :build_root settings):
80
- #
81
- # [gcovr]
82
- # exclude = .*test.*/test_.+\.c$
83
- # exclude = .*build/.+\.c$
84
- :config_file: <config_file>
85
-
86
- # Exit with a status of 2 if the total line coverage is less than MIN percentage.
87
- # Can be ORed with exit status of other fail options. (gcovr --fail-under-line)
88
- :fail_under_line: <1-100>
89
-
90
- # Exit with a status of 4 if the total branch coverage is less than MIN percentage.
91
- # Can be ORed with exit status of other fail options. (gcovr --fail-under-branch)
92
- :fail_under_branch: <1-100>
93
-
94
- # Exit with a status of 8 if the total decision coverage is less than MIN percentage.
95
- # Can be ORed with exit status of other fail options. (gcovr --fail-under-decision)
96
- :fail_under_decision: <1-100>
97
-
98
- # Exit with a status of 16 if the total function coverage is less than MIN percentage.
99
- # Can be ORed with exit status of other fail options. (gcovr --fail-under-function)
100
- :fail_under_function: <1-100>
101
-
102
- # If the fail options above are set, specify whether those conditions should break a build.
103
- # The default option is false and simply logs a warning without breaking the build.
104
- :exception_on_fail: <true|false>
105
-
106
- # Select the source file encoding.
107
- # Defaults to the system default encoding (UTF-8). (gcovr --source-encoding)
108
- :source_encoding: <encoding>
109
-
110
- # Report the branch coverage instead of the line coverage. For text report only. (gcovr --branches).
111
- :branches: <true|false>
112
-
113
- # Sort entries by increasing number of uncovered lines.
114
- # For text and HTML report. (gcovr --sort-uncovered)
115
- :sort_uncovered: <true|false>
116
-
117
- # Sort entries by increasing percentage of uncovered lines.
118
- # For text and HTML report. (gcovr --sort-percentage)
119
- :sort_percentage: <true|false>
120
-
121
- # Print a small report to stdout with line & branch percentage coverage.
122
- # This is in addition to other reports. (gcovr --print-summary).
123
- :print_summary: <true|false>
124
-
125
- # Keep only source files that match this filter. (gcovr --filter).
126
- # Filters are regular expressions (ex: "^src")
127
- :report_include: <filter>
128
-
129
- # Exclude source files that match this filter. (gcovr --exclude).
130
- # Filters are regular expressions (ex: "^vendor.*|^build.*|^test.*|^lib.*")
131
- :report_exclude: <filter>
132
-
133
- # Keep only gcov data files that match this filter. (gcovr --gcov-filter).
134
- # Filters are regular expressions
135
- :gcov_filter: <filter>
136
-
137
- # Exclude gcov data files that match this filter. (gcovr --gcov-exclude).
138
- # Filters are regular expressions
139
- :gcov_exclude: <filter>
140
-
141
- # Exclude directories that match this filter while searching
142
- # raw coverage files. (gcovr --exclude-directories).
143
- # Filters are regular expressions
144
- :exclude_directories: <filters>
145
-
146
- # Use a particular gcov executable. (gcovr --gcov-executable).
147
- # (This may be appropriate and necessary in special circumstances.
148
- # Please review Ceedling’s options for modifying tools first.)
149
- :gcov_executable: <cmd>
150
-
151
- # Exclude branch coverage from lines without useful
152
- # source code. (gcovr --exclude-unreachable-branches).
153
- :exclude_unreachable_branches: <true|false>
154
-
155
- # For branch coverage, exclude branches that the compiler
156
- # generates for exception handling. (gcovr --exclude-throw-branches).
157
- :exclude_throw_branches: <true|false>
158
-
159
- # For Gcovr 6.0+, multiple instances of the same function in coverage results can
160
- # cause a fatal error. Since Ceedling can test multiple build variations of the
161
- # same source function, this is bad.
162
- # Default value for Gcov plugin is 'merge-use-line-max'. See Gcovr docs for more.
163
- # https://gcovr.com/en/stable/guide/merging.html
164
- :merge_mode_function: <...>
165
-
166
- # Use existing gcov files for analysis. Default: False. (gcovr --use-gcov-files)
167
- :use_gcov_files: <true|false>
168
-
169
- # Skip lines with parse errors in GCOV files instead of
170
- # exiting with an error. (gcovr --gcov-ignore-parse-errors).
171
- :gcov_ignore_parse_errors: <true|false>
172
-
173
- # Override normal working directory detection. (gcovr --object-directory)
174
- :object_directory: <path>
175
-
176
- # Keep gcov files after processing. (gcovr --keep).
177
- :keep: <true|false>
178
-
179
- # Delete gcda files after processing. (gcovr --delete).
180
- :delete: <true|false>
66
+ **Default:** `"."` (the current directory)
67
+
68
+ ---
69
+
70
+ ### `:config_file`
71
+
72
+ Load the specified `gcovr` configuration file. (`gcovr --config`)
73
+
74
+ When `:config_file` is set, Ceedling passes only `--root` and `--config` to
75
+ `gcovr` and defers all other configuration to the file. This prevents
76
+ Ceedling from overriding config file values with its CLI arguments.
77
+ `:report_root` is still applied because Ceedling may invoke `gcovr` from a
78
+ different working directory than your project root.
79
+
80
+ To preserve the plugin's base filtering behavior, include exclusion patterns
81
+ matching your project layout in the config file itself — see
82
+ [Gcovr configuration file](#gcovr-configuration-file) above.
83
+
84
+ **Default:** `gcovr.cfg` in the `:report_root` directory, if that file exists.
85
+
86
+ ---
87
+
88
+ ### `:fail_under_line`
89
+
90
+ Exit with a status of 2 if the total line coverage is less than this minimum
91
+ percentage. Can be ORed with the exit status of other `:fail_under_*` options.
92
+ (`gcovr --fail-under-line`)
93
+
94
+ **Values:** `1`–`100`
95
+
96
+ ---
97
+
98
+ ### `:fail_under_branch`
99
+
100
+ Exit with a status of 4 if the total branch coverage is less than this minimum
101
+ percentage. Can be ORed with the exit status of other `:fail_under_*` options.
102
+ (`gcovr --fail-under-branch`)
103
+
104
+ **Values:** `1`–`100`
105
+
106
+ ---
107
+
108
+ ### `:fail_under_decision`
109
+
110
+ Exit with a status of 8 if the total decision coverage is less than this minimum
111
+ percentage. Can be ORed with the exit status of other `:fail_under_*` options.
112
+ (`gcovr --fail-under-decision`)
113
+
114
+ `gcovr` treats `--fail-under-decision` as a no-op without `--decisions` also
115
+ present — setting this option implies `:decisions` (below) automatically, so
116
+ it's never silently non-functional.
117
+
118
+ **Values:** `1`–`100`
119
+
120
+ **Requires:** `gcovr` 7.0 or higher
121
+
122
+ ---
123
+
124
+ ### `:decisions`
125
+
126
+ Report the decision coverage. For HTML, JSON, and the summary report.
127
+ (`gcovr --decisions`)
128
+
129
+ Implied automatically whenever `:fail_under_decision` is set.
130
+
131
+ **Requires:** `gcovr` 6.0 or higher
132
+
133
+ ---
134
+
135
+ ### `:fail_under_function`
136
+
137
+ Exit with a status of 16 if the total function coverage is less than this minimum
138
+ percentage. Can be ORed with the exit status of other `:fail_under_*` options.
139
+ (`gcovr --fail-under-function`)
140
+
141
+ **Values:** `1`–`100`
142
+
143
+ ---
144
+
145
+ ### `:exception_on_fail`
146
+
147
+ If any `:fail_under_*` option above is set and its condition is met, specifies
148
+ whether that condition should break the build. When disabled, Ceedling simply
149
+ logs a warning without breaking the build.
150
+
151
+ **Default:** `false`
152
+
153
+ ---
154
+
155
+ ### `:source_encoding`
156
+
157
+ Select the source file character encoding. (`gcovr --source-encoding`)
158
+
159
+ **Default:** the system default encoding (typically `UTF-8`)
160
+
161
+ ---
162
+
163
+ ### `:branches`
164
+
165
+ Report the branch coverage instead of the line coverage. Applies to the text
166
+ report only. (`gcovr --branches`)
167
+
168
+ ---
169
+
170
+ ### `:sort_uncovered`
171
+
172
+ Sort entries by increasing number of uncovered lines. Applies to text and HTML
173
+ reports. (`gcovr --sort-uncovered`)
174
+
175
+ ---
176
+
177
+ ### `:sort_percentage`
178
+
179
+ Sort entries by increasing percentage of uncovered lines. Applies to text and
180
+ HTML reports. (`gcovr --sort-percentage`)
181
+
182
+ ---
183
+
184
+ ### `:print_summary`
185
+
186
+ Print a small report to stdout with line and branch percentage coverage. This
187
+ is in addition to any other configured reports. (`gcovr --print-summary`)
188
+
189
+ ---
190
+
191
+ ### `:report_include`
192
+
193
+ Keep only source files that match this filter. Filters are regular
194
+ expressions. (`gcovr --filter`)
195
+
196
+ **Example:** `"^src"`
197
+
198
+ ---
199
+
200
+ ### `:report_exclude`
201
+
202
+ Exclude source files that match this filter. Filters are regular expressions.
203
+ (`gcovr --exclude`)
204
+
205
+ **Example:** `"^vendor.*|^build.*|^test.*|^lib.*"`
206
+
207
+ ---
208
+
209
+ ### `:gcov_filter`
210
+
211
+ Keep only `.gcov` data files that match this filter. Filters are regular
212
+ expressions. (`gcovr --gcov-filter`)
213
+
214
+ ---
215
+
216
+ ### `:gcov_exclude`
217
+
218
+ Exclude `.gcov` data files that match this filter. Filters are regular
219
+ expressions. (`gcovr --gcov-exclude`)
220
+
221
+ ---
222
+
223
+ ### `:exclude_directories`
224
+
225
+ Exclude directories that match this filter while searching for raw coverage
226
+ files. Filters are regular expressions. (`gcovr --exclude-directories`)
227
+
228
+ ---
229
+
230
+ ### `:gcov_executable`
231
+
232
+ Use a particular `gcov` executable. This may be appropriate and necessary in
233
+ special circumstances — review Ceedling's options for modifying tools first.
234
+ (`gcovr --gcov-executable`)
235
+
236
+ ---
237
+
238
+ ### `:exclude_unreachable_branches`
239
+
240
+ Exclude branch coverage from lines without useful source code.
241
+ (`gcovr --exclude-unreachable-branches`)
242
+
243
+ ---
244
+
245
+ ### `:exclude_throw_branches`
246
+
247
+ For branch coverage, exclude branches that the compiler generates for
248
+ exception handling. (`gcovr --exclude-throw-branches`)
249
+
250
+ ---
251
+
252
+ ### `:merge_mode_function`
253
+
254
+ For `gcovr` 6.0+, multiple instances of the same function in coverage results
255
+ can cause a fatal error. Since Ceedling can test multiple build variations of
256
+ the same source function, this is a real risk. This option controls how
257
+ `gcovr` merges those repeated entries. See the
258
+ [gcovr merging docs](https://gcovr.com/en/stable/guide/merging.html) for all
259
+ valid values. Ignored on `gcovr` versions below 6.0.
260
+
261
+ **Default:** `merge-use-line-max` (`gcovr`'s own default, `strict`, raises an
262
+ exception for many Ceedling projects)
263
+
264
+ ---
265
+
266
+ ### `:use_gcov_files`
267
+
268
+ Use existing `.gcov` files for analysis instead of running `gcov` again.
269
+ (`gcovr --use-gcov-files`)
270
+
271
+ **Default:** `false`
272
+
273
+ ---
274
+
275
+ ### `:gcov_ignore_parse_errors`
276
+
277
+ Skip lines with parse errors in `.gcov` files instead of exiting with an
278
+ error. (`gcovr --gcov-ignore-parse-errors`)
279
+
280
+ ---
281
+
282
+ ### `:object_directory`
283
+
284
+ Override normal working directory detection for `.gcda`/`.gcno` files.
285
+ (`gcovr --object-directory`)
286
+
287
+ ---
288
+
289
+ ### `:keep`
290
+
291
+ Keep intermediate `.gcov` files after processing. (`gcovr --keep`)
292
+
293
+ ---
294
+
295
+ ### `:delete`
296
+
297
+ Delete `.gcda` files after processing. (`gcovr --delete`)
298
+
299
+ ---
300
+
301
+ ### `:threads`
302
+
303
+ Set the number of threads `gcovr` uses in parallel. (`gcovr -j`)
181
304
 
182
- # Set the number of threads to use in parallel. (gcovr -j).
183
- :threads: <count>
184
- ```
185
305
  ## HTML reports
186
306
 
187
307
  Generation of HTML reports may be modified with the following configuration items.
188
308
 
189
- ```yaml
190
- :gcov:
191
- :gcovr:
192
- # HTML report filename.
193
- :html_artifact_filename: <filename>
194
-
195
- # Use 'title' as title for the HTML report.
196
- # Default is 'Head'. (gcovr --html-title)
197
- :html_title: <title>
198
-
199
- # If the coverage is below MEDIUM, the value is marked as low coverage in the HTML report.
200
- # MEDIUM has to be lower than or equal to value of html_high_threshold.
201
- # If MEDIUM is equal to value of html_high_threshold the report has only high and low coverage.
202
- # Default is 75.0. (gcovr --html-medium-threshold)
203
- :html_medium_threshold: 75
204
-
205
- # If the coverage is below HIGH, the value is marked as medium coverage in the HTML report.
206
- # HIGH has to be greater than or equal to value of html_medium_threshold.
207
- # If HIGH is equal to value of html_medium_threshold the report has only high and low coverage.
208
- # Default is 90.0. (gcovr -html-high-threshold)
209
- :html_high_threshold: 90
210
-
211
- # Set to 'true' to use absolute paths to link the 'detailed' reports.
212
- # Defaults to relative links. (gcovr --html-absolute-paths)
213
- :html_absolute_paths: <true|false>
214
-
215
- # Override the declared HTML report encoding. Defaults to UTF-8. (gcovr --html-encoding)
216
- :html_encoding: <html_encoding>
217
- ```
309
+ ### `:html_artifact_filename`
310
+
311
+ Override the default HTML report output filename.
312
+
313
+ ---
314
+
315
+ ### `:html_title`
316
+
317
+ Use `title` as the title for the HTML report. (`gcovr --html-title`)
318
+
319
+ **Default:** `Head`
320
+
321
+ ---
322
+
323
+ ### `:html_medium_threshold`
324
+
325
+ If the coverage is below this value, it is marked as low coverage in the HTML
326
+ report. Must be lower than or equal to `:html_high_threshold`. If equal to
327
+ `:html_high_threshold`, the report has only high and low coverage.
328
+ (`gcovr --html-medium-threshold`)
329
+
330
+ **Default:** `75.0`
331
+
332
+ ---
333
+
334
+ ### `:html_high_threshold`
335
+
336
+ If the coverage is below this value, it is marked as medium coverage in the
337
+ HTML report. Must be greater than or equal to `:html_medium_threshold`. If
338
+ equal to `:html_medium_threshold`, the report has only high and low coverage.
339
+ (`gcovr --html-high-threshold`)
340
+
341
+ **Default:** `90.0`
342
+
343
+ ---
344
+
345
+ ### `:html_absolute_paths`
346
+
347
+ Use absolute paths to link the "detailed" reports. Defaults to relative
348
+ links. (`gcovr --html-absolute-paths`)
349
+
350
+ ---
351
+
352
+ ### `:html_encoding`
353
+
354
+ Override the declared HTML report encoding. (`gcovr --html-encoding`)
355
+
356
+ **Default:** `UTF-8`
218
357
 
219
358
  ## Cobertura XML reports
220
359
 
221
360
  Generation of Cobertura XML reports may be modified with the following configuration items.
222
361
 
223
- ```yaml
224
- :gcov:
225
- :gcovr:
226
- # Set to 'true' to pretty-print the Cobertura XML report, otherwise set to 'false'.
227
- # Defaults to disabled. (gcovr --xml-pretty)
228
- :cobertura_pretty: <true|false>
362
+ ### `:cobertura_pretty`
229
363
 
230
- # Override default Cobertura XML report filename.
231
- :cobertura_artifact_filename: <filename>
232
- ```
364
+ Pretty-print the Cobertura XML report. (`gcovr --xml-pretty`)
365
+
366
+ **Default:** `false`
367
+
368
+ ---
369
+
370
+ ### `:cobertura_artifact_filename`
371
+
372
+ Override the default Cobertura XML report output filename.
233
373
 
234
374
  ## SonarQube XML reports
235
375
 
236
376
  Generation of SonarQube XML reports may be modified with the following configuration items.
237
377
 
238
- ```yaml
239
- :gcov:
240
- :gcovr:
241
- # Override default SonarQube XML report filename.
242
- :sonarqube_artifact_filename: <filename>
243
- ```
378
+ ### `:sonarqube_artifact_filename`
379
+
380
+ Override the default SonarQube XML report output filename.
244
381
 
245
382
  ## JSON reports
246
383
 
247
384
  Generation of JSON reports may be modified with the following configuration items.
248
385
 
249
- ```yaml
250
- :gcov:
251
- :gcovr:
252
- # Set to 'true' to pretty-print the JSON report, otherwise set 'false'.
253
- # Defaults to disabled. (gcovr --json-pretty)
254
- :json_pretty: <true|false>
386
+ ### `:json_pretty`
255
387
 
256
- # Override default JSON report filename.
257
- :json_artifact_filename: <filename>
258
- ```
388
+ Pretty-print the JSON report. (`gcovr --json-pretty`)
389
+
390
+ **Default:** `false`
391
+
392
+ ---
393
+
394
+ ### `:json_artifact_filename`
395
+
396
+ Override the default JSON report output filename.
259
397
 
260
398
  ## Text reports
261
399
 
262
400
  Generation of text reports may be modified with the following configuration items.
263
401
  Text reports may be printed to the console or output to a file.
264
402
 
265
- ```yaml
266
- :gcov:
267
- :gcovr:
268
- # Override default text report filename.
269
- :text_artifact_filename: <filename>
270
- ```
403
+ ### `:text_artifact_filename`
404
+
405
+ Override the default text report output filename.
271
406
 
272
407
  <br/><br/>