ceedling 1.1.5 → 1.1.6
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.
- checksums.yaml +4 -4
- data/GIT_COMMIT_SHA +1 -1
- data/assets/tests_with_conditional_includes/src/feature_config.h +13 -0
- data/assets/tests_with_conditional_includes/src/feature_extra.h +13 -0
- data/assets/tests_with_conditional_includes/src/local_flag_extra.h +13 -0
- data/assets/tests_with_conditional_includes/src/nested_extra.h +13 -0
- data/assets/tests_with_conditional_includes/src/nested_wrapper.h +16 -0
- data/assets/tests_with_conditional_includes/src/project_flag_extra.h +13 -0
- data/assets/tests_with_conditional_includes/src/widget.c +48 -0
- data/assets/tests_with_conditional_includes/src/widget.h +15 -0
- data/assets/tests_with_conditional_includes/src/widget_feature.c +29 -0
- data/assets/tests_with_conditional_includes/src/widget_feature.h +13 -0
- data/assets/tests_with_conditional_includes/test/test_widget.c +44 -0
- data/assets/tests_with_conditional_includes/test/test_widget_feature.c +31 -0
- data/docs/Changelog.md +20 -1
- data/examples/wondrous_forest/src/SensorHal.h +13 -0
- data/examples/wondrous_forest/src/TemperatureSensor.c +12 -5
- data/examples/wondrous_forest/src/TemperatureSensor.h +5 -4
- data/examples/wondrous_forest/test/TestTemperatureSensor.c +32 -3
- data/lib/ceedling/generators/generator_test_runner.rb +25 -1
- data/lib/ceedling/partials/partializer.rb +8 -1
- data/lib/ceedling/preprocess/preprocessinator.rb +22 -0
- data/lib/ceedling/preprocess/preprocessinator_includes_handler.rb +33 -0
- data/lib/version.rb +1 -1
- data/site-local/sitemap.xml.gz +0 -0
- data/spec/support/system/spec_system_helper.rb +11 -0
- data/spec/support/system/system_context.rb +18 -9
- data/spec/system/conditional_include_macro_visibility_spec.rb +152 -0
- data/spec/system/encoding_stress_spec.rb +4 -4
- data/spec/system/example_wondrous_forest_spec.rb +2 -2
- data/spec/system/support/common_test_cases.rb +5 -1
- data/spec/system/test_runner_system_include_spec.rb +90 -0
- data/spec/units/generators/generator_test_runner_spec.rb +69 -0
- data/spec/units/partials/partializer_spec.rb +69 -0
- data/spec/units/preprocess/preprocessinator_includes_handler_spec.rb +61 -0
- data/spec/units/preprocess/preprocessinator_spec.rb +136 -0
- data/vendor/c_exception/lib/CException.h +1 -1
- data/vendor/c_exception/project.yml +2 -2
- data/vendor/c_exception/test/TestException.c +1 -1
- data/vendor/c_exception/test/support/CExceptionConfig.h +5 -11
- data/vendor/cmock/docs/CMockChangeLog.md +23 -22
- data/vendor/cmock/scripts/create_makefile.rb +4 -3
- data/vendor/cmock/src/cmock.h +1 -1
- data/vendor/cmock/vendor/c_exception/lib/CException.h +1 -1
- data/vendor/cmock/vendor/c_exception/project.yml +2 -2
- data/vendor/cmock/vendor/c_exception/test/TestException.c +1 -1
- data/vendor/cmock/vendor/c_exception/test/support/CExceptionConfig.h +5 -11
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +85 -29
- data/vendor/cmock/vendor/unity/docs/UnityChangeLog.md +1 -0
- data/vendor/cmock/vendor/unity/examples/unity_config.h +8 -0
- data/vendor/cmock/vendor/unity/src/unity.c +9 -1
- data/vendor/cmock/vendor/unity/src/unity.h +1 -1
- data/vendor/cmock/vendor/unity/test/rakefile +2 -1
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorEmpty.c +13 -0
- data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +31 -0
- data/vendor/unity/auto/generate_test_runner.rb +63 -57
- data/vendor/unity/docs/UnityChangeLog.md +1 -0
- data/vendor/unity/examples/unity_config.h +8 -0
- data/vendor/unity/src/unity.c +9 -1
- data/vendor/unity/src/unity.h +1 -1
- data/vendor/unity/test/rakefile +2 -1
- data/vendor/unity/test/tests/test_generate_test_runner.rb +20 -0
- metadata +21 -3
- data/vendor/cmock/vendor/unity/auto/run_test.erb +0 -37
|
@@ -336,6 +336,17 @@ RUNNER_TESTS = [
|
|
|
336
336
|
},
|
|
337
337
|
|
|
338
338
|
|
|
339
|
+
{ :name => 'EmptyFileWarning',
|
|
340
|
+
:testfile => 'testdata/testRunnerGeneratorEmpty.c',
|
|
341
|
+
:testdefines => ['TEST'],
|
|
342
|
+
:options => nil, #defaults
|
|
343
|
+
:expected => {
|
|
344
|
+
:to_pass => [ ],
|
|
345
|
+
:to_fail => [ ],
|
|
346
|
+
:to_ignore => [ 'test_empty_warning' ],
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
|
|
339
350
|
#### WITH MOCKS ##########################################
|
|
340
351
|
|
|
341
352
|
{ :name => 'DefaultsThroughOptions',
|
|
@@ -1303,6 +1314,26 @@ def verify_number(expected, expression, output)
|
|
|
1303
1314
|
end
|
|
1304
1315
|
end
|
|
1305
1316
|
|
|
1317
|
+
should 'GenerateSuiteTeardownWhenBeginAndEndAreOmitted' do
|
|
1318
|
+
runner_name = OUT_FILE + 'SuiteTeardownWithoutBeginEnd_runner.c'
|
|
1319
|
+
UnityTestRunnerGenerator.new(
|
|
1320
|
+
:test_prefix => 'test',
|
|
1321
|
+
:suite_teardown => ' return num_failures;',
|
|
1322
|
+
:omit_begin_end => true,
|
|
1323
|
+
).run('testdata/testRunnerGenerator.c', runner_name)
|
|
1324
|
+
|
|
1325
|
+
runner = File.read(runner_name)
|
|
1326
|
+
correct_call = runner.include?('(void) suiteTearDown(0);')
|
|
1327
|
+
incorrect_call = runner.include?('(void) suite_teardown(0);')
|
|
1328
|
+
if correct_call && !incorrect_call
|
|
1329
|
+
report 'Runner_GenerateSuiteTeardownWhenBeginAndEndAreOmitted:PASS'
|
|
1330
|
+
else
|
|
1331
|
+
report 'Runner_GenerateSuiteTeardownWhenBeginAndEndAreOmitted:FAIL'
|
|
1332
|
+
$generate_test_runner_failures += 1
|
|
1333
|
+
end
|
|
1334
|
+
$generate_test_runner_tests += 1
|
|
1335
|
+
end
|
|
1336
|
+
|
|
1306
1337
|
RUNNER_TESTS.each do |testset|
|
|
1307
1338
|
basename = File.basename(testset[:testfile], C_EXTENSION)
|
|
1308
1339
|
testset_name = "Runner_#{basename}_#{testset[:name]}"
|
|
@@ -71,24 +71,30 @@ class UnityTestRunnerGenerator
|
|
|
71
71
|
source = File.read(input_file)
|
|
72
72
|
source = source.force_encoding('ISO-8859-1').encode('utf-8', replace: nil)
|
|
73
73
|
tests = find_tests(source)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
used_mocks = find_mocks(
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
includes = find_includes(source)
|
|
75
|
+
headers = includes[:headers]
|
|
76
|
+
used_mocks = find_mocks(headers)
|
|
77
|
+
headers = (headers - used_mocks)
|
|
78
|
+
headers.delete_if { |inc| inc =~ /(unity|cmock)/ }
|
|
79
79
|
find_setup_and_teardown(source)
|
|
80
80
|
|
|
81
81
|
# build runner file
|
|
82
|
-
generate(input_file, output_file, tests, used_mocks,
|
|
82
|
+
generate(input_file, output_file, tests, used_mocks, headers)
|
|
83
83
|
|
|
84
84
|
# determine which files were used to return them
|
|
85
85
|
all_files_used = [input_file, output_file]
|
|
86
|
-
all_files_used +=
|
|
86
|
+
all_files_used += headers.reject { |filename| filename =~ /^</ }.map { |filename| "#{filename}.c" } unless headers.empty?
|
|
87
87
|
all_files_used += @options[:includes] unless @options[:includes].empty?
|
|
88
|
-
all_files_used +=
|
|
88
|
+
all_files_used += includes[:linkonly] unless includes[:linkonly].empty?
|
|
89
89
|
all_files_used.uniq
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
+
# Generate a test file for the given features:
|
|
93
|
+
# input_file - the name of the test file this is based on
|
|
94
|
+
# output_file - the name of the test runner file to generate
|
|
95
|
+
# tests - an array of all the tests which can be run from this test runner
|
|
96
|
+
# used_mocks - an array of all mock files which are used by this test runner
|
|
97
|
+
# testfile_includes - an array of all included headers, in order, where system headers still have their <> attached
|
|
92
98
|
def generate(input_file, output_file, tests, used_mocks, testfile_includes)
|
|
93
99
|
File.open(output_file, 'w') do |output|
|
|
94
100
|
create_header(output, used_mocks, testfile_includes)
|
|
@@ -110,7 +116,7 @@ class UnityTestRunnerGenerator
|
|
|
110
116
|
return unless @options[:header_file] && !@options[:header_file].empty?
|
|
111
117
|
|
|
112
118
|
File.open(@options[:header_file], 'w') do |output|
|
|
113
|
-
create_h_file(output, @options[:header_file], tests,
|
|
119
|
+
create_h_file(output, @options[:header_file], tests, headers, used_mocks)
|
|
114
120
|
end
|
|
115
121
|
end
|
|
116
122
|
|
|
@@ -212,10 +218,14 @@ class UnityTestRunnerGenerator
|
|
|
212
218
|
source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
|
|
213
219
|
source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
|
|
214
220
|
|
|
215
|
-
# parse out includes
|
|
221
|
+
# parse out includes (NOTICE: system includes KEEP the angle-brackets in the string, to preserve this information)
|
|
222
|
+
headers = if @options[:use_system_files]
|
|
223
|
+
source.scan(/^\s*#include\s+(?:(<)|")\s*(.+\.#{@options[:include_extensions]})\s*(?:(>)|")/).map(&:join).flatten
|
|
224
|
+
else
|
|
225
|
+
source.scan(/^\s*#include\s+"\s*(.+\.#{@options[:include_extensions]})\s*"/).flatten
|
|
226
|
+
end
|
|
216
227
|
{
|
|
217
|
-
|
|
218
|
-
system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" },
|
|
228
|
+
headers: headers,
|
|
219
229
|
linkonly: source.scan(/^TEST_SOURCE_FILE\(\s*"\s*(.+\.#{@options[:source_extensions]})\s*"/).flatten
|
|
220
230
|
}
|
|
221
231
|
end
|
|
@@ -252,7 +262,7 @@ class UnityTestRunnerGenerator
|
|
|
252
262
|
end
|
|
253
263
|
end
|
|
254
264
|
|
|
255
|
-
def create_header(output, mocks,
|
|
265
|
+
def create_header(output, mocks, headers = [])
|
|
256
266
|
output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
|
|
257
267
|
output.puts("\n/*=======Automagically Detected Files To Include=====*/")
|
|
258
268
|
output.puts('extern "C" {') if @options[:externcincludes]
|
|
@@ -275,10 +285,7 @@ class UnityTestRunnerGenerator
|
|
|
275
285
|
if @options[:header_file] && !@options[:header_file].empty?
|
|
276
286
|
output.puts("#include \"#{File.basename(@options[:header_file])}\"")
|
|
277
287
|
else
|
|
278
|
-
@options[:includes].flatten.uniq.compact.each do |inc|
|
|
279
|
-
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}")
|
|
280
|
-
end
|
|
281
|
-
testfile_includes.each do |inc|
|
|
288
|
+
[@options[:includes], headers].flatten.uniq.compact.each do |inc|
|
|
282
289
|
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}")
|
|
283
290
|
end
|
|
284
291
|
end
|
|
@@ -407,43 +414,43 @@ class UnityTestRunnerGenerator
|
|
|
407
414
|
end
|
|
408
415
|
|
|
409
416
|
def create_run_test(output)
|
|
410
|
-
output.puts(
|
|
411
|
-
output.puts(
|
|
412
|
-
output.puts(
|
|
413
|
-
output.puts(
|
|
414
|
-
output.puts(
|
|
415
|
-
output.puts(
|
|
416
|
-
output.puts(
|
|
417
|
-
output.puts(
|
|
418
|
-
output.puts(
|
|
419
|
-
output.puts(
|
|
420
|
-
output.puts(
|
|
421
|
-
output.puts(
|
|
422
|
-
output.puts(
|
|
423
|
-
output.puts(
|
|
424
|
-
output.puts(
|
|
417
|
+
output.puts('/*=======Test Runner Used To Run Each Test=====*/')
|
|
418
|
+
output.puts('static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)')
|
|
419
|
+
output.puts('{')
|
|
420
|
+
output.puts(' Unity.CurrentTestName = name;')
|
|
421
|
+
output.puts(' Unity.CurrentTestLineNumber = (UNITY_UINT) line_num;')
|
|
422
|
+
output.puts('#ifdef UNITY_USE_COMMAND_LINE_ARGS')
|
|
423
|
+
output.puts(' if (!UnityTestMatches())')
|
|
424
|
+
output.puts(' return;')
|
|
425
|
+
output.puts('#endif')
|
|
426
|
+
output.puts(' Unity.NumberOfTests++;')
|
|
427
|
+
output.puts(' UNITY_CLR_DETAILS();')
|
|
428
|
+
output.puts(' UNITY_EXEC_TIME_START();')
|
|
429
|
+
output.puts(' CMock_Init();')
|
|
430
|
+
output.puts(' if (TEST_PROTECT())')
|
|
431
|
+
output.puts(' {')
|
|
425
432
|
if @options[:plugins].include?(:cexception)
|
|
426
|
-
output.puts(
|
|
427
|
-
output.puts(
|
|
433
|
+
output.puts(' volatile CEXCEPTION_T e;')
|
|
434
|
+
output.puts(' Try {')
|
|
428
435
|
output.puts(" #{@options[:setup_name]}();")
|
|
429
|
-
output.puts(
|
|
430
|
-
output.puts(
|
|
431
|
-
output.puts(
|
|
432
|
-
output.puts(
|
|
436
|
+
output.puts(' func();')
|
|
437
|
+
output.puts(' } Catch(e) {')
|
|
438
|
+
output.puts(' TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!");')
|
|
439
|
+
output.puts(' }')
|
|
433
440
|
else
|
|
434
441
|
output.puts(" #{@options[:setup_name]}();")
|
|
435
|
-
output.puts(
|
|
442
|
+
output.puts(' func();')
|
|
436
443
|
end
|
|
437
|
-
output.puts(
|
|
438
|
-
output.puts(
|
|
439
|
-
output.puts(
|
|
444
|
+
output.puts(' }')
|
|
445
|
+
output.puts(' if (TEST_PROTECT())')
|
|
446
|
+
output.puts(' {')
|
|
440
447
|
output.puts(" #{@options[:teardown_name]}();")
|
|
441
|
-
output.puts(
|
|
442
|
-
output.puts(
|
|
443
|
-
output.puts(
|
|
444
|
-
output.puts(
|
|
445
|
-
output.puts(
|
|
446
|
-
output.puts(
|
|
448
|
+
output.puts(' CMock_Verify();')
|
|
449
|
+
output.puts(' }')
|
|
450
|
+
output.puts(' CMock_Destroy();')
|
|
451
|
+
output.puts(' UNITY_EXEC_TIME_STOP();')
|
|
452
|
+
output.puts(' UnityConcludeTest();')
|
|
453
|
+
output.puts('}')
|
|
447
454
|
end
|
|
448
455
|
|
|
449
456
|
def create_args_wrappers(output, tests)
|
|
@@ -465,7 +472,7 @@ class UnityTestRunnerGenerator
|
|
|
465
472
|
def create_warning_test(output, filename, tests)
|
|
466
473
|
if count_tests(tests) == 0
|
|
467
474
|
warning_test = {
|
|
468
|
-
:test =>
|
|
475
|
+
:test => 'test_empty_warning',
|
|
469
476
|
:line_number => 0
|
|
470
477
|
}
|
|
471
478
|
output.puts("\n/*=======Warning Test=====*/")
|
|
@@ -475,7 +482,7 @@ class UnityTestRunnerGenerator
|
|
|
475
482
|
output.puts("}\n")
|
|
476
483
|
tests = [warning_test]
|
|
477
484
|
end
|
|
478
|
-
|
|
485
|
+
tests
|
|
479
486
|
end
|
|
480
487
|
|
|
481
488
|
def create_shuffle_tests(output)
|
|
@@ -503,13 +510,15 @@ class UnityTestRunnerGenerator
|
|
|
503
510
|
end
|
|
504
511
|
output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)")
|
|
505
512
|
output.puts('{')
|
|
513
|
+
output.puts('(void)argc;')
|
|
514
|
+
output.puts('(void)argv;')
|
|
506
515
|
output.puts('#ifdef UNITY_USE_COMMAND_LINE_ARGS')
|
|
507
516
|
output.puts(' int parse_status = UnityParseOptions(argc, argv);')
|
|
508
517
|
output.puts(' if (parse_status != 0)')
|
|
509
518
|
output.puts(' {')
|
|
510
519
|
output.puts(' if (parse_status < 0)')
|
|
511
520
|
output.puts(' {')
|
|
512
|
-
output.puts(" UnityPrint(\"#{filename.gsub(
|
|
521
|
+
output.puts(" UnityPrint(\"#{filename.gsub(/\\/, '\\\\\\')}\");")
|
|
513
522
|
output.puts(' UNITY_PRINT_EOL();')
|
|
514
523
|
tests.each do |test|
|
|
515
524
|
if !@options[:use_param_tests] || test[:args].nil? || test[:args].empty?
|
|
@@ -583,7 +592,7 @@ class UnityTestRunnerGenerator
|
|
|
583
592
|
output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty?
|
|
584
593
|
if @options[:has_suite_teardown]
|
|
585
594
|
if @options[:omit_begin_end]
|
|
586
|
-
output.puts(' (void)
|
|
595
|
+
output.puts(' (void) suiteTearDown(0);')
|
|
587
596
|
else
|
|
588
597
|
output.puts(' return suiteTearDown(UNITY_END());')
|
|
589
598
|
end
|
|
@@ -593,17 +602,14 @@ class UnityTestRunnerGenerator
|
|
|
593
602
|
output.puts('}')
|
|
594
603
|
end
|
|
595
604
|
|
|
596
|
-
def create_h_file(output, filename, tests,
|
|
605
|
+
def create_h_file(output, filename, tests, headers, used_mocks)
|
|
597
606
|
filename = File.basename(filename).gsub(/[-\/\\.,\s]/, '_').upcase
|
|
598
607
|
output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
|
|
599
608
|
output.puts("#ifndef _#{filename}")
|
|
600
609
|
output.puts("#define _#{filename}\n\n")
|
|
601
610
|
output.puts("#include \"#{@options[:framework]}.h\"")
|
|
602
611
|
output.puts('#include "cmock.h"') unless used_mocks.empty?
|
|
603
|
-
@options[:includes].flatten.uniq.compact.each do |inc|
|
|
604
|
-
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}")
|
|
605
|
-
end
|
|
606
|
-
testfile_includes.each do |inc|
|
|
612
|
+
[@options[:includes], headers].flatten.uniq.compact.each do |inc|
|
|
607
613
|
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc}\""}")
|
|
608
614
|
end
|
|
609
615
|
output.puts "\n"
|
|
@@ -29,6 +29,7 @@ Significant Bugfixes:
|
|
|
29
29
|
- display of failures fixed on ARM processors, particularly with arrays (#807)
|
|
30
30
|
- fixed each-equal assertion for memory (#797)
|
|
31
31
|
- fix many warnings.
|
|
32
|
+
- Test runner generator calls custom suite teardown when begin/end calls are omitted. @94xhn
|
|
32
33
|
|
|
33
34
|
Other:
|
|
34
35
|
|
|
@@ -250,4 +250,12 @@
|
|
|
250
250
|
*/
|
|
251
251
|
/* #define UNITY_INCLUDE_EXEC_TIME */
|
|
252
252
|
|
|
253
|
+
/* Define this macro to redefine what the UnityPrintChar() function considers
|
|
254
|
+
* a printable character.
|
|
255
|
+
*
|
|
256
|
+
* Example, for printing UTF-8:
|
|
257
|
+
* #define UNITY_IS_PRINTABLE_CHAR(c) ((128 <= (c)) && ((c) <= 255))
|
|
258
|
+
*/
|
|
259
|
+
/* #define UNITY_IS_PRINTABLE_CHAR(c) ((32 <= (c)) && ((c) <= 126)) */
|
|
260
|
+
|
|
253
261
|
#endif /* UNITY_CONFIG_H */
|
data/vendor/unity/src/unity.c
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#include "unity.h"
|
|
9
9
|
|
|
10
|
+
#include <stdbool.h>
|
|
11
|
+
|
|
10
12
|
#ifndef UNITY_PROGMEM
|
|
11
13
|
#define UNITY_PROGMEM
|
|
12
14
|
#endif
|
|
@@ -88,8 +90,14 @@ static const char UNITY_PROGMEM UnityStrDetail2Name[] = " " UNITY_DET
|
|
|
88
90
|
/* Local helper function to print characters. */
|
|
89
91
|
static void UnityPrintChar(const char* pch)
|
|
90
92
|
{
|
|
93
|
+
#ifdef UNITY_IS_PRINTABLE_CHAR
|
|
94
|
+
const int isPrintable = UNITY_IS_PRINTABLE_CHAR(*pch);
|
|
95
|
+
#else
|
|
96
|
+
const int isPrintable = ((32 <= *pch) && (*pch <= 126));
|
|
97
|
+
#endif
|
|
98
|
+
|
|
91
99
|
/* printable characters plus CR & LF are printed */
|
|
92
|
-
if (
|
|
100
|
+
if (isPrintable)
|
|
93
101
|
{
|
|
94
102
|
UNITY_OUTPUT_CHAR(*pch);
|
|
95
103
|
}
|
data/vendor/unity/src/unity.h
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
#define UNITY_VERSION_MAJOR 2
|
|
13
13
|
#define UNITY_VERSION_MINOR 7
|
|
14
|
-
#define UNITY_VERSION_BUILD
|
|
14
|
+
#define UNITY_VERSION_BUILD 2
|
|
15
15
|
#define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD)
|
|
16
16
|
|
|
17
17
|
#ifdef __cplusplus
|
data/vendor/unity/test/rakefile
CHANGED
|
@@ -19,6 +19,7 @@ TEMP_DIRS = [
|
|
|
19
19
|
|
|
20
20
|
TEMP_DIRS.each do |dir|
|
|
21
21
|
directory(dir)
|
|
22
|
+
CLEAN.include(File.join(dir, '*.*'))
|
|
22
23
|
CLOBBER.include(dir)
|
|
23
24
|
end
|
|
24
25
|
|
|
@@ -167,7 +168,7 @@ namespace :style do
|
|
|
167
168
|
|
|
168
169
|
desc "Attempt to Autocorrect style"
|
|
169
170
|
task :auto => ['style:clean'] do
|
|
170
|
-
execute("rubocop ../auto ../examples ../extras --
|
|
171
|
+
execute("rubocop ../auto ../examples ../extras --autocorrect --config .rubocop.yml")
|
|
171
172
|
report "Autocorrected What We Could."
|
|
172
173
|
end
|
|
173
174
|
|
|
@@ -1314,6 +1314,26 @@ def verify_number(expected, expression, output)
|
|
|
1314
1314
|
end
|
|
1315
1315
|
end
|
|
1316
1316
|
|
|
1317
|
+
should 'GenerateSuiteTeardownWhenBeginAndEndAreOmitted' do
|
|
1318
|
+
runner_name = OUT_FILE + 'SuiteTeardownWithoutBeginEnd_runner.c'
|
|
1319
|
+
UnityTestRunnerGenerator.new(
|
|
1320
|
+
:test_prefix => 'test',
|
|
1321
|
+
:suite_teardown => ' return num_failures;',
|
|
1322
|
+
:omit_begin_end => true,
|
|
1323
|
+
).run('testdata/testRunnerGenerator.c', runner_name)
|
|
1324
|
+
|
|
1325
|
+
runner = File.read(runner_name)
|
|
1326
|
+
correct_call = runner.include?('(void) suiteTearDown(0);')
|
|
1327
|
+
incorrect_call = runner.include?('(void) suite_teardown(0);')
|
|
1328
|
+
if correct_call && !incorrect_call
|
|
1329
|
+
report 'Runner_GenerateSuiteTeardownWhenBeginAndEndAreOmitted:PASS'
|
|
1330
|
+
else
|
|
1331
|
+
report 'Runner_GenerateSuiteTeardownWhenBeginAndEndAreOmitted:FAIL'
|
|
1332
|
+
$generate_test_runner_failures += 1
|
|
1333
|
+
end
|
|
1334
|
+
$generate_test_runner_tests += 1
|
|
1335
|
+
end
|
|
1336
|
+
|
|
1317
1337
|
RUNNER_TESTS.each do |testset|
|
|
1318
1338
|
basename = File.basename(testset[:testfile], C_EXTENSION)
|
|
1319
1339
|
testset_name = "Runner_#{basename}_#{testset[:name]}"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ceedling
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark VanderVoord
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2026-08-
|
|
13
|
+
date: 2026-08-25 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rake
|
|
@@ -203,6 +203,18 @@ files:
|
|
|
203
203
|
- assets/test_example_with_parameterized_tests.c
|
|
204
204
|
- assets/test_partial_all_module.c
|
|
205
205
|
- assets/test_same_dir_pairing.c
|
|
206
|
+
- assets/tests_with_conditional_includes/src/feature_config.h
|
|
207
|
+
- assets/tests_with_conditional_includes/src/feature_extra.h
|
|
208
|
+
- assets/tests_with_conditional_includes/src/local_flag_extra.h
|
|
209
|
+
- assets/tests_with_conditional_includes/src/nested_extra.h
|
|
210
|
+
- assets/tests_with_conditional_includes/src/nested_wrapper.h
|
|
211
|
+
- assets/tests_with_conditional_includes/src/project_flag_extra.h
|
|
212
|
+
- assets/tests_with_conditional_includes/src/widget.c
|
|
213
|
+
- assets/tests_with_conditional_includes/src/widget.h
|
|
214
|
+
- assets/tests_with_conditional_includes/src/widget_feature.c
|
|
215
|
+
- assets/tests_with_conditional_includes/src/widget_feature.h
|
|
216
|
+
- assets/tests_with_conditional_includes/test/test_widget.c
|
|
217
|
+
- assets/tests_with_conditional_includes/test/test_widget_feature.c
|
|
206
218
|
- assets/tests_with_defines/src/adc_hardware.c
|
|
207
219
|
- assets/tests_with_defines/src/adc_hardware.h
|
|
208
220
|
- assets/tests_with_defines/src/adc_hardware_configurator.c
|
|
@@ -923,6 +935,7 @@ files:
|
|
|
923
935
|
- spec/support/test_example_ignore.pass
|
|
924
936
|
- spec/support/test_example_mangled.pass
|
|
925
937
|
- spec/support/test_example_with_time.pass
|
|
938
|
+
- spec/system/conditional_include_macro_visibility_spec.rb
|
|
926
939
|
- spec/system/cppcheck_deployment_spec.rb
|
|
927
940
|
- spec/system/deployment_as_gem_spec.rb
|
|
928
941
|
- spec/system/deployment_as_vendor_spec.rb
|
|
@@ -945,6 +958,7 @@ files:
|
|
|
945
958
|
- spec/system/support/gcov_partials_test_cases.rb
|
|
946
959
|
- spec/system/support/valgrind_common_test_cases.rb
|
|
947
960
|
- spec/system/support/valgrind_helpers.rb
|
|
961
|
+
- spec/system/test_runner_system_include_spec.rb
|
|
948
962
|
- spec/system/upgrade_as_vendor_spec.rb
|
|
949
963
|
- spec/system/valgrind_deployment_spec.rb
|
|
950
964
|
- spec/units/bin/cli_helper_spec.rb
|
|
@@ -990,6 +1004,7 @@ files:
|
|
|
990
1004
|
- spec/units/preprocess/preprocessinator_file_assembler_spec.rb
|
|
991
1005
|
- spec/units/preprocess/preprocessinator_includes_handler_spec.rb
|
|
992
1006
|
- spec/units/preprocess/preprocessinator_reconstructor_spec.rb
|
|
1007
|
+
- spec/units/preprocess/preprocessinator_spec.rb
|
|
993
1008
|
- spec/units/reportinator_spec.rb
|
|
994
1009
|
- spec/units/ruby_expandinator_spec.rb
|
|
995
1010
|
- spec/units/system_utils_spec.rb
|
|
@@ -1306,7 +1321,6 @@ files:
|
|
|
1306
1321
|
- vendor/cmock/vendor/unity/auto/generate_module.rb
|
|
1307
1322
|
- vendor/cmock/vendor/unity/auto/generate_test_runner.rb
|
|
1308
1323
|
- vendor/cmock/vendor/unity/auto/parse_output.rb
|
|
1309
|
-
- vendor/cmock/vendor/unity/auto/run_test.erb
|
|
1310
1324
|
- vendor/cmock/vendor/unity/auto/stylize_as_junit.py
|
|
1311
1325
|
- vendor/cmock/vendor/unity/auto/stylize_as_junit.rb
|
|
1312
1326
|
- vendor/cmock/vendor/unity/auto/test_file_filter.rb
|
|
@@ -1449,6 +1463,7 @@ files:
|
|
|
1449
1463
|
- vendor/cmock/vendor/unity/test/testdata/cmock.h
|
|
1450
1464
|
- vendor/cmock/vendor/unity/test/testdata/mockMock.h
|
|
1451
1465
|
- vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c
|
|
1466
|
+
- vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorEmpty.c
|
|
1452
1467
|
- vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c
|
|
1453
1468
|
- vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c
|
|
1454
1469
|
- vendor/cmock/vendor/unity/test/tests/self_assessment_utils.h
|
|
@@ -1771,6 +1786,7 @@ test_files:
|
|
|
1771
1786
|
- spec/support/test_example_ignore.pass
|
|
1772
1787
|
- spec/support/test_example_mangled.pass
|
|
1773
1788
|
- spec/support/test_example_with_time.pass
|
|
1789
|
+
- spec/system/conditional_include_macro_visibility_spec.rb
|
|
1774
1790
|
- spec/system/cppcheck_deployment_spec.rb
|
|
1775
1791
|
- spec/system/deployment_as_gem_spec.rb
|
|
1776
1792
|
- spec/system/deployment_as_vendor_spec.rb
|
|
@@ -1793,6 +1809,7 @@ test_files:
|
|
|
1793
1809
|
- spec/system/support/gcov_partials_test_cases.rb
|
|
1794
1810
|
- spec/system/support/valgrind_common_test_cases.rb
|
|
1795
1811
|
- spec/system/support/valgrind_helpers.rb
|
|
1812
|
+
- spec/system/test_runner_system_include_spec.rb
|
|
1796
1813
|
- spec/system/upgrade_as_vendor_spec.rb
|
|
1797
1814
|
- spec/system/valgrind_deployment_spec.rb
|
|
1798
1815
|
- spec/units/bin/cli_helper_spec.rb
|
|
@@ -1838,6 +1855,7 @@ test_files:
|
|
|
1838
1855
|
- spec/units/preprocess/preprocessinator_file_assembler_spec.rb
|
|
1839
1856
|
- spec/units/preprocess/preprocessinator_includes_handler_spec.rb
|
|
1840
1857
|
- spec/units/preprocess/preprocessinator_reconstructor_spec.rb
|
|
1858
|
+
- spec/units/preprocess/preprocessinator_spec.rb
|
|
1841
1859
|
- spec/units/reportinator_spec.rb
|
|
1842
1860
|
- spec/units/ruby_expandinator_spec.rb
|
|
1843
1861
|
- spec/units/system_utils_spec.rb
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*=======Test Runner Used To Run Each Test=====*/
|
|
2
|
-
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
|
|
3
|
-
{
|
|
4
|
-
Unity.CurrentTestName = name;
|
|
5
|
-
Unity.CurrentTestLineNumber = (UNITY_UINT) line_num;
|
|
6
|
-
#ifdef UNITY_USE_COMMAND_LINE_ARGS
|
|
7
|
-
if (!UnityTestMatches())
|
|
8
|
-
return;
|
|
9
|
-
#endif
|
|
10
|
-
Unity.NumberOfTests++;
|
|
11
|
-
UNITY_CLR_DETAILS();
|
|
12
|
-
UNITY_EXEC_TIME_START();
|
|
13
|
-
CMock_Init();
|
|
14
|
-
if (TEST_PROTECT())
|
|
15
|
-
{
|
|
16
|
-
<% if @options[:plugins].include?(:cexception) %>
|
|
17
|
-
volatile CEXCEPTION_T e;
|
|
18
|
-
Try {
|
|
19
|
-
<%= @options[:setup_name] %>();
|
|
20
|
-
func();
|
|
21
|
-
} Catch(e) {
|
|
22
|
-
TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!");
|
|
23
|
-
}
|
|
24
|
-
<% else %>
|
|
25
|
-
<%= @options[:setup_name] %>();
|
|
26
|
-
func();
|
|
27
|
-
<% end %>
|
|
28
|
-
}
|
|
29
|
-
if (TEST_PROTECT())
|
|
30
|
-
{
|
|
31
|
-
<%= @options[:teardown_name] %>();
|
|
32
|
-
CMock_Verify();
|
|
33
|
-
}
|
|
34
|
-
CMock_Destroy();
|
|
35
|
-
UNITY_EXEC_TIME_STOP();
|
|
36
|
-
UnityConcludeTest();
|
|
37
|
-
}
|