ceedling 1.1.1 → 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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/GIT_COMMIT_SHA +1 -1
  3. data/README.md +3 -3
  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 +17 -3
  16. data/lib/ceedling/c_extractor/c_extractor_declarations.rb +3 -1
  17. data/lib/ceedling/c_extractor/c_extractor_preprocessing.rb +20 -7
  18. data/lib/ceedling/generators/generator_partials.rb +13 -3
  19. data/lib/ceedling/objects.yml +1 -0
  20. data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +10 -2
  21. data/lib/ceedling/preprocess/preprocessinator_reconstructor.rb +23 -15
  22. data/lib/version.rb +1 -1
  23. data/site-local/sitemap.xml.gz +0 -0
  24. data/spec/system/gcov_deployment_spec.rb +20 -6
  25. data/spec/system/support/gcov_common_test_cases.rb +31 -45
  26. data/spec/system/support/gcov_partials_test_cases.rb +116 -0
  27. data/spec/units/c_extractor/c_extractor_declarations_spec.rb +128 -0
  28. data/spec/units/c_extractor/c_extractor_definitions_spec.rb +7 -0
  29. data/spec/units/c_extractor/c_extractor_integration_spec.rb +17 -0
  30. data/spec/units/c_extractor/c_extractor_preprocessing_spec.rb +46 -0
  31. data/spec/units/generators/generator_partials_spec.rb +32 -6
  32. data/spec/units/preprocess/preprocessinator_file_assembler_spec.rb +96 -2
  33. data/spec/units/preprocess/preprocessinator_reconstructor_spec.rb +151 -1
  34. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56f073ff96051065c1f390744785a8e933cbfa700d81a585495b49d44b318f1c
4
- data.tar.gz: 3d9567c9ebb1477eb215fb9cb8cdfd42f76b7b8c5cdfd9cce1010eff89e49ea3
3
+ metadata.gz: 70deeef4f895489e967caec64bb020696e41fa327c83785eed4fa553a1c7b8bb
4
+ data.tar.gz: a3f48f487a174c6710601b693a44273542ca3934ae072d622994a19dd9d64884
5
5
  SHA512:
6
- metadata.gz: 3e108e84bc09d28d53ca336b49cea22e970d6319810b8b68dab3f1dadb9793eb40948589fb771f8f1d6f731ce2319f9ee32b9cc8a12a8f54d32061e4a052c948
7
- data.tar.gz: 6e21e05a55622e2836e52feccd2db2c99a2827db4c6b1179f6ed30c702db8a59dc888fd460d23976d07b3c36237e400b0e553ee9493b3f287456bd10099eae29
6
+ metadata.gz: 8dcd78f2672ac8afcf375314ae458c0a734b000b0edae3aee34614492072aa2e53c5751ffbc15703b90e82527b1f740800a52231bf7922749df881c00aa3ed81
7
+ data.tar.gz: 29bb2ceace5a9f6d20fbf0d3546a708c1a07677aa558681c95ba3cf7c4991a487edf29e58226a084d169ee700a290c09695aed9f8a8d04923eb39aac9ba90449
data/GIT_COMMIT_SHA CHANGED
@@ -1 +1 @@
1
- e7770cc
1
+ 6f17bf8
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Ceedling ![CI](https://github.com/ThrowTheSwitch/Ceedling/workflows/CI/badge.svg)
2
2
  ========
3
3
 
4
- **Ceedling 1.1.0** is the latest and greatest.
4
+ **Ceedling 1.1.2** is the latest and greatest.
5
5
 
6
6
  See [_Release Notes_][release-notes], [_Changelog_](docs/Changelog.md),
7
7
  [_Breaking Changes_][breaking-changes], and [_Known Issues_][known-issues].
@@ -9,7 +9,7 @@ See [_Release Notes_][release-notes], [_Changelog_](docs/Changelog.md),
9
9
  See [🚀 Getting Started](#-getting-started) for installation and new
10
10
  project set up.
11
11
 
12
- **New goodies:**
12
+ **New goodies in 1.1.x:**
13
13
  * A [Partial][partials-docs] allows a test to mix mocked and real functions
14
14
  from the same source module in a single test file and enables testing of
15
15
  `static` and `inline` functions without modifying source code.
@@ -22,7 +22,7 @@ from the same source module in a single test file and enables testing of
22
22
  * New stock plugins for [Valgrind memory checking][valgrind-plugin] and
23
23
  [Cppcheck static analysis][cppcheck-plugin].
24
24
  * The [GCov plugin][gcov-plugin]:
25
- * _Finally_ supports coverage reports for all sources.
25
+ * Now supports coverage reports for all sources.
26
26
  * Adds support for Modified Condition / Decision Coverage.
27
27
  * Mixins improvements including an option for [inline YAML at the command line][mixins-inline-yaml].
28
28
  * Ceedling’s test preprocessing is once again compatible with Unity’s
@@ -0,0 +1,13 @@
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
+ // Untested source with a syntax error -- fails to compile regardless of any
9
+ // :defines/:flags, deliberately triggering the :untested_sources guidance
10
+ // notice when :gcov :untested_sources is set to :compile.
11
+
12
+ int broken_uncovered_function(int a, int b) {
13
+ return a + b // Missing semicolon and closing brace: guaranteed compile error.
@@ -0,0 +1,22 @@
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
+ // A second test file covering the same source as test_example_file_success.c.
9
+ // Ceedling builds one executable per test file, and both link against
10
+ // example_file.c, producing two sets of .gcda coverage data for the same
11
+ // functions -- used to exercise gcovr's merge-mode-functions behavior.
12
+
13
+ #include "unity.h"
14
+ #include "example_file.h"
15
+
16
+ void setUp(void) {}
17
+ void tearDown(void) {}
18
+
19
+ void test_difference_between_two_numbers(void)
20
+ {
21
+ TEST_ASSERT_EQUAL_INT(0, difference_between_numbers(1, 1));
22
+ }
@@ -0,0 +1,10 @@
1
+ #include "blanks.h"
2
+ void helloBlanks(void) {
3
+
4
+
5
+ return; // Must be the reported hit line -- the whole point of this fixture
6
+ }
7
+
8
+ // Lines 3-4 above are deliberately blank -- standing in for a stripped
9
+ // multi-line comment. They must never absorb the hit that belongs to
10
+ // `return` on line 5; see gcov_partials_coverage_blank_lines_in_function_body.
@@ -0,0 +1 @@
1
+ void helloBlanks(void);
@@ -0,0 +1,12 @@
1
+ #include "counter.h"
2
+ int helloCounter(void) {
3
+ static int count; // Promoted to module scope and replaced with a no-op by Partials
4
+
5
+ count++; // Must independently report as hit
6
+
7
+ return count; // Must independently report as hit
8
+ }
9
+
10
+ // Lines 4 and 6 above are deliberately blank; they must never absorb the
11
+ // hits that belong to `count++;` (line 5) and `return count;` (line 7);
12
+ // see gcov_partials_coverage_function_scope_static_promotion.
@@ -0,0 +1 @@
1
+ int helloCounter(void);
@@ -0,0 +1,11 @@
1
+ #include "decorators.h"
2
+ static // Own line -- exercises the Partials #line adjustment for stripped decorators
3
+ inline // Own line -- same as above
4
+ void helloDecorators(void)
5
+ {
6
+
7
+ return; // Must be the reported hit line
8
+ }
9
+
10
+ // Line 6 above is deliberately blank; it must never absorb the hit that
11
+ // belongs to `return` on line 7; see gcov_partials_coverage_decorators_on_own_lines.
@@ -0,0 +1,4 @@
1
+ // `helloDecorators` is `static` in decorators.c, so -- like any private
2
+ // helper -- it has no prototype here. Its declaration for the test file
3
+ // comes from the generated Partial's own header via TEST_PARTIAL_ALL_MODULE,
4
+ // not from this file.
@@ -0,0 +1,8 @@
1
+ #include "unity.h"
2
+ #include "ceedling.h"
3
+ #include TEST_PARTIAL_ALL_MODULE(blanks)
4
+ #include "blanks.h"
5
+
6
+ void test_helloBlanks(void) {
7
+ helloBlanks();
8
+ }
@@ -0,0 +1,9 @@
1
+ #include "unity.h"
2
+ #include "ceedling.h"
3
+ #include TEST_PARTIAL_ALL_MODULE(counter)
4
+ #include "counter.h"
5
+
6
+ void test_helloCounter(void) {
7
+ TEST_ASSERT_EQUAL(1, helloCounter());
8
+ TEST_ASSERT_EQUAL(2, helloCounter());
9
+ }
@@ -0,0 +1,8 @@
1
+ #include "unity.h"
2
+ #include "ceedling.h"
3
+ #include TEST_PARTIAL_ALL_MODULE(decorators)
4
+ #include "decorators.h"
5
+
6
+ void test_helloDecorators(void) {
7
+ helloDecorators();
8
+ }
data/docs/Changelog.md CHANGED
@@ -10,6 +10,20 @@ This changelog is complemented by three other documents:
10
10
 
11
11
  ---
12
12
 
13
+ # [1.1.2] — 2026-07-27
14
+
15
+ ## 💪 Fixed
16
+
17
+ - Fixed line end handling for certain circumstances in Windows that could accidentally create extra white space lines that affect file line numbering (particularly in coverage reporting).
18
+
19
+ ### Partials
20
+
21
+ - [#1182](https://github.com/ThrowTheSwitch/Ceedling/issues/1182) Fixed termination newline handling for certain variable declarations. Robustified all similar cases in C feature extraction and added further test coverage.
22
+ - [#1184](https://github.com/ThrowTheSwitch/Ceedling/issues/1184) Fixed escaped character handling in `#define` string literals.
23
+ - [#1183](https://github.com/ThrowTheSwitch/Ceedling/issues/1183) Fixed postprocessed preprocessed files (ha) to preserve blank lines in function definitions where comments were stripped out by preprocessing. Without preserving blank lines, line numbering for coverage reporting purposes becomes corrupted.
24
+
25
+ ---
26
+
13
27
  # [1.1.1] — 2026-07-23
14
28
 
15
29
  ## 🌟 Added
@@ -18,15 +32,15 @@ This changelog is complemented by three other documents:
18
32
 
19
33
  ## 💪 Fixed
20
34
 
21
- New since 1.1.0:
35
+ ### New since 1.1.0
22
36
 
23
37
  - [#1180](https://github.com/ThrowTheSwitch/Ceedling/issues/1180) Fixed `gcovr` illegal `--exclude` flag when Gcovr configuration file in use.
24
38
  - [#1181](https://github.com/ThrowTheSwitch/Ceedling/issues/1181) Fixed linker error when test files contain no test cases (fix was implemented in Unity and vendored into Ceedling).
25
39
 
26
- Backlog bug fixes predating 1.1.0:
40
+ ### Backlog bug fixes predating 1.1.0
27
41
 
28
42
  - [#1064](https://github.com/ThrowTheSwitch/Ceedling/issues/1064) Fixed include guard handling that in a certain combination of preprocessing and CMock options led to duplicated symbols breaking a test build.
29
- - [#1098](https://github.com/ThrowTheSwitch/Ceedling/issues/1098) Fixed :test_compiler used instead of :test_assembler for assembly file.
43
+ - [#1098](https://github.com/ThrowTheSwitch/Ceedling/issues/1098) Fixed `:test_compiler` used instead of `:test_assembler` for assembly file.
30
44
  - [#1009](https://github.com/ThrowTheSwitch/Ceedling/issues/1009) Fixed tool name handling for `command_hooks` plugin.
31
45
 
32
46
  ## ⚠️ Changed
@@ -167,7 +167,9 @@ class CExtractorDeclarations
167
167
  # Verify this looks like a valid declaration
168
168
  # Must have at least a type and identifier
169
169
  # Can end with: word character, ], ), }, or " (for string initializers)
170
- if declaration =~ /\w+.*[\w\]\)\}"']\s*;$/
170
+ # `/m` flag: declaration may span multiple lines (e.g. a multiline brace
171
+ # initializer), so '.' must match embedded newlines too
172
+ if declaration =~ /\w+.*[\w\]\)\}"']\s*;$/m
171
173
  return [true, expand_and_parse(declaration)]
172
174
  else
173
175
  scanner.pos = start_pos
@@ -142,8 +142,9 @@ class CExtractorPreprocessing
142
142
  return [false, nil] unless success
143
143
  text << args
144
144
 
145
- # Consume optional whitespace before ';'
146
- text << (scanner.scan(/[ \t]*/) || '')
145
+ # Consume optional whitespace before ';' (including newlines, for statements formatted
146
+ # with the terminating ';' on its own line)
147
+ text << (scanner.scan(/\s*/) || '')
147
148
 
148
149
  # Consume the required terminating ';'
149
150
  return [false, nil] unless scanner.scan(/;/)
@@ -231,20 +232,32 @@ class CExtractorPreprocessing
231
232
 
232
233
  # Collect and return the full text of a preprocessing directive starting at '#'.
233
234
  # Returns nil if not positioned at '#'. Handles backslash-newline continuations.
235
+ # String/char literals are consumed verbatim via skip_c_string() so an in-string
236
+ # escape (e.g. "\n", "\"", "\\") is never mistaken for a line continuation.
234
237
  # Trailing whitespace and newlines are stripped from the returned text.
235
238
  def _collect_directive(scanner)
236
239
  return nil unless scanner.check(/#/)
237
240
 
238
241
  text = scanner.scan(/#/)
239
242
 
240
- loop do
241
- text += scanner.scan(/[^\n\\]*/) || ''
243
+ until scanner.eos?
244
+ text << (scanner.scan(/[^"'\\\n]*/) || '')
245
+
246
+ if (ch = scanner.peek(1)) == '"' || ch == "'"
247
+ before = scanner.pos
248
+ @c_extractor_code_text.skip_c_string(scanner, ch)
249
+ text << scanner.string[before...scanner.pos]
250
+
251
+ elsif scanner.scan(/\\\n/)
252
+ text << "\\\n"
242
253
 
243
- if scanner.scan(/\\\n/)
244
- text += "\\\n"
245
254
  elsif scanner.scan(/\n/)
246
- text += "\n"
255
+ text << "\n"
247
256
  break
257
+
258
+ elsif scanner.scan(/\\/)
259
+ text << '\\'
260
+
248
261
  else
249
262
  break # EOS — no trailing newline
250
263
  end
@@ -28,11 +28,15 @@ class GeneratorPartials
28
28
  header_filepath = File.join(output_path, header)
29
29
  source_filepath = File.join(output_path, source)
30
30
 
31
- @file_wrapper.open(header_filepath, 'w') do |file|
31
+ # Binary mode: the function bodies written below may already contain their
32
+ # own line endings verbatim. Windows text mode rewrites every "\n" on
33
+ # write, which would alter any line ending already present in that
34
+ # content instead of passing it through unchanged.
35
+ @file_wrapper.open(header_filepath, 'wb') do |file|
32
36
  generate_header(file, header, header_includes, function_definitions, c_module, true)
33
37
  end
34
38
 
35
- @file_wrapper.open(source_filepath, 'w') do |file|
39
+ @file_wrapper.open(source_filepath, 'wb') do |file|
36
40
  generate_source(file, source_includes, function_definitions, c_module)
37
41
  end
38
42
 
@@ -43,7 +47,8 @@ class GeneratorPartials
43
47
  header = @file_path_utils.form_partial_interface_header_filename(name)
44
48
  filepath = File.join(output_path, header)
45
49
 
46
- @file_wrapper.open(filepath, 'w') do |file|
50
+ # Binary mode: see generate_implementation above.
51
+ @file_wrapper.open(filepath, 'wb') do |file|
47
52
  generate_header(file, header, includes, function_declarations, c_module, false)
48
53
  end
49
54
 
@@ -149,6 +154,11 @@ class GeneratorPartials
149
154
  # Blank line before a function when preceded by a non-function item
150
155
  io << "\n" if anything_emitted && !last_was_func
151
156
  if func.line_num and func.source_filepath
157
+ # #line ties this generated file's code back to its original source
158
+ # location -- debuggers, error messages, and gcov coverage attribution
159
+ # all point at the real file/line instead of this generated stand-in.
160
+ # That mapping only holds if this file's line count matches what
161
+ # #line promises, which is why it's opened in binary mode above.
152
162
  io << "#line #{func.line_num} \"#{func.source_filepath}\"\n"
153
163
  end
154
164
  io << func.code_block << "\n\n"
@@ -288,6 +288,7 @@ preprocessinator_comment_stripper:
288
288
  preprocessinator_reconstructor:
289
289
  compose:
290
290
  - parsing_parcels
291
+ - file_wrapper
291
292
 
292
293
  preprocessinator:
293
294
  compose:
@@ -217,7 +217,11 @@ class PreprocessinatorFileAssembler
217
217
 
218
218
  # Write contents of final preprocessed file a line at a time
219
219
  # ----------------------------------------------------------
220
- @file_wrapper.open( preprocessed_filepath, 'w' ) do |file|
220
+ # Binary mode: `contents` lines below come from an upstream preprocessed
221
+ # file and may already carry their own line endings. Windows text mode
222
+ # rewrites "\n" on write, which would alter a line ending already present
223
+ # in that content instead of passing it through unchanged.
224
+ @file_wrapper.open( preprocessed_filepath, 'wb' ) do |file|
221
225
  # Add include guards and extra blank lines to beginning of file contents
222
226
  file << "#ifndef #{guardname}\n"
223
227
  file << "#define #{guardname}\n\n"
@@ -361,7 +365,11 @@ class PreprocessinatorFileAssembler
361
365
  def assemble_preprocessed_code_file(filename:, preprocessed_filepath:, contents:, extras:, includes:)
362
366
  # Write contents of final preprocessed file a line at a time
363
367
  # ----------------------------------------------------------
364
- @file_wrapper.open( preprocessed_filepath, 'w' ) do |file|
368
+ # Binary mode: `contents` lines below come from an upstream preprocessed
369
+ # file and may already carry their own line endings. Windows text mode
370
+ # rewrites "\n" on write, which would alter a line ending already present
371
+ # in that content instead of passing it through unchanged.
372
+ @file_wrapper.open( preprocessed_filepath, 'wb' ) do |file|
365
373
  # Reinsert #include statements into stripped down file
366
374
  # Rely on Include object stringification for formatting of incudes
367
375
  includes.each { |include| file << "#{include}\n" }
@@ -9,9 +9,9 @@ require 'ceedling/constants'
9
9
  require 'ceedling/encodinator'
10
10
  require 'ceedling/parsing_parcels'
11
11
 
12
- class PreprocessinatorReconstructor
13
-
14
- constructor :parsing_parcels
12
+ class PreprocessinatorReconstructor
13
+
14
+ constructor :parsing_parcels, :file_wrapper
15
15
 
16
16
  ##
17
17
  ## Preprocessor Expansion Output Handling
@@ -104,10 +104,13 @@ class PreprocessinatorReconstructor
104
104
  # Opens `input_filepath` for reading and `output_filepath` for writing,
105
105
  # then delegates to `compact_from_expansion` with the resulting IO objects.
106
106
  def compact_file_from_expansion(input_filepath:, source_filepath:, output_filepath:)
107
- # Open input in binary mode: GCC output under non-C locale contains non-ASCII bytes
108
- # (localized markers). Per-line clean_encoding in _scan_expansion_for_file handles content.
109
- File.open( input_filepath, 'rb' ) do |input|
110
- File.open( output_filepath, 'w' ) do |output|
107
+ # Binary mode on both ends: GCC output under non-C locale contains non-ASCII
108
+ # bytes (localized markers; per-line clean_encoding in _scan_expansion_for_file
109
+ # handles content), and the compacted output is read again downstream by code
110
+ # that depends on its line count being exact. Windows text mode would rewrite
111
+ # "\n" to "\r\n" on write, which this content must not be subject to.
112
+ @file_wrapper.open( input_filepath, 'rb' ) do |input|
113
+ @file_wrapper.open( output_filepath, 'wb' ) do |output|
111
114
  compact_from_expansion( input: input, filepath: source_filepath, output: output )
112
115
  end
113
116
  end
@@ -280,16 +283,21 @@ class PreprocessinatorReconstructor
280
283
 
281
284
  # Buffer for the last logical line (may still receive aggregated content)
282
285
  pending_line = nil
283
- # Whether a blank line should follow pending_line when flushed
284
- pending_blank = false
285
-
286
- # Yields pending_line (and optional trailing blank) then clears the buffer
286
+ # Count of blank lines to emit after pending_line when flushed. Tracked as
287
+ # an exact count, not just "was there a blank" -- callers that depend on
288
+ # this method for line-for-line fidelity with the original source (so
289
+ # that unrelated line-number math downstream stays correct) need every
290
+ # blank line preserved, including runs that used to be a multi-line
291
+ # comment before an earlier pass turned it into equivalent blank lines.
292
+ pending_blank_count = 0
293
+
294
+ # Yields pending_line (and any pending blank lines) then clears the buffer
287
295
  flush = lambda do
288
296
  unless pending_line.nil?
289
297
  block.call( pending_line )
290
- block.call( '' ) if pending_blank
298
+ pending_blank_count.times { block.call( '' ) }
291
299
  pending_line = nil
292
- pending_blank = false
300
+ pending_blank_count = 0
293
301
  end
294
302
  end
295
303
 
@@ -308,9 +316,9 @@ class PreprocessinatorReconstructor
308
316
  # Strip a line so we can omit useless blank lines
309
317
  _line = line.strip()
310
318
 
311
- # Skip processing blank lines, but mark a pending blank unless we already have one
319
+ # Skip processing blank lines, but track an exact count of them so runs of blanks survive intact
312
320
  if _line.empty?
313
- pending_blank = true if !pending_line.nil? && !pending_line.empty?
321
+ pending_blank_count += 1 if !pending_line.nil? && !pending_line.empty?
314
322
  next
315
323
  end
316
324
 
data/lib/version.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  module Ceedling
16
16
  module Version
17
17
  # Convenience constants for gem building, etc.
18
- GEM = '1.1.1'
18
+ GEM = '1.1.2'
19
19
  TAG = GEM
20
20
 
21
21
  # If run as a script print Ceedling's version to $stdout
Binary file
@@ -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