ceedling 0.25.0 → 0.27.0
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/README.md +1 -1
- data/assets/project_as_gem.yml +13 -0
- data/assets/project_with_guts.yml +13 -0
- data/bin/ceedling +91 -67
- data/docs/CeedlingPacket.md +61 -23
- data/docs/CeedlingPacket.odt +0 -0
- data/docs/CeedlingPacket.pdf +0 -0
- data/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/examples/temp_sensor/test/TestTemperatureCalculator.c +4 -1
- data/lib/ceedling/configurator.rb +14 -1
- data/lib/ceedling/configurator_builder.rb +2 -1
- data/lib/ceedling/configurator_validator.rb +12 -3
- data/lib/ceedling/constants.rb +3 -1
- data/lib/ceedling/defaults.rb +12 -1
- data/lib/ceedling/file_finder.rb +3 -0
- data/lib/ceedling/file_path_utils.rb +1 -1
- data/lib/ceedling/file_wrapper.rb +4 -4
- data/lib/ceedling/generator.rb +12 -3
- data/lib/ceedling/preprocessinator_helper.rb +5 -5
- data/lib/ceedling/preprocessinator_includes_handler.rb +10 -1
- data/lib/ceedling/project_config_manager.rb +1 -2
- data/lib/ceedling/project_file_loader.rb +27 -9
- data/lib/ceedling/rakefile.rb +6 -6
- data/lib/ceedling/release_invoker.rb +21 -6
- data/lib/ceedling/rules_release.rake +9 -5
- data/lib/ceedling/rules_tests.rake +6 -1
- data/lib/ceedling/setupinator.rb +1 -0
- data/lib/ceedling/tasks_base.rake +3 -0
- data/lib/ceedling/tasks_filesystem.rake +10 -7
- data/lib/ceedling/tasks_release.rake +3 -1
- data/lib/ceedling/test_includes_extractor.rb +16 -12
- data/lib/ceedling/test_invoker.rb +40 -0
- data/lib/ceedling/version.rb +3 -3
- data/lib/ceedling/version.rb.erb +1 -1
- data/plugins/command_hooks/lib/command_hooks.rb +1 -1
- data/plugins/fake_function_framework/examples/fff_example/src/bar.h +1 -0
- data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +1 -0
- data/plugins/fake_function_framework/lib/fff_mock_generator.rb +4 -0
- data/plugins/fake_function_framework/spec/{fff_mock_generator_spec.rb → fff_mock_header_generator_spec.rb} +34 -194
- data/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb +149 -0
- data/plugins/fake_function_framework/spec/header_generator.rb +51 -0
- data/plugins/junit_tests_report/lib/junit_tests_report.rb +115 -0
- data/plugins/subprojects/README.md +63 -0
- data/plugins/subprojects/config/defaults.yml +33 -0
- data/plugins/subprojects/lib/subprojects.rb +92 -0
- data/plugins/subprojects/subprojects.rake +78 -0
- data/spec/preprocessinator_includes_handler_spec.rb +15 -5
- data/spec/spec_helper.rb +2 -2
- data/spec/spec_system_helper.rb +49 -1
- data/spec/system/deployment_spec.rb +29 -0
- data/vendor/c_exception/README.md +8 -2
- data/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
- data/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/c_exception/vendor/unity/README.md +19 -10
- data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/c_exception/vendor/unity/src/unity.c +396 -330
- data/vendor/c_exception/vendor/unity/src/unity.h +50 -4
- data/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/c_exception/vendor/unity/test/Makefile +17 -17
- data/vendor/c_exception/vendor/unity/test/rakefile +63 -3
- data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
- data/vendor/cmock/README.md +10 -1
- data/vendor/cmock/config/test_environment.rb +7 -7
- data/vendor/cmock/docs/CMock_Summary.md +325 -128
- data/vendor/cmock/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/examples/make_example/Makefile +2 -2
- data/vendor/cmock/examples/temp_sensor/gcc.yml +5 -4
- data/vendor/cmock/examples/temp_sensor/iar_v4.yml +5 -4
- data/vendor/cmock/examples/temp_sensor/iar_v5.yml +5 -4
- data/vendor/cmock/examples/temp_sensor/rakefile.rb +11 -1
- data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +12 -10
- data/vendor/cmock/lib/cmock.rb +0 -3
- data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +6 -2
- data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -1
- data/vendor/cmock/lib/cmock_header_parser.rb +5 -6
- data/vendor/cmock/release/version.info +1 -1
- data/vendor/cmock/scripts/create_makefile.rb +4 -2
- data/vendor/cmock/scripts/test_summary.rb +17 -9
- data/vendor/cmock/src/cmock.c +1 -0
- data/vendor/cmock/src/cmock.h +1 -1
- data/vendor/cmock/src/cmock_internals.h +14 -1
- data/vendor/cmock/test/c/TestCMockC.yml +4 -4
- data/vendor/cmock/test/c/TestCMockCDynamic.yml +4 -4
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_FLASH.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_RAM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_SIM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_FLASH.xcl +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_RAM.xcl +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/ioat91sam7x256.ddf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.dep +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewd +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewp +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.eww +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X-EK.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.inc +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.rdf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.tcl +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256_inc.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/ioat91sam7x256.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/lib_AT91SAM7X256.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.cspy.bat +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dbgdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dni +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.wsdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup.s79 +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup_SAM7.c +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_FLASH.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_RAM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_SIM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_FLASH.icf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_RAM.icf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.dep +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewd +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewp +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.eww +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X-EK.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X256_inc.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/lib_AT91SAM7X256.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/project.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dni +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.cspy.bat +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dbgdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dni +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.wsdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_Binary.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_RAM_Debug.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup.s +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup_SAM7.c +0 -0
- data/vendor/cmock/{Rakefile → test/rakefile} +9 -9
- data/vendor/cmock/{rakefile_helper.rb → test/rakefile_helper.rb} +13 -13
- data/vendor/cmock/test/system/test_compilation/config.yml +4 -4
- data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +2 -0
- data/vendor/cmock/{targets → test/targets}/clang_strict.yml +11 -11
- data/vendor/cmock/{targets → test/targets}/gcc.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/gcc_64.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/gcc_tiny.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/iar_arm_v4.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/iar_arm_v5.yml +10 -10
- data/vendor/cmock/test/test_helper.rb +4 -8
- data/vendor/cmock/test/unit/cmock_config_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_file_writer_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +3 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +15 -2
- data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +6 -10
- data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +1 -1
- data/vendor/cmock/vendor/c_exception/README.md +8 -2
- data/vendor/cmock/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
- data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +19 -10
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +396 -330
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +50 -4
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +17 -17
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +63 -3
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
- data/vendor/cmock/vendor/unity/README.md +19 -10
- data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/cmock/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/cmock/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/cmock/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/cmock/vendor/unity/release/version.info +1 -1
- data/vendor/cmock/vendor/unity/src/unity.c +396 -330
- data/vendor/cmock/vendor/unity/src/unity.h +50 -4
- data/vendor/cmock/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/cmock/vendor/unity/test/Makefile +17 -17
- data/vendor/cmock/vendor/unity/test/rakefile +63 -3
- data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/cmock/vendor/unity/test/tests/testunity.c +1338 -151
- data/vendor/deep_merge/Rakefile +1 -1
- data/vendor/unity/README.md +19 -10
- data/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/unity/release/version.info +1 -1
- data/vendor/unity/src/unity.c +396 -330
- data/vendor/unity/src/unity.h +50 -4
- data/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/unity/test/Makefile +17 -17
- data/vendor/unity/test/rakefile +63 -3
- data/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/unity/test/tests/testunity.c +1338 -151
- metadata +102 -157
- data/test_graveyard/integration/paths.yml +0 -17
- data/test_graveyard/integration/paths_test.rb +0 -80
- data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +0 -75
- data/test_graveyard/integration/rake_rules_cmock_test.rb +0 -74
- data/test_graveyard/integration/rake_rules_preprocess_test.rb +0 -178
- data/test_graveyard/integration/rake_rules_test.rb +0 -268
- data/test_graveyard/integration/rake_tasks_test.rb +0 -103
- data/test_graveyard/integration_test_helper.rb +0 -34
- data/test_graveyard/rakefile_rules.rb +0 -10
- data/test_graveyard/rakefile_rules_aux_dependencies.rb +0 -10
- data/test_graveyard/rakefile_rules_cmock.rb +0 -10
- data/test_graveyard/rakefile_rules_preprocess.rb +0 -10
- data/test_graveyard/rakefile_tasks.rb +0 -10
- data/test_graveyard/system/file_system_dependencies.yml +0 -20
- data/test_graveyard/system/file_system_kitchen_sink.yml +0 -20
- data/test_graveyard/system/file_system_mocks.yml +0 -20
- data/test_graveyard/system/file_system_preprocess.yml +0 -20
- data/test_graveyard/system/file_system_simple.yml +0 -20
- data/test_graveyard/system/file_system_test.rb +0 -78
- data/test_graveyard/system/mocks/include/a_file.h +0 -2
- data/test_graveyard/system/mocks/include/other_stuff.h +0 -2
- data/test_graveyard/system/mocks/include/stuff.h +0 -3
- data/test_graveyard/system/mocks/source/a_file.c +0 -9
- data/test_graveyard/system/mocks/test/test_a_file.c +0 -41
- data/test_graveyard/system/mocks/test/test_no_file.c +0 -14
- data/test_graveyard/system/project_mocks.yml +0 -43
- data/test_graveyard/system/project_mocks_test.rb +0 -38
- data/test_graveyard/system/project_simple.yml +0 -36
- data/test_graveyard/system/project_simple_test.rb +0 -39
- data/test_graveyard/system/rule_mocks_test.rb +0 -44
- data/test_graveyard/system/rule_runners_test.rb +0 -44
- data/test_graveyard/system/simple/include/other_stuff.h +0 -2
- data/test_graveyard/system/simple/include/stuff.h +0 -3
- data/test_graveyard/system/simple/source/other_stuff.c +0 -6
- data/test_graveyard/system/simple/source/stuff.c +0 -7
- data/test_graveyard/system/simple/test/test_other_stuff.c +0 -30
- data/test_graveyard/system/simple/test/test_stuff.c +0 -51
- data/test_graveyard/system_test_helper.rb +0 -73
- data/test_graveyard/test_helper.rb +0 -93
- data/test_graveyard/unit/busted/configurator_builder_test.rb +0 -569
- data/test_graveyard/unit/busted/configurator_helper_test.rb +0 -234
- data/test_graveyard/unit/busted/configurator_test.rb +0 -232
- data/test_graveyard/unit/busted/configurator_validator_test.rb +0 -169
- data/test_graveyard/unit/busted/deep_merge_fix_test.rb +0 -55
- data/test_graveyard/unit/busted/dependinator_test.rb +0 -129
- data/test_graveyard/unit/busted/file_finder_helper_test.rb +0 -45
- data/test_graveyard/unit/busted/file_finder_test.rb +0 -114
- data/test_graveyard/unit/busted/file_path_utils_test.rb +0 -97
- data/test_graveyard/unit/busted/file_system_utils_test.rb +0 -21
- data/test_graveyard/unit/busted/generator_test.rb +0 -187
- data/test_graveyard/unit/busted/generator_test_results_test.rb +0 -129
- data/test_graveyard/unit/busted/generator_test_runner_test.rb +0 -475
- data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +0 -39
- data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +0 -156
- data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +0 -93
- data/test_graveyard/unit/busted/preprocessinator_test.rb +0 -57
- data/test_graveyard/unit/busted/project_file_loader_test.rb +0 -142
- data/test_graveyard/unit/busted/setupinator_test.rb +0 -45
- data/test_graveyard/unit/busted/streaminator_test.rb +0 -49
- data/test_graveyard/unit/busted/task_invoker_test.rb +0 -69
- data/test_graveyard/unit/busted/test_includes_extractor_test.rb +0 -111
- data/test_graveyard/unit/busted/test_invoker_helper_test.rb +0 -62
- data/test_graveyard/unit/busted/test_invoker_test.rb +0 -47
- data/test_graveyard/unit/busted/tool_executor_helper_test.rb +0 -100
- data/test_graveyard/unit/busted/tool_executor_test.rb +0 -351
- data/test_graveyard/unit/busted/verbosinator_test.rb +0 -65
- data/test_graveyard/unit/preprocessinator_extractor_test.rb +0 -731
- data/test_graveyard/unit_test_helper.rb +0 -16
- data/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
- data/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
- data/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
- data/vendor/cmock/docs/CMock Summary.odt +0 -0
- data/vendor/cmock/docs/CMock Summary.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
- data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
- data/vendor/cmock/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
- data/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
data/vendor/cmock/README.md
CHANGED
|
@@ -6,10 +6,19 @@ CMock - Mock/stub generator for C
|
|
|
6
6
|
Getting Started
|
|
7
7
|
================
|
|
8
8
|
|
|
9
|
+
If you're using Ceedling, there is no need to install CMock. It will handle it for you.
|
|
10
|
+
For everyone else, the simplest way is to grab it off github. You can also download it
|
|
11
|
+
as a zip if you prefer. The Github method looks something like this:
|
|
12
|
+
|
|
9
13
|
> git clone --recursive https://github.com/throwtheswitch/cmock.git
|
|
10
14
|
> cd cmock
|
|
11
15
|
> bundle install # Ensures you have all RubyGems needed
|
|
12
|
-
|
|
16
|
+
|
|
17
|
+
If you plan to help with the development of CMock (or just want to verify that it can
|
|
18
|
+
perform its self tests on your system) then you can enter the test directory and then
|
|
19
|
+
ask it to test:
|
|
20
|
+
|
|
21
|
+
> rake # Run all CMock self tests
|
|
13
22
|
|
|
14
23
|
API Documentation
|
|
15
24
|
=================
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
# CMock Project - Automatic Mock Generation for C
|
|
3
3
|
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
|
4
4
|
# [Released under MIT License. Please refer to license.txt for details]
|
|
5
|
-
# ==========================================
|
|
5
|
+
# ==========================================
|
|
6
6
|
|
|
7
7
|
# Setup our load path:
|
|
8
|
-
[
|
|
9
|
-
'lib',
|
|
10
|
-
'vendor/behaviors/lib',
|
|
11
|
-
'vendor/hardmock/lib',
|
|
12
|
-
'vendor/unity/auto/',
|
|
13
|
-
'test/system/'
|
|
8
|
+
[
|
|
9
|
+
'./lib',
|
|
10
|
+
'./vendor/behaviors/lib',
|
|
11
|
+
'./vendor/hardmock/lib',
|
|
12
|
+
'./vendor/unity/auto/',
|
|
13
|
+
'./test/system/'
|
|
14
14
|
].each do |dir|
|
|
15
15
|
$LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) )
|
|
16
16
|
end
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
CMock: A Summary
|
|
2
|
+
================
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
Attribution Share-Alike License]
|
|
4
|
+
*[ThrowTheSwitch.org](http://throwtheswitch.org)*
|
|
6
5
|
|
|
6
|
+
*This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License*
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
What Exactly Are We Talking About Here?
|
|
10
|
+
---------------------------------------
|
|
10
11
|
|
|
11
12
|
CMock is a nice little tool which takes your header files and creates
|
|
12
|
-
a Mock interface for it so that you can more easily
|
|
13
|
+
a Mock interface for it so that you can more easily unit test modules
|
|
13
14
|
that touch other modules. For each function prototype in your
|
|
14
15
|
header, like this one:
|
|
15
16
|
|
|
@@ -60,7 +61,29 @@ call DoesSomething enough, or too much, or with the wrong arguments,
|
|
|
60
61
|
or in the wrong order.
|
|
61
62
|
|
|
62
63
|
CMock is based on Unity, which it uses for all internal testing.
|
|
63
|
-
It uses Ruby to do all the main work (versions
|
|
64
|
+
It uses Ruby to do all the main work (versions 2.0.0 and above).
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
Installing
|
|
68
|
+
==========
|
|
69
|
+
|
|
70
|
+
The first thing you need to do to install CMock is to get yourself
|
|
71
|
+
a copy of Ruby. If you're on linux or osx, you probably already
|
|
72
|
+
have it. You can prove it by typing the following:
|
|
73
|
+
|
|
74
|
+
ruby --version
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
If it replied in a way that implies ignorance, then you're going to
|
|
78
|
+
need to install it. You can go to [ruby-lang](https://ruby-lang.org)
|
|
79
|
+
to get the latest version. You're also going to need to do that if it
|
|
80
|
+
replied with a version that is older than 2.0.0. Go ahead. We'll wait.
|
|
81
|
+
|
|
82
|
+
Once you have Ruby, you have three options:
|
|
83
|
+
|
|
84
|
+
* Clone the latest [CMock repo on github](https://github.com/ThrowTheSwitch/CMock/)
|
|
85
|
+
* Download the latest [CMock zip from github](https://github.com/ThrowTheSwitch/CMock/)
|
|
86
|
+
* Install Ceedling (which has it built in!) through your commandline using `gem install ceedling`.
|
|
64
87
|
|
|
65
88
|
|
|
66
89
|
Generated Mock Module Summary
|
|
@@ -76,7 +99,11 @@ Expect:
|
|
|
76
99
|
-------
|
|
77
100
|
|
|
78
101
|
Your basic staple Expects which will be used for most of your day
|
|
79
|
-
to day CMock work.
|
|
102
|
+
to day CMock work. By calling this, you are telling CMock that you
|
|
103
|
+
expect that function to be called during your test. It also specifies
|
|
104
|
+
which arguments you expect it to be called with, and what return
|
|
105
|
+
value you want returned when that happens. You can call this function
|
|
106
|
+
multiple times back to back in order to queue up multiple calls.
|
|
80
107
|
|
|
81
108
|
* `void func(void)` => `void func_Expect(void)`
|
|
82
109
|
* `void func(params)` => `void func_Expect(expected_params)`
|
|
@@ -84,10 +111,30 @@ to day CMock work.
|
|
|
84
111
|
* `retval func(params)` => `void func_ExpectAndReturn(expected_params, retval_to_return)`
|
|
85
112
|
|
|
86
113
|
|
|
114
|
+
ExpectAnyArgs:
|
|
115
|
+
--------------
|
|
116
|
+
|
|
117
|
+
This behaves just like the Expects calls, except that it doesn't really
|
|
118
|
+
care what the arguments are that the mock gets called with. It still counts
|
|
119
|
+
the number of times the mock is called and it still handles return values
|
|
120
|
+
if there are some.
|
|
121
|
+
|
|
122
|
+
* `void func(void)` => `void func_ExpectAnyArgs(void)`
|
|
123
|
+
* `void func(params)` => `void func_ExpectAnyArgs(void)`
|
|
124
|
+
* `retval func(void)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)`
|
|
125
|
+
* `retval func(params)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)`
|
|
126
|
+
|
|
127
|
+
|
|
87
128
|
Array:
|
|
88
129
|
------
|
|
89
130
|
|
|
90
|
-
An ExpectWithArray
|
|
131
|
+
An ExpectWithArray is another variant of Expect. Like expect, it cares about
|
|
132
|
+
the number of times a mock is called, the arguments it is called with, and the
|
|
133
|
+
values it is to return. This variant has another feature, though. For anything
|
|
134
|
+
that resembles a pointer or array, it breaks the argument into TWO arguments.
|
|
135
|
+
The first is the original pointer. The second specify the number of elements
|
|
136
|
+
it is to verify of that array. If you specify 1, it'll check one object. If 2,
|
|
137
|
+
it'll assume your pointer is pointing at the first of two elements in an array.
|
|
91
138
|
If you specify zero elements, it will check just the pointer if
|
|
92
139
|
`:smart` mode is configured or fail if `:compare_data` is set.
|
|
93
140
|
|
|
@@ -97,14 +144,59 @@ If you specify zero elements, it will check just the pointer if
|
|
|
97
144
|
* `retval func(other, ptr* param)` => `void func_ExpectWithArrayAndReturn(other, ptr* param, int param_depth, retval_to_return)`
|
|
98
145
|
|
|
99
146
|
|
|
147
|
+
Ignore:
|
|
148
|
+
-------
|
|
149
|
+
|
|
150
|
+
Maybe you don't care about the number of times a particular function is called or
|
|
151
|
+
the actual arguments it is called with. In that case, you want to use Ignore. Ignore
|
|
152
|
+
only needs to be called once per test. It will then ignore any further calls to that
|
|
153
|
+
particular mock. The IgnoreAndReturn works similarly, except that it has the added
|
|
154
|
+
benefit of knowing what to return when that call happens. If the mock is called more
|
|
155
|
+
times than IgnoreAndReturn was called, it will keep returning the last value without
|
|
156
|
+
complaint. If it's called less times, it will also ignore that. You SAID you didn't
|
|
157
|
+
care how many times it was called, right?
|
|
158
|
+
|
|
159
|
+
* `void func(void)` => `void func_Ignore(void)`
|
|
160
|
+
* `void func(params)` => `void func_Ignore(void)`
|
|
161
|
+
* `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)`
|
|
162
|
+
* `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)`
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
Ignore Arg:
|
|
166
|
+
------------
|
|
167
|
+
|
|
168
|
+
Maybe you overall want to use Expect and its similar variations, but you don't care
|
|
169
|
+
what is passed to a particular argument. This is particularly useful when that argument
|
|
170
|
+
is a pointer to a value that is supposed to be filled in by the function. You don't want
|
|
171
|
+
to use ExpectAnyArgs, because you still care about the other arguments. Instead, before
|
|
172
|
+
any of your Expect calls are made, you can call this function. It tells CMock to ignore
|
|
173
|
+
a particular argument for the rest of this test, for this mock function.
|
|
174
|
+
|
|
175
|
+
* `void func(params)` => `void func_IgnoreArg_paramName(void)`
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
ReturnThruPtr:
|
|
179
|
+
--------------
|
|
180
|
+
|
|
181
|
+
Another option which operates on a particular argument of a function is the ReturnThruPtr
|
|
182
|
+
plugin. For every argument that resembles a pointer or reference, CMock generates an
|
|
183
|
+
instance of this function. Just as the AndReturn functions support injecting one or more
|
|
184
|
+
return values into a queue, this function lets you specify one or more return values which
|
|
185
|
+
are queued up and copied into the space being pointed at each time the mock is called.
|
|
186
|
+
|
|
187
|
+
* `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)`
|
|
188
|
+
* => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)`
|
|
189
|
+
* => `void func_ReturnMemThruPtr_paramName(val_to_return, size)`
|
|
190
|
+
|
|
191
|
+
|
|
100
192
|
Callback:
|
|
101
193
|
---------
|
|
102
194
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
checks. It can be configured to check the arguments
|
|
107
|
-
expects) or just jump directly to the callback.
|
|
195
|
+
If all those other options don't work, and you really need to do something custom, you
|
|
196
|
+
still have a choice. As soon as you stub a callback in a test, it will call the callback
|
|
197
|
+
whenever the mock is encountered and return the retval returned from the callback (if any)
|
|
198
|
+
instead of performing the usual expect checks. It can be configured to check the arguments
|
|
199
|
+
first (like expects) or just jump directly to the callback.
|
|
108
200
|
|
|
109
201
|
* `void func(void)` => `void func_StubWithCallback(CMOCK_func_CALLBACK callback)`
|
|
110
202
|
where `CMOCK_func_CALLBACK` looks like: `void func(int NumCalls)`
|
|
@@ -119,10 +211,9 @@ where `CMOCK_func_CALLBACK` looks like: `retval func(params, int NumCalls)`
|
|
|
119
211
|
Cexception:
|
|
120
212
|
-----------
|
|
121
213
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
parameters.
|
|
214
|
+
Finally, if you are using Cexception for error handling, you can use this to throw errors
|
|
215
|
+
from inside mocks. Like Expects, it remembers which call was supposed to throw the error,
|
|
216
|
+
and it still checks parameters first.
|
|
126
217
|
|
|
127
218
|
* `void func(void)` => `void func_ExpectAndThrow(value_to_throw)`
|
|
128
219
|
* `void func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)`
|
|
@@ -130,43 +221,6 @@ parameters.
|
|
|
130
221
|
* `retval func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)`
|
|
131
222
|
|
|
132
223
|
|
|
133
|
-
Ignore:
|
|
134
|
-
-------
|
|
135
|
-
|
|
136
|
-
This plugin supports two modes. You can use it to force CMock to
|
|
137
|
-
ignore calls to specific functions or to just ignore the arguments
|
|
138
|
-
passed to those functions. Either way you can specify multiple
|
|
139
|
-
returns or a single value to always return, whichever you prefer.
|
|
140
|
-
|
|
141
|
-
* `void func(void)` => `void func_Ignore(void)`
|
|
142
|
-
* `void func(params)` => `void func_Ignore(void)`
|
|
143
|
-
* `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)`
|
|
144
|
-
* `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)`
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Ignore Args:
|
|
148
|
-
------------
|
|
149
|
-
|
|
150
|
-
This plugin adds the ability to specify specifc arguments to ignore
|
|
151
|
-
for a function, instead of ignoring all the arguments or the entire
|
|
152
|
-
function call, as the Ignore plugin supports. This will create a function
|
|
153
|
-
for each argument and each function.
|
|
154
|
-
|
|
155
|
-
* `void func(params)` => `void func_IgnoreArg_paramName(void)`
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
ReturnThruPtr:
|
|
159
|
-
--------------
|
|
160
|
-
|
|
161
|
-
This plugin adds a number of options for returning data through arguments
|
|
162
|
-
that are pointers. This is fled separately from the Expect/Ignore call, so
|
|
163
|
-
you will want to issue one of those calls each time as well. This will only
|
|
164
|
-
create an extra call for arguments that are pointers. It will create one per
|
|
165
|
-
pointer argument.
|
|
166
|
-
|
|
167
|
-
* `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)`
|
|
168
|
-
* => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)`
|
|
169
|
-
* => `void func_ReturnMemThruPtr_paramName(val_to_return, size)`
|
|
170
224
|
|
|
171
225
|
Running CMock
|
|
172
226
|
=============
|
|
@@ -174,10 +228,11 @@ Running CMock
|
|
|
174
228
|
CMock is a Ruby script and class. You can therefore use it directly
|
|
175
229
|
from the command line, or include it in your own scripts or rakefiles.
|
|
176
230
|
|
|
231
|
+
|
|
177
232
|
Mocking from the Command Line
|
|
178
233
|
-----------------------------
|
|
179
234
|
|
|
180
|
-
After unpacking CMock, you will find
|
|
235
|
+
After unpacking CMock, you will find cmock.rb in the 'lib' directory.
|
|
181
236
|
This is the file that you want to run. It takes a list of header files
|
|
182
237
|
to be mocked, as well as an optional yaml file for a more detailed
|
|
183
238
|
configuration (see config options below).
|
|
@@ -191,6 +246,7 @@ And this will create two mocks using the default configuration:
|
|
|
191
246
|
|
|
192
247
|
ruby cmock.rb ../mocking/stuff/is/fun.h ../try/it/yourself.h
|
|
193
248
|
|
|
249
|
+
|
|
194
250
|
Mocking From Scripts or Rake
|
|
195
251
|
----------------------------
|
|
196
252
|
|
|
@@ -201,6 +257,7 @@ three ways.
|
|
|
201
257
|
|
|
202
258
|
You may specify nothing, allowing it to run with default settings:
|
|
203
259
|
|
|
260
|
+
require 'cmock.rb'
|
|
204
261
|
cmock = CMock.new
|
|
205
262
|
|
|
206
263
|
You may specify a YAML file containing the configuration options
|
|
@@ -212,7 +269,9 @@ You may specify the options explicitly:
|
|
|
212
269
|
|
|
213
270
|
cmock = Cmock.new(:plugins => [:cexception, :ignore], :mock_path => 'my/mocks/')
|
|
214
271
|
|
|
272
|
+
|
|
215
273
|
Config Options:
|
|
274
|
+
---------------
|
|
216
275
|
|
|
217
276
|
The following configuration options can be specified in the
|
|
218
277
|
yaml file or directly when instantiating.
|
|
@@ -229,81 +288,141 @@ Defined in the yaml file, they look more like this:
|
|
|
229
288
|
- __intrinsic
|
|
230
289
|
:when_ptr: :compare
|
|
231
290
|
|
|
291
|
+
In all cases, you can just include the things that you want to override
|
|
292
|
+
from the defaults. We've tried to specify what the defaults are below.
|
|
232
293
|
|
|
233
294
|
* `:attributes`:
|
|
234
295
|
These are attributes that CMock should ignore for you for testing
|
|
235
296
|
purposes. Custom compiler extensions and externs are handy things to
|
|
236
|
-
put here.
|
|
297
|
+
put here. If your compiler is choking on some extended syntax, this
|
|
298
|
+
is often a good place to look.
|
|
299
|
+
|
|
300
|
+
* defaults: ['__ramfunc', '__irq', '__fiq', 'register', 'extern']
|
|
301
|
+
* **note:** this option will reinsert these attributes onto the mock's calls.
|
|
302
|
+
If that isn't what you are looking for, check out :strippables.
|
|
303
|
+
|
|
304
|
+
* `:c_calling_conventions`:
|
|
305
|
+
Similarly, CMock may need to understand which C calling conventions
|
|
306
|
+
might show up in your codebase. If it encounters something it doesn't
|
|
307
|
+
recognize, it's not going to mock it. We have the most common covered,
|
|
308
|
+
but there are many compilers out there, and therefore many other options.
|
|
309
|
+
|
|
310
|
+
* defaults: ['__stdcall', '__cdecl', '__fastcall']
|
|
311
|
+
* **note:** this option will reinsert these attributes onto the mock's calls.
|
|
312
|
+
If that isn't what you are looking for, check out :strippables.
|
|
237
313
|
|
|
238
314
|
* `:callback_after_arg_check`:
|
|
239
|
-
Tell `:callback` plugin to do the normal argument checking before it
|
|
240
|
-
calls the callback function
|
|
241
|
-
callback function is called instead of the argument verification.
|
|
315
|
+
Tell `:callback` plugin to do the normal argument checking **before** it
|
|
316
|
+
calls the callback function by setting this to true. WHen false, the
|
|
317
|
+
callback function is called **instead** of the argument verification.
|
|
318
|
+
|
|
319
|
+
* default: false
|
|
242
320
|
|
|
243
321
|
* `:callback_include_count`:
|
|
244
322
|
Tell `:callback` plugin to include an extra parameter to specify the
|
|
245
323
|
number of times the callback has been called. If set to false, the
|
|
246
324
|
callback has the same interface as the mocked function. This can be
|
|
247
325
|
handy when you're wanting to use callback as a stub.
|
|
326
|
+
|
|
327
|
+
* default: true
|
|
248
328
|
|
|
249
329
|
* `:cexception_include`:
|
|
250
|
-
Tell `:cexception` plugin where to find CException.h... only need to
|
|
251
|
-
define if it's not in your build path already
|
|
330
|
+
Tell `:cexception` plugin where to find CException.h... You only need to
|
|
331
|
+
define this if it's not in your build path already... which it usually
|
|
332
|
+
will be for the purpose of your builds.
|
|
333
|
+
|
|
334
|
+
* default: *nil*
|
|
252
335
|
|
|
253
336
|
* `:enforce_strict_ordering`:
|
|
254
337
|
CMock always enforces the order that you call a particular function,
|
|
255
338
|
so if you expect GrabNabber(int size) to be called three times, it
|
|
256
339
|
will verify that the sizes are in the order you specified. You might
|
|
257
|
-
also want to make sure that all different functions are called in a
|
|
340
|
+
*also* want to make sure that all different functions are called in a
|
|
258
341
|
particular order. If so, set this to true.
|
|
342
|
+
|
|
343
|
+
* default: false
|
|
259
344
|
|
|
260
345
|
* `:framework`:
|
|
261
346
|
Currently the only option is `:unity.` Eventually if we support other
|
|
262
347
|
unity test frameworks (or if you write one for us), they'll get added
|
|
263
348
|
here.
|
|
349
|
+
|
|
350
|
+
: default: :unity
|
|
264
351
|
|
|
265
352
|
* `:includes`:
|
|
266
353
|
An array of additional include files which should be added to the
|
|
267
354
|
mocks. Useful for global types and definitions used in your project.
|
|
268
355
|
There are more specific versions if you care WHERE in the mock files
|
|
269
|
-
the includes get placed. You can define any or all of
|
|
270
|
-
|
|
271
|
-
|
|
356
|
+
the includes get placed. You can define any or all of these options.
|
|
357
|
+
|
|
358
|
+
* `:includes`
|
|
359
|
+
* `:includes_h_pre_orig_header`
|
|
360
|
+
* `:includes_h_post_orig_header`
|
|
361
|
+
* `:includes_c_pre_header`
|
|
362
|
+
* `:includes_c_post_header`
|
|
363
|
+
* default: nil #for all 5 options
|
|
272
364
|
|
|
273
365
|
* `:memcmp_if_unknown`:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
366
|
+
C developers create a lot of types, either through typedef or preprocessor
|
|
367
|
+
macros. CMock isn't going to automatically know what you were thinking all
|
|
368
|
+
the time (though it tries its best). If it comes across a type it doesn't
|
|
369
|
+
recognize, you have a choice on how you want it to handle it. It can either
|
|
370
|
+
perform a raw memory comparison and report any differences, or it can fail
|
|
371
|
+
with a meaningful message. Either way, this feature will only happen after
|
|
372
|
+
all other mechanisms have failed (The thing encountered isn't a standard
|
|
373
|
+
type. It isn't in the :treat_as list. It isn't in a custom unity_helper).
|
|
374
|
+
|
|
375
|
+
* default: true
|
|
376
|
+
|
|
279
377
|
* `:mock_path`:
|
|
280
378
|
The directory where you would like the mock files generated to be
|
|
281
379
|
placed.
|
|
380
|
+
|
|
381
|
+
* default: mocks
|
|
282
382
|
|
|
283
383
|
* `:mock_prefix`:
|
|
284
|
-
The prefix to
|
|
285
|
-
“USART.h” will get a mock called “MockUSART.c
|
|
384
|
+
The prefix to prepend to your mock files. For example, if it's “Mock”, a file
|
|
385
|
+
“USART.h” will get a mock called “MockUSART.c”. This CAN be used with a suffix
|
|
386
|
+
at the same time.
|
|
387
|
+
|
|
388
|
+
* default: Mock
|
|
286
389
|
|
|
287
390
|
* `:mock_suffix`:
|
|
288
|
-
The suffix to append to your mock files.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
* `:subdir`:
|
|
295
|
-
Relative subdir for your mocks. Set this to e.g. "sys" in order to
|
|
296
|
-
create mock for `sys/types.h` in `:mock_path`/sys/
|
|
391
|
+
The suffix to append to your mock files. For example, it it's "_Mock", a file
|
|
392
|
+
"USART.h" will get a mock called "USART_Mock.h". This CAN be used with a prefix
|
|
393
|
+
at the same time.
|
|
394
|
+
|
|
395
|
+
* default: ""
|
|
297
396
|
|
|
298
397
|
* `:plugins`:
|
|
299
|
-
An array of which plugins to enable. 'expect' is always active. Also
|
|
300
|
-
available currently
|
|
301
|
-
|
|
398
|
+
An array of which plugins to enable. ':expect' is always active. Also
|
|
399
|
+
available currently:
|
|
400
|
+
|
|
401
|
+
* `:ignore`
|
|
402
|
+
* `:ignore_arg`
|
|
403
|
+
* `:expect_any_args`
|
|
404
|
+
* `:array`
|
|
405
|
+
* `:cexception`
|
|
406
|
+
* `:callback`
|
|
407
|
+
* `:return_thru_ptr`
|
|
302
408
|
|
|
303
409
|
* `:strippables`:
|
|
304
|
-
An array containing a list of items to remove from the
|
|
305
|
-
|
|
306
|
-
|
|
410
|
+
An array containing a list of items to remove from the header
|
|
411
|
+
before deciding what should be mocked. This can be something simple
|
|
412
|
+
like a compiler extension CMock wouldn't recognize, or could be a
|
|
413
|
+
regex to reject certain function name patterns. This is a great way to
|
|
414
|
+
get rid of compiler extensions when your test compiler doesn't support
|
|
415
|
+
them. For example, use `:strippables: ['(?:functionName\s*\(+.*?\)+)']`
|
|
416
|
+
to prevent a function `functionName` from being mocked. By default, it
|
|
417
|
+
is ignoring all gcc attribute extensions.
|
|
418
|
+
|
|
419
|
+
* default: ['(?:__attribute__\s*\(+.*?\)+)']
|
|
420
|
+
|
|
421
|
+
* `:subdir`:
|
|
422
|
+
This is a relative subdirectory for your mocks. Set this to e.g. "sys" in
|
|
423
|
+
order to create a mock for `sys/types.h` in `(:mock_path)/sys/`.
|
|
424
|
+
|
|
425
|
+
* default: ""
|
|
307
426
|
|
|
308
427
|
* `:treat_as`:
|
|
309
428
|
The `:treat_as` list is a shortcut for when you have created typedefs
|
|
@@ -313,36 +432,105 @@ Defined in the yaml file, they look more like this:
|
|
|
313
432
|
did that one for you). Maybe you have a type that is a pointer to an
|
|
314
433
|
array of unsigned characters? No problem, just add 'UINT8_T*' =>
|
|
315
434
|
'HEX8*'
|
|
435
|
+
|
|
436
|
+
* NOTE: unlike the other options, your specifications MERGE with the
|
|
437
|
+
default list. Therefore, if you want to override something, you must
|
|
438
|
+
reassign it to something else (or to *nil* if you don't want it)
|
|
439
|
+
|
|
440
|
+
* default:
|
|
441
|
+
* 'int': 'INT'
|
|
442
|
+
* 'char': 'INT8'
|
|
443
|
+
* 'short': 'INT16'
|
|
444
|
+
* 'long': 'INT'
|
|
445
|
+
* 'int8': 'INT8'
|
|
446
|
+
* 'int16': 'INT16'
|
|
447
|
+
* 'int32': 'INT'
|
|
448
|
+
* 'int8_t': 'INT8'
|
|
449
|
+
* 'int16_t': 'INT16'
|
|
450
|
+
* 'int32_t': 'INT'
|
|
451
|
+
* 'INT8_T': 'INT8'
|
|
452
|
+
* 'INT16_T': 'INT16'
|
|
453
|
+
* 'INT32_T': 'INT'
|
|
454
|
+
* 'bool': 'INT'
|
|
455
|
+
* 'bool_t': 'INT'
|
|
456
|
+
* 'BOOL': 'INT'
|
|
457
|
+
* 'BOOL_T': 'INT'
|
|
458
|
+
* 'unsigned int': 'HEX32'
|
|
459
|
+
* 'unsigned long': 'HEX32'
|
|
460
|
+
* 'uint32': 'HEX32'
|
|
461
|
+
* 'uint32_t': 'HEX32'
|
|
462
|
+
* 'UINT32': 'HEX32'
|
|
463
|
+
* 'UINT32_T': 'HEX32'
|
|
464
|
+
* 'void*': 'HEX8_ARRAY'
|
|
465
|
+
* 'unsigned short': 'HEX16'
|
|
466
|
+
* 'uint16': 'HEX16'
|
|
467
|
+
* 'uint16_t': 'HEX16'
|
|
468
|
+
* 'UINT16': 'HEX16'
|
|
469
|
+
* 'UINT16_T': 'HEX16'
|
|
470
|
+
* 'unsigned char': 'HEX8'
|
|
471
|
+
* 'uint8': 'HEX8'
|
|
472
|
+
* 'uint8_t': 'HEX8'
|
|
473
|
+
* 'UINT8': 'HEX8'
|
|
474
|
+
* 'UINT8_T': 'HEX8'
|
|
475
|
+
* 'char*': 'STRING'
|
|
476
|
+
* 'pCHAR': 'STRING'
|
|
477
|
+
* 'cstring': 'STRING'
|
|
478
|
+
* 'CSTRING': 'STRING'
|
|
479
|
+
* 'float': 'FLOAT'
|
|
480
|
+
* 'double': 'FLOAT'
|
|
316
481
|
|
|
317
482
|
* `:treat_as_void`:
|
|
318
483
|
We've seen "fun" legacy systems typedef 'void' with a custom type,
|
|
319
484
|
like MY_VOID. Add any instances of those to this list to help CMock
|
|
320
485
|
understand how to deal with your code.
|
|
486
|
+
|
|
487
|
+
* default: []
|
|
321
488
|
|
|
322
489
|
* `:treat_externs`:
|
|
323
|
-
|
|
324
|
-
|
|
490
|
+
This specifies how you want CMock to handle functions that have been
|
|
491
|
+
marked as extern in the header file. Should it mock them?
|
|
492
|
+
|
|
493
|
+
* `:include` will mock externed functions
|
|
494
|
+
* `:exclude` will ignore externed functions (default).
|
|
325
495
|
|
|
326
496
|
* `:unity_helper_path`:
|
|
327
497
|
If you have created a header with your own extensions to unity to
|
|
328
498
|
handle your own types, you can set this argument to that path. CMock
|
|
329
499
|
will then automagically pull in your helpers and use them. The only
|
|
330
500
|
trick is that you make sure you follow the naming convention:
|
|
331
|
-
UNITY_TEST_ASSERT_EQUAL_YourType
|
|
501
|
+
`UNITY_TEST_ASSERT_EQUAL_YourType`. If it finds macros of the right
|
|
502
|
+
shape that match that pattern, it'll use them.
|
|
503
|
+
|
|
504
|
+
* default: []
|
|
332
505
|
|
|
333
506
|
* `:verbosity`:
|
|
334
|
-
|
|
335
|
-
|
|
507
|
+
How loud shoudl CMock be?
|
|
508
|
+
|
|
509
|
+
* 0 for errors only
|
|
510
|
+
* 1 for errors and warnings
|
|
511
|
+
* 2 for normal (default)
|
|
512
|
+
* 3 for verbose
|
|
513
|
+
|
|
514
|
+
* `:weak`:
|
|
515
|
+
When set this to some value, the generated mocks are defined as weak
|
|
516
|
+
symbols using the configured format. This allows them to be overridden
|
|
517
|
+
in particular tests.
|
|
518
|
+
|
|
519
|
+
* Set to '__attribute ((weak))' for weak mocks when using GCC.
|
|
520
|
+
* Set to any non-empty string for weak mocks when using IAR.
|
|
521
|
+
* default: ""
|
|
336
522
|
|
|
337
523
|
* `:when_no_prototypes`:
|
|
338
524
|
When you give CMock a header file and ask it to create a mock out of
|
|
339
525
|
it, it usually contains function prototypes (otherwise what was the
|
|
340
526
|
point?). You can control what happens when this isn't true. You can
|
|
341
|
-
set this to `:warn,` `:ignore,` or `:error
|
|
527
|
+
set this to `:warn,` `:ignore,` or `:error`
|
|
528
|
+
|
|
529
|
+
* default: :warn
|
|
342
530
|
|
|
343
531
|
* `:when_ptr`:
|
|
344
532
|
You can customize how CMock deals with pointers (c strings result in
|
|
345
|
-
string comparisons... we're talking about other pointers here). Your
|
|
533
|
+
string comparisons... we're talking about **other** pointers here). Your
|
|
346
534
|
options are `:compare_ptr` to just verify the pointers are the same,
|
|
347
535
|
`:compare_data` or `:smart` to verify that the data is the same.
|
|
348
536
|
`:compare_data` and `:smart` behaviors will change slightly based on
|
|
@@ -350,42 +538,51 @@ Defined in the yaml file, they look more like this:
|
|
|
350
538
|
single element of what is being pointed to. So if you have a pointer
|
|
351
539
|
to a struct called ORGAN_T, it will compare one ORGAN_T (whatever that
|
|
352
540
|
is).
|
|
541
|
+
|
|
542
|
+
* default: :smart
|
|
353
543
|
|
|
354
544
|
|
|
355
545
|
Compiled Options:
|
|
356
546
|
-----------------
|
|
357
547
|
|
|
358
548
|
A number of #defines also exist for customizing the cmock experience.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
The way to align your data to. Not everything is as flexible as
|
|
376
|
-
a PC, as most embedded designers know. This defaults to 2, meaning
|
|
377
|
-
align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment
|
|
378
|
-
by setting 0, force alignment to the closest uint16 with 1 or even
|
|
379
|
-
to the closest uint64 with 3.
|
|
380
|
-
|
|
381
|
-
CMOCK_MEM_PTR_AS_INT
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
549
|
+
Feel free to pass these into your compiler or whatever is most
|
|
550
|
+
convenient. CMock will otherwise do its best to guess what you want
|
|
551
|
+
based on other settings, particularly Unity's settings.
|
|
552
|
+
|
|
553
|
+
* `CMOCK_MEM_STATIC` or `CMOCK_MEM_DYNAMIC`
|
|
554
|
+
Define one of these to determine if you want to dynamically add
|
|
555
|
+
memory during tests as required from the heap. If static, you
|
|
556
|
+
can control the total footprint of Cmock. If dynamic, you will
|
|
557
|
+
need to make sure you make some heap space available for Cmock.
|
|
558
|
+
|
|
559
|
+
* `CMOCK_MEM_SIZE`
|
|
560
|
+
In static mode this is the total amount of memory you are allocating
|
|
561
|
+
to Cmock. In Dynamic mode this is the size of each chunk allocated
|
|
562
|
+
at once (larger numbers grab more memory but require less mallocs).
|
|
563
|
+
|
|
564
|
+
* `CMOCK_MEM_ALIGN`
|
|
565
|
+
The way to align your data to. Not everything is as flexible as
|
|
566
|
+
a PC, as most embedded designers know. This defaults to 2, meaning
|
|
567
|
+
align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment
|
|
568
|
+
by setting 0, force alignment to the closest uint16 with 1 or even
|
|
569
|
+
to the closest uint64 with 3.
|
|
570
|
+
|
|
571
|
+
* `CMOCK_MEM_PTR_AS_INT`
|
|
572
|
+
This is used internally to hold pointers... it needs to be big
|
|
573
|
+
enough. On most processors a pointer is the same as an unsigned
|
|
574
|
+
long... but maybe that's not true for yours?
|
|
575
|
+
|
|
576
|
+
* `CMOCK_MEM_INDEX_TYPE`
|
|
577
|
+
This needs to be something big enough to point anywhere in Cmock's
|
|
578
|
+
memory space... usually it's an unsigned int.
|
|
579
|
+
|
|
580
|
+
Examples
|
|
581
|
+
========
|
|
582
|
+
|
|
583
|
+
You can look in the examples directory for a couple of examples on how
|
|
584
|
+
you might tool CMock into your build process. You may also want to consider
|
|
585
|
+
using [Ceedling](https://throwtheswitch.org/Ceedling). Please note that
|
|
586
|
+
these examples are meant to show how the build process works. They have
|
|
587
|
+
failing tests ON PURPOSE to show what that would look like. Don't be alarmed. ;)
|
|
391
588
|
|