ceedling 0.31.0 → 0.31.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/assets/example_file_call.c +6 -0
  3. data/assets/example_file_call.h +6 -0
  4. data/assets/test_example_file_with_mock.c +13 -0
  5. data/bin/ceedling +2 -2
  6. data/ceedling.gemspec +1 -1
  7. data/lib/ceedling/configurator.rb +7 -2
  8. data/lib/ceedling/configurator_plugins.rb +21 -1
  9. data/lib/ceedling/defaults.rb +1 -0
  10. data/lib/ceedling/preprocessinator_extractor.rb +2 -0
  11. data/lib/ceedling/preprocessinator_includes_handler.rb +24 -24
  12. data/lib/ceedling/version.rb +11 -7
  13. data/plugins/gcov/config/defaults_gcov.rb +118 -0
  14. data/plugins/gcov/lib/gcovr_reportinator.rb +1 -1
  15. data/plugins/gcov/lib/reportgenerator_reportinator.rb +1 -1
  16. data/plugins/junit_tests_report/lib/junit_tests_report.rb +6 -6
  17. data/plugins/module_generator/README.md +16 -2
  18. data/plugins/module_generator/lib/module_generator.rb +1 -0
  19. data/spec/gcov/gcov_deployment_spec.rb +1 -1
  20. data/spec/preprocessinator_includes_handler_spec.rb +38 -8
  21. data/spec/spec_system_helper.rb +19 -0
  22. data/spec/system/deployment_spec.rb +1 -0
  23. data/vendor/cmock/lib/cmock_file_writer.rb +2 -3
  24. data/vendor/cmock/lib/cmock_generator.rb +87 -70
  25. data/vendor/cmock/lib/cmock_header_parser.rb +29 -27
  26. data/vendor/cmock/src/cmock.h +1 -1
  27. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +46 -41
  28. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +46 -40
  29. data/vendor/cmock/vendor/c_exception/README.md +6 -4
  30. data/vendor/cmock/vendor/c_exception/docs/CException.md +2 -2
  31. data/vendor/cmock/vendor/c_exception/lib/CException.h +1 -1
  32. data/vendor/cmock/vendor/c_exception/lib/meson.build +2 -2
  33. data/vendor/cmock/vendor/c_exception/meson.build +36 -2
  34. data/vendor/cmock/vendor/unity/README.md +77 -71
  35. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +1 -1
  36. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +107 -126
  37. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +149 -193
  38. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +236 -294
  39. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +112 -121
  40. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +82 -115
  41. data/vendor/cmock/vendor/unity/extras/fixture/readme.md +16 -19
  42. data/vendor/cmock/vendor/unity/extras/memory/readme.md +27 -34
  43. data/vendor/cmock/vendor/unity/src/unity.c +1 -1
  44. data/vendor/cmock/vendor/unity/src/unity.h +1 -1
  45. data/vendor/cmock/vendor/unity/src/unity_internals.h +21 -7
  46. data/vendor/unity/README.md +77 -71
  47. data/vendor/unity/auto/generate_test_runner.rb +1 -1
  48. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +107 -126
  49. data/vendor/unity/docs/UnityAssertionsReference.md +149 -193
  50. data/vendor/unity/docs/UnityConfigurationGuide.md +236 -294
  51. data/vendor/unity/docs/UnityGettingStartedGuide.md +112 -121
  52. data/vendor/unity/docs/UnityHelperScriptsGuide.md +82 -115
  53. data/vendor/unity/extras/fixture/readme.md +16 -19
  54. data/vendor/unity/extras/memory/readme.md +27 -34
  55. data/vendor/unity/src/unity.c +1 -1
  56. data/vendor/unity/src/unity.h +1 -1
  57. data/vendor/unity/src/unity_internals.h +21 -7
  58. metadata +14 -5
  59. data/plugins/gcov/config/defaults.yml +0 -55
@@ -1,29 +1,26 @@
1
1
  # Unity Fixtures
2
2
 
3
- This Framework is an optional add-on to Unity. By including unity_framework.h in place of unity.h,
4
- you may now work with Unity in a manner similar to CppUTest. This framework adds the concepts of
5
- test groups and gives finer control of your tests over the command line.
3
+ This Framework is an optional add-on to Unity.
4
+ By including unity_framework.h in place of unity.h, you may now work with Unity in a manner similar to CppUTest.
5
+ This framework adds the concepts of test groups and gives finer control of your tests over the command line.
6
6
 
7
- This framework is primarily supplied for those working through James Grenning's book on Embedded
8
- Test Driven Development, or those coming to Unity from CppUTest. We should note that using this
9
- framework glosses over some of the features of Unity, and makes it more difficult
10
- to integrate with other testing tools like Ceedling and CMock.
7
+ This framework is primarily supplied for those working through James Grenning's book on Embedded Test Driven Development, or those coming to Unity from CppUTest.
8
+ We should note that using this framework glosses over some of the features of Unity, and makes it more difficult to integrate with other testing tools like Ceedling and CMock.
11
9
 
