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
|
@@ -2,7 +2,7 @@ Unity Test API
|
|
|
2
2
|
==============
|
|
3
3
|
|
|
4
4
|
[](https://travis-ci.org/ThrowTheSwitch/Unity)
|
|
5
|
-
__Copyright (c) 2007 -
|
|
5
|
+
__Copyright (c) 2007 - 2017 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
|
|
6
6
|
|
|
7
7
|
Running Tests
|
|
8
8
|
-------------
|
|
@@ -41,13 +41,13 @@ Example:
|
|
|
41
41
|
|
|
42
42
|
main()
|
|
43
43
|
{
|
|
44
|
-
if (TEST_PROTECT()
|
|
44
|
+
if (TEST_PROTECT())
|
|
45
45
|
{
|
|
46
46
|
MyTest();
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
If MyTest calls `TEST_ABORT`, program control will immediately return to `TEST_PROTECT` with a
|
|
50
|
+
If MyTest calls `TEST_ABORT`, program control will immediately return to `TEST_PROTECT` with a return value of zero.
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
Unity Assertion Summary
|
|
@@ -109,6 +109,18 @@ Compares two integers for equality and display errors as hexadecimal. Like the
|
|
|
109
109
|
you can specify the size... here the size will also effect how many nibbles are shown (for example, `HEX16`
|
|
110
110
|
will show 4 nibbles).
|
|
111
111
|
|
|
112
|
+
TEST_ASSERT_EQUAL(expected, actual)
|
|
113
|
+
|
|
114
|
+
Another way of calling TEST_ASSERT_EQUAL_INT
|
|
115
|
+
|
|
116
|
+
TEST_ASSERT_INT_WITHIN(delta, expected, actual)
|
|
117
|
+
|
|
118
|
+
Asserts that the actual value is within plus or minus delta of the expected value. This also comes in
|
|
119
|
+
size specific variants.
|
|
120
|
+
|
|
121
|
+
Arrays
|
|
122
|
+
------
|
|
123
|
+
|
|
112
124
|
_ARRAY
|
|
113
125
|
|
|
114
126
|
You can append `_ARRAY` to any of these macros to make an array comparison of that type. Here you will
|
|
@@ -117,15 +129,12 @@ additional argument which is the number of elements to compare. For example:
|
|
|
117
129
|
|
|
118
130
|
TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements)
|
|
119
131
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Another way of calling TEST_ASSERT_EQUAL_INT
|
|
123
|
-
|
|
124
|
-
TEST_ASSERT_INT_WITHIN(delta, expected, actual)
|
|
132
|
+
_EACH_EQUAL
|
|
125
133
|
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
Another array comparison option is to check that EVERY element of an array is equal to a single expected
|
|
135
|
+
value. You do this by specifying the EACH_EQUAL macro. For example:
|
|
128
136
|
|
|
137
|
+
TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements)
|
|
129
138
|
|
|
130
139
|
Numerical Assertions: Bitwise
|
|
131
140
|
-----------------------------
|
|
@@ -4,63 +4,62 @@
|
|
|
4
4
|
# [Released under MIT License. Please refer to license.txt for details]
|
|
5
5
|
# ==========================================
|
|
6
6
|
|
|
7
|
-
if RUBY_PLATFORM
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
if RUBY_PLATFORM =~ /(win|w)32$/
|
|
8
|
+
begin
|
|
9
|
+
require 'Win32API'
|
|
10
|
+
rescue LoadError
|
|
11
|
+
puts 'ERROR! "Win32API" library not found'
|
|
12
|
+
puts '"Win32API" is required for colour on a windows machine'
|
|
13
|
+
puts ' try => "gem install Win32API" on the command line'
|
|
14
|
+
puts
|
|
15
|
+
end
|
|
16
|
+
# puts
|
|
17
17
|
# puts 'Windows Environment Detected...'
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
# puts 'Win32API Library Found.'
|
|
19
|
+
# puts
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
class ColourCommandLine
|
|
23
23
|
def initialize
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
end
|
|
24
|
+
return unless RUBY_PLATFORM =~ /(win|w)32$/
|
|
25
|
+
get_std_handle = Win32API.new('kernel32', 'GetStdHandle', ['L'], 'L')
|
|
26
|
+
@set_console_txt_attrb =
|
|
27
|
+
Win32API.new('kernel32', 'SetConsoleTextAttribute', %w(L N), 'I')
|
|
28
|
+
@hout = get_std_handle.call(-11)
|
|
30
29
|
end
|
|
31
30
|
|
|
32
31
|
def change_to(new_colour)
|
|
33
|
-
if RUBY_PLATFORM
|
|
34
|
-
@set_console_txt_attrb.call(@hout,
|
|
32
|
+
if RUBY_PLATFORM =~ /(win|w)32$/
|
|
33
|
+
@set_console_txt_attrb.call(@hout, win32_colour(new_colour))
|
|
35
34
|
else
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
"\033[30;#{posix_colour(new_colour)};22m"
|
|
36
|
+
end
|
|
38
37
|
end
|
|
39
38
|
|
|
40
39
|
def win32_colour(colour)
|
|
41
40
|
case colour
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
when :black then 0
|
|
42
|
+
when :dark_blue then 1
|
|
43
|
+
when :dark_green then 2
|
|
44
|
+
when :dark_cyan then 3
|
|
45
|
+
when :dark_red then 4
|
|
46
|
+
when :dark_purple then 5
|
|
47
|
+
when :dark_yellow, :narrative then 6
|
|
48
|
+
when :default_white, :default, :dark_white then 7
|
|
49
|
+
when :silver then 8
|
|
50
|
+
when :blue then 9
|
|
51
|
+
when :green, :success then 10
|
|
52
|
+
when :cyan, :output then 11
|
|
53
|
+
when :red, :failure then 12
|
|
54
|
+
when :purple then 13
|
|
55
|
+
when :yellow then 14
|
|
56
|
+
when :white then 15
|
|
57
|
+
else
|
|
58
|
+
0
|
|
60
59
|
end
|
|
61
60
|
end
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
def posix_colour(colour)
|
|
64
63
|
# ANSI Escape Codes - Foreground colors
|
|
65
64
|
# | Code | Color |
|
|
66
65
|
# | 39 | Default foreground color |
|
|
@@ -81,35 +80,39 @@ class ColourCommandLine
|
|
|
81
80
|
# | 96 | Light cyan |
|
|
82
81
|
# | 97 | White |
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
case colour
|
|
84
|
+
when :black then 30
|
|
85
|
+
when :red, :failure then 31
|
|
86
|
+
when :green, :success then 32
|
|
87
|
+
when :yellow then 33
|
|
88
|
+
when :blue, :narrative then 34
|
|
89
|
+
when :purple, :magenta then 35
|
|
90
|
+
when :cyan, :output then 36
|
|
91
|
+
when :white, :default_white then 37
|
|
92
|
+
when :default then 39
|
|
93
|
+
else
|
|
94
|
+
39
|
|
96
95
|
end
|
|
97
96
|
end
|
|
98
97
|
|
|
99
98
|
def out_c(mode, colour, str)
|
|
100
99
|
case RUBY_PLATFORM
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
when /(win|w)32$/
|
|
101
|
+
change_to(colour)
|
|
102
|
+
$stdout.puts str if mode == :puts
|
|
103
|
+
$stdout.print str if mode == :print
|
|
104
|
+
change_to(:default_white)
|
|
105
|
+
else
|
|
106
|
+
$stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts
|
|
107
|
+
$stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print
|
|
108
|
+
end
|
|
110
109
|
end
|
|
111
110
|
end # ColourCommandLine
|
|
112
111
|
|
|
113
|
-
def colour_puts(role,
|
|
114
|
-
|
|
112
|
+
def colour_puts(role, str)
|
|
113
|
+
ColourCommandLine.new.out_c(:puts, role, str)
|
|
114
|
+
end
|
|
115
115
|
|
|
116
|
+
def colour_print(role, str)
|
|
117
|
+
ColourCommandLine.new.out_c(:print, role, str)
|
|
118
|
+
end
|
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
# Unity Project - A Test Framework 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
|
require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt"
|
|
8
8
|
|
|
9
9
|
$colour_output = true
|
|
10
10
|
|
|
11
11
|
def report(message)
|
|
12
|
-
if
|
|
12
|
+
if !$colour_output
|
|
13
13
|
$stdout.puts(message)
|
|
14
14
|
else
|
|
15
|
-
message = message.join('\n') if
|
|
15
|
+
message = message.join('\n') if message.class == Array
|
|
16
16
|
message.each_line do |line|
|
|
17
17
|
line.chomp!
|
|
18
|
-
colour = case
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
colour = case line
|
|
19
|
+
when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
|
|
20
|
+
Regexp.last_match(1).to_i.zero? ? :green : :red
|
|
21
|
+
when /PASS/
|
|
22
|
+
:green
|
|
23
|
+
when /^OK$/
|
|
24
|
+
:green
|
|
25
|
+
when /(?:FAIL|ERROR)/
|
|
26
|
+
:red
|
|
27
|
+
when /IGNORE/
|
|
28
|
+
:yellow
|
|
29
|
+
when /^(?:Creating|Compiling|Linking)/
|
|
30
|
+
:white
|
|
31
|
+
else
|
|
32
|
+
:silver
|
|
33
|
+
end
|
|
34
34
|
colour_puts(colour, line)
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
$stdout.flush
|
|
38
38
|
$stderr.flush
|
|
39
|
-
end
|
|
39
|
+
end
|
|
@@ -12,8 +12,8 @@ require 'rubygems'
|
|
|
12
12
|
require 'fileutils'
|
|
13
13
|
require 'pathname'
|
|
14
14
|
|
|
15
|
-
#TEMPLATE_TST
|
|
16
|
-
TEMPLATE_TST ||=
|
|
15
|
+
# TEMPLATE_TST
|
|
16
|
+
TEMPLATE_TST ||= '#include "unity.h"
|
|
17
17
|
%2$s#include "%1$s.h"
|
|
18
18
|
|
|
19
19
|
void setUp(void)
|
|
@@ -28,115 +28,118 @@ void test_%1$s_NeedToImplement(void)
|
|
|
28
28
|
{
|
|
29
29
|
TEST_IGNORE_MESSAGE("Need to Implement %1$s");
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
'.freeze
|
|
32
32
|
|
|
33
|
-
#TEMPLATE_SRC
|
|
34
|
-
TEMPLATE_SRC ||= %
|
|
35
|
-
|
|
33
|
+
# TEMPLATE_SRC
|
|
34
|
+
TEMPLATE_SRC ||= '%2$s#include "%1$s.h"
|
|
35
|
+
'.freeze
|
|
36
36
|
|
|
37
|
-
#TEMPLATE_INC
|
|
38
|
-
TEMPLATE_INC ||=
|
|
37
|
+
# TEMPLATE_INC
|
|
38
|
+
TEMPLATE_INC ||= '#ifndef _%3$s_H
|
|
39
39
|
#define _%3$s_H
|
|
40
40
|
%2$s
|
|
41
41
|
|
|
42
42
|
#endif // _%3$s_H
|
|
43
|
-
|
|
43
|
+
'.freeze
|
|
44
44
|
|
|
45
45
|
class UnityModuleGenerator
|
|
46
|
-
|
|
47
46
|
############################
|
|
48
|
-
def initialize(options=nil)
|
|
49
|
-
|
|
47
|
+
def initialize(options = nil)
|
|
50
48
|
here = File.expand_path(File.dirname(__FILE__)) + '/'
|
|
51
49
|
|
|
52
50
|
@options = UnityModuleGenerator.default_options
|
|
53
|
-
case
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
case options
|
|
52
|
+
when NilClass then @options
|
|
53
|
+
when String then @options.merge!(UnityModuleGenerator.grab_config(options))
|
|
54
|
+
when Hash then @options.merge!(options)
|
|
55
|
+
else raise 'If you specify arguments, it should be a filename or a hash of options'
|
|
58
56
|
end
|
|
59
57
|
|
|
60
58
|
# Create default file paths if none were provided
|
|
61
|
-
@options[:path_src] = here +
|
|
59
|
+
@options[:path_src] = here + '../src/' if @options[:path_src].nil?
|
|
62
60
|
@options[:path_inc] = @options[:path_src] if @options[:path_inc].nil?
|
|
63
|
-
@options[:path_tst] = here +
|
|
64
|
-
@options[:path_src] += '/' unless
|
|
65
|
-
@options[:path_inc] += '/' unless
|
|
66
|
-
@options[:path_tst] += '/' unless
|
|
67
|
-
|
|
68
|
-
#Built in patterns
|
|
69
|
-
@patterns = {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
61
|
+
@options[:path_tst] = here + '../test/' if @options[:path_tst].nil?
|
|
62
|
+
@options[:path_src] += '/' unless @options[:path_src][-1] == 47
|
|
63
|
+
@options[:path_inc] += '/' unless @options[:path_inc][-1] == 47
|
|
64
|
+
@options[:path_tst] += '/' unless @options[:path_tst][-1] == 47
|
|
65
|
+
|
|
66
|
+
# Built in patterns
|
|
67
|
+
@patterns = {
|
|
68
|
+
'src' => {
|
|
69
|
+
'' => { inc: [] }
|
|
70
|
+
},
|
|
71
|
+
'test' => {
|
|
72
|
+
'' => { inc: [] }
|
|
73
|
+
},
|
|
74
|
+
'dh' => {
|
|
75
|
+
'Driver' => { inc: [create_filename('%1$s', 'Hardware.h')] },
|
|
76
|
+
'Hardware' => { inc: [] }
|
|
77
|
+
},
|
|
78
|
+
'dih' => {
|
|
79
|
+
'Driver' => { inc: [create_filename('%1$s', 'Hardware.h'), create_filename('%1$s', 'Interrupt.h')] },
|
|
80
|
+
'Interrupt' => { inc: [create_filename('%1$s', 'Hardware.h')] },
|
|
81
|
+
'Hardware' => { inc: [] }
|
|
82
|
+
},
|
|
83
|
+
'mch' => {
|
|
84
|
+
'Model' => { inc: [] },
|
|
85
|
+
'Conductor' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'Hardware.h')] },
|
|
86
|
+
'Hardware' => { inc: [] }
|
|
87
|
+
},
|
|
88
|
+
'mvp' => {
|
|
89
|
+
'Model' => { inc: [] },
|
|
90
|
+
'Presenter' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'View.h')] },
|
|
91
|
+
'View' => { inc: [] }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
87
94
|
end
|
|
88
95
|
|
|
89
96
|
############################
|
|
90
97
|
def self.default_options
|
|
91
98
|
{
|
|
92
|
-
:
|
|
93
|
-
:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
:tst => [],
|
|
99
|
+
pattern: 'src',
|
|
100
|
+
includes: {
|
|
101
|
+
src: [],
|
|
102
|
+
inc: [],
|
|
103
|
+
tst: []
|
|
98
104
|
},
|
|
99
|
-
:
|
|
100
|
-
:
|
|
101
|
-
:
|
|
102
|
-
:
|
|
105
|
+
update_svn: false,
|
|
106
|
+
boilerplates: {},
|
|
107
|
+
test_prefix: 'Test',
|
|
108
|
+
mock_prefix: 'Mock'
|
|
103
109
|
}
|
|
104
110
|
end
|
|
105
111
|
|
|
106
112
|
############################
|
|
107
113
|
def self.grab_config(config_file)
|
|
108
|
-
options =
|
|
109
|
-
unless
|
|
114
|
+
options = default_options
|
|
115
|
+
unless config_file.nil? || config_file.empty?
|
|
110
116
|
require 'yaml'
|
|
111
117
|
yaml_guts = YAML.load_file(config_file)
|
|
112
118
|
options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
|
|
113
119
|
raise "No :unity or :cmock section found in #{config_file}" unless options
|
|
114
120
|
end
|
|
115
|
-
|
|
121
|
+
options
|
|
116
122
|
end
|
|
117
123
|
|
|
118
124
|
############################
|
|
119
|
-
def files_to_operate_on(module_name, pattern=nil)
|
|
120
|
-
#strip any leading path information from the module name and save for later
|
|
125
|
+
def files_to_operate_on(module_name, pattern = nil)
|
|
126
|
+
# strip any leading path information from the module name and save for later
|
|
121
127
|
subfolder = File.dirname(module_name)
|
|
122
128
|
module_name = File.basename(module_name)
|
|
123
129
|
|
|
124
|
-
#create triad definition
|
|
130
|
+
# create triad definition
|
|
125
131
|
prefix = @options[:test_prefix] || 'Test'
|
|
126
|
-
triad = [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
]
|
|
132
|
+
triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] },
|
|
133
|
+
{ ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] },
|
|
134
|
+
{ ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }]
|
|
130
135
|
|
|
131
|
-
#prepare the pattern for use
|
|
136
|
+
# prepare the pattern for use
|
|
132
137
|
pattern = (pattern || @options[:pattern] || 'src').downcase
|
|
133
138
|
patterns = @patterns[pattern]
|
|
134
139
|
raise "ERROR: The design pattern '#{pattern}' specified isn't one that I recognize!" if patterns.nil?
|
|
135
140
|
|
|
136
|
-
#single file patterns (currently just 'test') can reject the other parts of the triad
|
|
137
|
-
if
|
|
138
|
-
triad.reject!{|v| v[:inc] != :tst }
|
|
139
|
-
end
|
|
141
|
+
# single file patterns (currently just 'test') can reject the other parts of the triad
|
|
142
|
+
triad.select! { |v| v[:inc] == :tst } if pattern == 'test'
|
|
140
143
|
|
|
141
144
|
# Assemble the path/names of the files we need to work with.
|
|
142
145
|
files = []
|
|
@@ -145,26 +148,26 @@ class UnityModuleGenerator
|
|
|
145
148
|
submodule_name = create_filename(module_name, pattern_file)
|
|
146
149
|
filename = cfg[:prefix] + submodule_name + cfg[:ext]
|
|
147
150
|
files << {
|
|
148
|
-
:
|
|
149
|
-
:
|
|
150
|
-
:
|
|
151
|
-
:
|
|
152
|
-
:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
path: (Pathname.new("#{cfg[:path]}#{subfolder}") + filename).cleanpath,
|
|
152
|
+
name: submodule_name,
|
|
153
|
+
template: cfg[:template],
|
|
154
|
+
boilerplate: cfg[:boilerplate],
|
|
155
|
+
includes: case (cfg[:inc])
|
|
156
|
+
when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) })
|
|
157
|
+
when :inc then (@options[:includes][:inc] || [])
|
|
158
|
+
when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) })
|
|
159
|
+
end
|
|
157
160
|
}
|
|
158
161
|
end
|
|
159
162
|
end
|
|
160
163
|
|
|
161
|
-
|
|
164
|
+
files
|
|
162
165
|
end
|
|
163
166
|
|
|
164
167
|
############################
|
|
165
|
-
def create_filename(part1, part2=
|
|
168
|
+
def create_filename(part1, part2 = '')
|
|
166
169
|
if part2.empty?
|
|
167
|
-
case(@options[:naming])
|
|
170
|
+
case (@options[:naming])
|
|
168
171
|
when 'bumpy' then part1
|
|
169
172
|
when 'camel' then part1
|
|
170
173
|
when 'snake' then part1.downcase
|
|
@@ -172,39 +175,45 @@ class UnityModuleGenerator
|
|
|
172
175
|
else part1.downcase
|
|
173
176
|
end
|
|
174
177
|
else
|
|
175
|
-
case(@options[:naming])
|
|
178
|
+
case (@options[:naming])
|
|
176
179
|
when 'bumpy' then part1 + part2
|
|
177
180
|
when 'camel' then part1 + part2
|
|
178
|
-
when 'snake' then part1.downcase +
|
|
179
|
-
when 'caps' then part1.upcase +
|
|
180
|
-
else part1.downcase +
|
|
181
|
+
when 'snake' then part1.downcase + '_' + part2.downcase
|
|
182
|
+
when 'caps' then part1.upcase + '_' + part2.upcase
|
|
183
|
+
else part1.downcase + '_' + part2.downcase
|
|
181
184
|
end
|
|
182
185
|
end
|
|
183
186
|
end
|
|
184
187
|
|
|
185
188
|
############################
|
|
186
|
-
def generate(module_name, pattern=nil)
|
|
187
|
-
|
|
189
|
+
def generate(module_name, pattern = nil)
|
|
188
190
|
files = files_to_operate_on(module_name, pattern)
|
|
189
191
|
|
|
190
|
-
#Abort if
|
|
192
|
+
# Abort if all of the module files already exist
|
|
193
|
+
all_files_exist = true
|
|
191
194
|
files.each do |file|
|
|
192
|
-
|
|
195
|
+
all_files_exist = false unless File.exist?(file[:path])
|
|
193
196
|
end
|
|
197
|
+
raise "ERROR: File #{files[0][:name]} already exists. Exiting." if all_files_exist
|
|
194
198
|
|
|
195
199
|
# Create Source Modules
|
|
196
|
-
files.each_with_index do |file,
|
|
197
|
-
|
|
200
|
+
files.each_with_index do |file, _i|
|
|
201
|
+
# If this file already exists, don't overwrite it.
|
|
202
|
+
if File.exist?(file[:path])
|
|
203
|
+
puts "File #{file[:path]} already exists!"
|
|
204
|
+
next
|
|
205
|
+
end
|
|
206
|
+
# Create the path first if necessary.
|
|
207
|
+
FileUtils.mkdir_p(File.dirname(file[:path]), verbose: false)
|
|
198
208
|
File.open(file[:path], 'w') do |f|
|
|
199
209
|
f.write("#{file[:boilerplate]}\n" % [file[:name]]) unless file[:boilerplate].nil?
|
|
200
|
-
f.write(file[:template] % [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
)
|
|
210
|
+
f.write(file[:template] % [file[:name],
|
|
211
|
+
file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join,
|
|
212
|
+
file[:name].upcase])
|
|
204
213
|
end
|
|
205
|
-
if
|
|
214
|
+
if @options[:update_svn]
|
|
206
215
|
`svn add \"#{file[:path]}\"`
|
|
207
|
-
if
|
|
216
|
+
if $!.exitstatus.zero?
|
|
208
217
|
puts "File #{file[:path]} created and added to source control"
|
|
209
218
|
else
|
|
210
219
|
puts "File #{file[:path]} created but FAILED adding to source control!"
|
|
@@ -217,8 +226,7 @@ class UnityModuleGenerator
|
|
|
217
226
|
end
|
|
218
227
|
|
|
219
228
|
############################
|
|
220
|
-
def destroy(module_name, pattern=nil)
|
|
221
|
-
|
|
229
|
+
def destroy(module_name, pattern = nil)
|
|
222
230
|
files_to_operate_on(module_name, pattern).each do |filespec|
|
|
223
231
|
file = filespec[:path]
|
|
224
232
|
if File.exist?(file)
|
|
@@ -233,66 +241,65 @@ class UnityModuleGenerator
|
|
|
233
241
|
puts "File #{file} does not exist so cannot be removed."
|
|
234
242
|
end
|
|
235
243
|
end
|
|
236
|
-
puts
|
|
244
|
+
puts 'Destroy Complete'
|
|
237
245
|
end
|
|
238
|
-
|
|
239
246
|
end
|
|
240
247
|
|
|
241
248
|
############################
|
|
242
|
-
#Handle As Command Line If Called That Way
|
|
243
|
-
if
|
|
249
|
+
# Handle As Command Line If Called That Way
|
|
250
|
+
if $0 == __FILE__
|
|
244
251
|
destroy = false
|
|
245
|
-
options = {
|
|
252
|
+
options = {}
|
|
246
253
|
module_name = nil
|
|
247
254
|
|
|
248
255
|
# Parse the command line parameters.
|
|
249
256
|
ARGV.each do |arg|
|
|
250
|
-
case
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
257
|
+
case arg
|
|
258
|
+
when /^-d/ then destroy = true
|
|
259
|
+
when /^-u/ then options[:update_svn] = true
|
|
260
|
+
when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1)
|
|
261
|
+
when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1)
|
|
262
|
+
when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1)
|
|
263
|
+
when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1)
|
|
264
|
+
when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1)
|
|
265
|
+
when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1))
|
|
266
|
+
when /^(\w+)/
|
|
267
|
+
raise "ERROR: You can't have more than one Module name specified!" unless module_name.nil?
|
|
268
|
+
module_name = arg
|
|
269
|
+
when /^-(h|-help)/
|
|
270
|
+
ARGV = [].freeze
|
|
271
|
+
else
|
|
272
|
+
raise "ERROR: Unknown option specified '#{arg}'"
|
|
266
273
|
end
|
|
267
274
|
end
|
|
268
275
|
|
|
269
|
-
|
|
270
|
-
puts [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
276
|
+
unless ARGV[0]
|
|
277
|
+
puts ["\nGENERATE MODULE\n-------- ------",
|
|
278
|
+
"\nUsage: ruby generate_module [options] module_name",
|
|
279
|
+
" -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)",
|
|
280
|
+
" -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)",
|
|
281
|
+
" -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)",
|
|
282
|
+
' -p"MCH" sets the output pattern to MCH.',
|
|
283
|
+
' dh - driver hardware.',
|
|
284
|
+
' dih - driver interrupt hardware.',
|
|
285
|
+
' mch - model conductor hardware.',
|
|
286
|
+
' mvp - model view presenter.',
|
|
287
|
+
' src - just a source module, header and test. (DEFAULT)',
|
|
288
|
+
' test - just a test file.',
|
|
289
|
+
' -d destroy module instead of creating it.',
|
|
290
|
+
' -n"camel" sets the file naming convention.',
|
|
291
|
+
' bumpy - BumpyCaseFilenames.',
|
|
292
|
+
' camel - camelCaseFilenames.',
|
|
293
|
+
' snake - snake_case_filenames. (DEFAULT)',
|
|
294
|
+
' caps - CAPS_CASE_FILENAMES.',
|
|
295
|
+
' -u update subversion too (requires subversion command line)',
|
|
296
|
+
' -y"my.yml" selects a different yaml config file for module generation',
|
|
297
|
+
''].join("\n")
|
|
291
298
|
exit
|
|
292
299
|
end
|
|
293
300
|
|
|
294
|
-
raise
|
|
295
|
-
if
|
|
301
|
+
raise 'ERROR: You must have a Module name specified! (use option -h for help)' if module_name.nil?
|
|
302
|
+
if destroy
|
|
296
303
|
UnityModuleGenerator.new(options).destroy(module_name)
|
|
297
304
|
else
|
|
298
305
|
UnityModuleGenerator.new(options).generate(module_name)
|