12
- # Dependency Notification
10
+ ## Dependency Notification
13
11
 
14
- Fixtures, by default, uses the Memory addon as well. This is to make it simple for those trying to
15
- follow along with James' book. Using them together is completely optional. You may choose to use
16
- Fixtures without Memory handling by defining `UNITY_FIXTURE_NO_EXTRAS`. It will then stop automatically
17
- pulling in extras and leave you to do it as desired.
12
+ Fixtures, by default, uses the Memory addon as well.
13
+ This is to make it simple for those trying to follow along with James' book.
14
+ Using them together is completely optional.
15
+ You may choose to use Fixtures without Memory handling by defining `UNITY_FIXTURE_NO_EXTRAS`.
16
+ It will then stop automatically pulling in extras and leave you to do it as desired.
18
17
 
19
- # Usage information
18
+ ## Usage information
20
19
 
21
- By default the test executables produced by Unity Fixtures run all tests once, but the behavior can
22
- be configured with command-line flags. Run the test executable with the `--help` flag for more
23
- information.
20
+ By default the test executables produced by Unity Fixtures run all tests once, but the behavior can be configured with command-line flags.
21
+ Run the test executable with the `--help` flag for more information.
24
22
 
25
- It's possible to add a custom line at the end of the help message, typically to point to
26
- project-specific or company-specific unit test documentation. Define `UNITY_CUSTOM_HELP_MSG` to
27
- provide a custom message, e.g.:
23
+ It's possible to add a custom line at the end of the help message, typically to point to project-specific or company-specific unit test documentation.
24
+ Define `UNITY_CUSTOM_HELP_MSG` to provide a custom message, e.g.:
28
25
 
29
26
  #define UNITY_CUSTOM_HELP_MSG "If any test fails see https://example.com/troubleshooting"
@@ -1,49 +1,42 @@
1
1
  # Unity Memory
2
2
 
3
- This Framework is an optional add-on to Unity. By including unity.h and then
4
- unity_memory.h, you have the added ability to track malloc and free calls. This
5
- addon requires that the stdlib functions be overridden by its own defines. These
6
- defines will still malloc / realloc / free etc, but will also track the calls
7
- in order to ensure that you don't have any memory leaks in your programs.
3
+ This Framework is an optional add-on to Unity.
4
+ By including unity.h and then unity_memory.h, you have the added ability to track malloc and free calls.
5
+ This addon requires that the stdlib functions be overridden by its own defines.
6
+ These defines will still malloc / realloc / free etc, but will also track the calls in order to ensure that you don't have any memory leaks in your programs.
8
7
 
9
- Note that this is only useful in situations where a unit is in charge of both
10
- the allocation and deallocation of memory. When it is not symmetric, unit testing
11
- can report a number of false failures. A more advanced runtime tool is required to
12
- track complete system memory handling.
8
+ Note that this is only useful in situations where a unit is in charge of both the allocation and deallocation of memory.
9
+ When it is not symmetric, unit testing can report a number of false failures.
10
+ A more advanced runtime tool is required to track complete system memory handling.
13
11
 
14
- # Module API
12
+ ## Module API
15
13
 
16
- ## `UnityMalloc_StartTest` and `UnityMalloc_EndTest`
14
+ ### `UnityMalloc_StartTest` and `UnityMalloc_EndTest`
17
15
 
18
- These must be called at the beginning and end of each test. For simplicity, they can
19
- be added to `setUp` and `tearDown` in order to do their job. When using the test
20
- runner generator scripts, these will be automatically added to the runner whenever
21
- unity_memory.h is included.
16
+ These must be called at the beginning and end of each test.
17
+ For simplicity, they can be added to `setUp` and `tearDown` in order to do their job.
18
+ When using the test runner generator scripts, these will be automatically added to the runner whenever unity_memory.h is included.
22
19
 
23
- ## `UnityMalloc_MakeMallocFailAfterCount`
20
+ ### `UnityMalloc_MakeMallocFailAfterCount`
24
21
 
25
- This can be called from the tests themselves. Passing this function a number will
26
- force the reference counter to start keeping track of malloc calls. During that test,
27
- if the number of malloc calls exceeds the number given, malloc will immediately
28
- start returning `NULL`. This allows you to test error conditions. Think of it as a
29
- simplified mock.
22
+ This can be called from the tests themselves.
23
+ Passing this function a number will force the reference counter to start keeping track of malloc calls.
24
+ During that test, if the number of malloc calls exceeds the number given, malloc will immediately start returning `NULL`.
25
+ This allows you to test error conditions.
26
+ Think of it as a simplified mock.
30
27
 
31
- # Configuration
28
+ ## Configuration
32
29
 
33
- ## `UNITY_MALLOC` and `UNITY_FREE`
30
+ ### `UNITY_MALLOC` and `UNITY_FREE`
34
31
 
35
- By default, this module tries to use the real stdlib `malloc` and `free` internally.
36
- If you would prefer it to use something else, like FreeRTOS's `pvPortMalloc` and
37
- `pvPortFree`, then you can use these defines to make it so.
32
+ By default, this module tries to use the real stdlib `malloc` and `free` internally.
33
+ If you would prefer it to use something else, like FreeRTOS's `pvPortMalloc` and `pvPortFree`, then you can use these defines to make it so.
38
34
 
39
- ## `UNITY_EXCLUDE_STDLIB_MALLOC`
35
+ ### `UNITY_EXCLUDE_STDLIB_MALLOC`
40
36
 
41
- If you would like this library to ignore stdlib or other heap engines completely, and
42
- manage the memory on its own, then define this. All memory will be handled internally
43
- (and at likely lower overhead). Note that this is not a very featureful memory manager,
44
- but is sufficient for most testing purposes.
37
+ If you would like this library to ignore stdlib or other heap engines completely, and manage the memory on its own, then define this. All memory will be handled internally (and at likely lower overhead).
38
+ Note that this is not a very featureful memory manager, but is sufficient for most testing purposes.
45
39
 
46
- ## `UNITY_INTERNAL_HEAP_SIZE_BYTES`
40
+ ### `UNITY_INTERNAL_HEAP_SIZE_BYTES`
47
41
 
48
- When using the built-in memory manager (see `UNITY_EXCLUDE_STDLIB_MALLOC`) this define
49
- allows you to set the heap size this library will use to manage the memory.
42
+ When using the built-in memory manager (see `UNITY_EXCLUDE_STDLIB_MALLOC`) this define allows you to set the heap size this library will use to manage the memory.
@@ -445,7 +445,7 @@ void UnityPrintFloat(const UNITY_DOUBLE input_number)
445
445
 
446
446
  /* build up buffer in reverse order */
447
447
  digits = 0;
448
- while ((n != 0) || (digits < (decimals + 1)))
448
+ while ((n != 0) || (digits <= decimals))
449
449
  {
450
450
  buf[digits++] = (char)('0' + n % 10);
451
451
  n /= 10;
@@ -10,7 +10,7 @@
10
10
 
11
11
  #define UNITY_VERSION_MAJOR 2
12
12
  #define UNITY_VERSION_MINOR 5
13
- #define UNITY_VERSION_BUILD 2
13
+ #define UNITY_VERSION_BUILD 4
14
14
  #define UNITY_VERSION ((UNITY_VERSION_MAJOR << 16) | (UNITY_VERSION_MINOR << 8) | UNITY_VERSION_BUILD)
15
15
 
16
16
  #ifdef __cplusplus
@@ -40,10 +40,24 @@
40
40
  #include <limits.h>
41
41
  #endif
42
42
 
43
- #if defined __GNUC__
44
- # define UNITY_FUNCTION_ATTR(a) __attribute__((a))
43
+ #if defined(__GNUC__) || defined(__clang__)
44
+ #define UNITY_FUNCTION_ATTR(a) __attribute__((a))
45
45
  #else
46
- # define UNITY_FUNCTION_ATTR(a) /* ignore */
46
+ #define UNITY_FUNCTION_ATTR(a) /* ignore */
47
+ #endif
48
+
49
+ #ifndef UNITY_NORETURN
50
+ #if defined(__cplusplus)
51
+ #if __cplusplus >= 201103L
52
+ #define UNITY_NORETURN [[ noreturn ]]
53
+ #endif
54
+ #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
55
+ #include <stdnoreturn.h>
56
+ #define UNITY_NORETURN noreturn
57
+ #endif
58
+ #endif
59
+ #ifndef UNITY_NORETURN
60
+ #define UNITY_NORETURN UNITY_FUNCTION_ATTR(noreturn)
47
61
  #endif
48
62
 
49
63
  /*-------------------------------------------------------
@@ -333,7 +347,7 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
333
347
  UnityPrintNumberUnsigned(execTimeMs); \
334
348
  UnityPrint(" ms)"); \
335
349
  }
336
- #elif defined(__unix__)
350
+ #elif defined(__unix__) || defined(__APPLE__)
337
351
  #include <time.h>
338
352
  #define UNITY_TIME_TYPE struct timespec
339
353
  #define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t)
@@ -618,8 +632,8 @@ void UnityAssertNumbersArrayWithin(const UNITY_UINT delta,
618
632
  const UNITY_FLAGS_T flags);
619
633
 
620
634
  #ifndef UNITY_EXCLUDE_SETJMP_H
621
- void UnityFail(const char* message, const UNITY_LINE_TYPE line) UNITY_FUNCTION_ATTR(noreturn);
622
- void UnityIgnore(const char* message, const UNITY_LINE_TYPE line) UNITY_FUNCTION_ATTR(noreturn);
635
+ UNITY_NORETURN void UnityFail(const char* message, const UNITY_LINE_TYPE line);
636
+ UNITY_NORETURN void UnityIgnore(const char* message, const UNITY_LINE_TYPE line);
623
637
  #else
624
638
  void UnityFail(const char* message, const UNITY_LINE_TYPE line);
625
639
  void UnityIgnore(const char* message, const UNITY_LINE_TYPE line);
@@ -875,7 +889,7 @@ int UnityTestMatches(void);
875
889
  #define UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY)
876
890
  #define UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY)
877
891
  #define UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY)
878
- #define UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY)
892
+ #define UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY)
879
893
  #define UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY)
880
894
  #define UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY)
881
895
  #define UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY)
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: 0.31.0
4
+ version: 0.31.1
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: 2021-01-29 00:00:00.000000000 Z
13
+ date: 2021-06-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -30,16 +30,22 @@ dependencies:
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '12'
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: '14'
36
39
  type: :runtime
37
40
  prerelease: false
38
41
  version_requirements: !ruby/object:Gem::Requirement
39
42
  requirements:
40
- - - "~>"
43
+ - - ">="
41
44
  - !ruby/object:Gem::Version
42
45
  version: '12'
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: '14'
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: deep_merge
45
51
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +109,8 @@ files:
103
109
  - assets/default_gitignore
104
110
  - assets/example_file.c
105
111
  - assets/example_file.h
112
+ - assets/example_file_call.c
113
+ - assets/example_file_call.h
106
114
  - assets/project_as_gem.yml
107
115
  - assets/project_with_guts.yml
108
116
  - assets/project_with_guts_gcov.yml
@@ -111,6 +119,7 @@ files:
111
119
  - assets/test_example_file_success.c
112
120
  - assets/test_example_file_unity_printf.c
113
121
  - assets/test_example_file_verbose.c
122
+ - assets/test_example_file_with_mock.c
114
123
  - assets/test_example_with_parameterized_tests.c
115
124
  - assets/tests_with_defines/src/adc_hardware.c
116
125
  - assets/tests_with_defines/src/adc_hardware.h
@@ -694,7 +703,7 @@ files:
694
703
  - plugins/fake_function_framework/src/fff_unity_helper.h
695
704
  - plugins/gcov/README.md
696
705
  - plugins/gcov/assets/template.erb
697
- - plugins/gcov/config/defaults.yml
706
+ - plugins/gcov/config/defaults_gcov.rb
698
707
  - plugins/gcov/gcov.rake
699
708
  - plugins/gcov/lib/gcov.rb
700
709
  - plugins/gcov/lib/gcov_constants.rb
@@ -1,55 +0,0 @@
1
- ---
2
-
3
- :tools:
4
- :gcov_compiler:
5
- :executable: gcc
6
- :arguments:
7
- - -g
8
- - -fprofile-arcs
9
- - -ftest-coverage
10
- - -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
11
- - -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE
12
- - -D$: COLLECTION_DEFINES_TEST_AND_VENDOR
13
- - -DGCOV_COMPILER
14
- - -DCODE_COVERAGE
15
- - -c "${1}"
16
- - -o "${2}"
17
- :gcov_linker:
18
- :executable: gcc
19
- :arguments:
20
- - -fprofile-arcs
21
- - -ftest-coverage
22
- - ${1}
23
- - -o ${2}
24
- - ${4}
25
- - ${5}
26
- :gcov_fixture:
27
- :executable: ${1}
28
- :gcov_report:
29
- :executable: gcov
30
- :arguments:
31
- - -n
32
- - -p
33
- - -b
34
- - -o "$": GCOV_BUILD_OUTPUT_PATH
35
- - "\"${1}\""
36
- :gcov_gcov_post_report:
37
- :executable: gcov
38
- :optional: TRUE
39
- :arguments:
40
- - -b
41
- - -c
42
- - -r
43
- - -x
44
- - ${1}
45
- :gcov_gcovr_post_report:
46
- :executable: gcovr
47
- :optional: TRUE
48
- :arguments:
49
- - ${1}
50
- :gcov_report_generator_post_report:
51
- :executable: reportgenerator
52
- :optional: TRUE
53
- :arguments:
54
- - ${1}
55
- ...