ceedling 0.25.0 → 0.27.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,18 +1,20 @@
|
|
1
1
|
CC = gcc
|
2
2
|
ifeq ($(shell uname -s), Darwin)
|
3
3
|
CC = clang
|
4
|
-
CFLAGS += -std=c99 -pedantic -Wall -Weverything -Werror
|
5
|
-
CFLAGS += -Wno-unknown-warning-option -Wno-switch-enum
|
6
|
-
CFLAGS += -Wno-padded -Wno-double-promotion -Wno-missing-noreturn
|
7
|
-
CFLAGS += -Wno-missing-prototypes
|
8
4
|
endif
|
9
|
-
ifeq ($(
|
10
|
-
|
5
|
+
ifeq ($(findstring clang, $(CC)), clang)
|
6
|
+
E = -Weverything
|
7
|
+
CFLAGS += $E -Wno-unknown-warning-option -Wno-missing-prototypes
|
8
|
+
CFLAGS += -Wno-unused-macros -Wno-padded -Wno-missing-noreturn
|
11
9
|
endif
|
10
|
+
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Wconversion -Werror
|
11
|
+
CFLAGS += -Wno-switch-enum -Wno-double-promotion
|
12
|
+
CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \
|
13
|
+
-Wstrict-prototypes -Wswitch-default -Wundef
|
12
14
|
#DEBUG = -O0 -g
|
13
15
|
CFLAGS += $(DEBUG)
|
14
16
|
DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy
|
15
|
-
DEFINES += -D UNITY_SUPPORT_64 -D UNITY_INCLUDE_DOUBLE
|
17
|
+
DEFINES += -D UNITY_SUPPORT_64 -D UNITY_INCLUDE_DOUBLE
|
16
18
|
SRC = ../src/unity.c tests/testunity.c build/testunityRunner.c
|
17
19
|
INC_DIR = -I ../src
|
18
20
|
COV_FLAGS = -fprofile-arcs -ftest-coverage -I ../../src
|
@@ -23,18 +25,16 @@ TARGET = build/testunity-cov.exe
|
|
23
25
|
# For verbose output of all the tests, run 'make test'.
|
24
26
|
default: coverage
|
25
27
|
.PHONY: default coverage test clean
|
28
|
+
coverage: DEFINES += -D UNITY_NO_WEAK
|
26
29
|
coverage: $(BUILD_DIR)/testunityRunner.c
|
27
30
|
cd $(BUILD_DIR) && \
|
28
31
|
$(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC), ../$i) $(COV_FLAGS) -o ../$(TARGET)
|
29
32
|
rm -f $(BUILD_DIR)/*.gcda
|
30
|
-
./$(TARGET) | grep Tests -A1
|
33
|
+
./$(TARGET) | grep 'Tests\|]]]' -A1
|
31
34
|
cd $(BUILD_DIR) && \
|
32
35
|
gcov unity.c | head -3
|
33
36
|
grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true
|
34
37
|
|
35
|
-
test: CFLAGS += -Wbad-function-cast -Wcast-qual -Wconversion -Wformat=2 -Wold-style-definition \
|
36
|
-
-Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wstrict-prototypes \
|
37
|
-
-Wswitch-default -Wundef -Wunreachable-code -Wunused -fstrict-aliasing
|
38
38
|
test: $(BUILD_DIR)/testunityRunner.c
|
39
39
|
$(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC) -o $(TARGET)
|
40
40
|
./$(TARGET)
|
@@ -50,14 +50,14 @@ $(BUILD_DIR)/testunityRunner.c: tests/testunity.c | $(BUILD_DIR)
|
|
50
50
|
|
51
51
|
AWK_SCRIPT=\
|
52
52
|
'/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0; line[u++]=NR } \
|
53
|
-
END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ;
|
54
|
-
for (i=0; i<d; i++) { print declarations[i] ";" }
|
55
|
-
|
56
|
-
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ", " line[i] ");" }
|
57
|
-
|
53
|
+
END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ; \
|
54
|
+
for (i=0; i<d; i++) { print declarations[i] ";" } \
|
55
|
+
print "int main(void)\n{\n UnityBegin(\"" FILENAME "\");" ; \
|
56
|
+
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ", " line[i] ");" } \
|
57
|
+
print " return UNITY_END();\n}" }'
|
58
58
|
|
59
59
|
$(BUILD_DIR):
|
60
60
|
mkdir -p $(BUILD_DIR)
|
61
61
|
|
62
62
|
clean:
|
63
|
-
rm -f $(
|
63
|
+
rm -f $(TARGET) $(BUILD_DIR)/*.gc* $(BUILD_DIR)/testunityRunner.c
|
@@ -10,9 +10,11 @@ $verbose = false
|
|
10
10
|
require 'rake'
|
11
11
|
require 'rake/clean'
|
12
12
|
require UNITY_ROOT + 'rakefile_helper'
|
13
|
+
require 'rspec/core/rake_task'
|
13
14
|
|
14
15
|
TEMP_DIRS = [
|
15
|
-
File.join(UNITY_ROOT, 'build')
|
16
|
+
File.join(UNITY_ROOT, 'build'),
|
17
|
+
File.join(UNITY_ROOT, 'sandbox')
|
16
18
|
]
|
17
19
|
|
18
20
|
TEMP_DIRS.each do |dir|
|
@@ -30,7 +32,7 @@ configure_toolchain(DEFAULT_CONFIG_FILE)
|
|
30
32
|
|
31
33
|
desc "Test unity with its own unit tests"
|
32
34
|
task :unit => [:prepare_for_tests] do
|
33
|
-
run_tests
|
35
|
+
run_tests unit_test_files
|
34
36
|
end
|
35
37
|
|
36
38
|
desc "Test unity's helper scripts"
|
@@ -40,13 +42,18 @@ task :scripts => [:prepare_for_tests] do
|
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
45
|
+
desc "Run all rspecs"
|
46
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
47
|
+
t.pattern = 'spec/**/*_spec.rb'
|
48
|
+
end
|
49
|
+
|
43
50
|
desc "Generate test summary"
|
44
51
|
task :summary do
|
45
52
|
report_summary
|
46
53
|
end
|
47
54
|
|
48
55
|
desc "Build and test Unity"
|
49
|
-
task :all => [:clean, :prepare_for_tests, :scripts, :unit, :summary]
|
56
|
+
task :all => [:clean, :prepare_for_tests, :scripts, :unit, :style, :summary]
|
50
57
|
task :default => [:clobber, :all]
|
51
58
|
task :ci => [:no_color, :default]
|
52
59
|
task :cruise => [:no_color, :default]
|
@@ -63,3 +70,56 @@ end
|
|
63
70
|
task :verbose do
|
64
71
|
$verbose = true
|
65
72
|
end
|
73
|
+
|
74
|
+
namespace :style do
|
75
|
+
desc "Check style"
|
76
|
+
task :check do
|
77
|
+
report "\nVERIFYING RUBY STYLE"
|
78
|
+
report execute("rubocop ../auto ../examples ../extras --config .rubocop.yml", true)
|
79
|
+
report "Styling Ruby:PASS"
|
80
|
+
end
|
81
|
+
|
82
|
+
namespace :check do
|
83
|
+
Dir['../**/*.rb'].each do |f|
|
84
|
+
filename = File.basename(f, '.rb')
|
85
|
+
desc "Check Style of #{filename}"
|
86
|
+
task filename.to_sym => ['style:clean'] do
|
87
|
+
report execute("rubocop #{f} --color --config .rubocop.yml", true)
|
88
|
+
report "Style Checked for #{f}"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
desc "Fix Style of all C Code"
|
94
|
+
task :c do
|
95
|
+
run_astyle("../src/*.* ../extras/fixture/src/*.*")
|
96
|
+
end
|
97
|
+
|
98
|
+
namespace :c do
|
99
|
+
Dir['../{src,extras/**}/*.{c,h}'].each do |f|
|
100
|
+
filename = File.basename(f)[0..-3]
|
101
|
+
desc "Check Style of #{filename}"
|
102
|
+
task filename.to_sym do
|
103
|
+
run_astyle f
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
desc "Attempt to Autocorrect style"
|
109
|
+
task :auto => ['style:clean'] do
|
110
|
+
execute("rubocop ../auto ../examples ../extras --auto-correct --config .rubocop.yml")
|
111
|
+
report "Autocorrected What We Could."
|
112
|
+
end
|
113
|
+
|
114
|
+
desc "Update style todo list"
|
115
|
+
task :todo => ['style:clean'] do
|
116
|
+
execute("rubocop ../auto ../examples ../extras --auto-gen-config --config .rubocop.yml")
|
117
|
+
report "Updated Style TODO List."
|
118
|
+
end
|
119
|
+
|
120
|
+
task :clean do
|
121
|
+
File.delete(".rubocop_todo.yml") if File.exists?(".rubocop_todo.yml")
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
task :style => ['style:check']
|
@@ -11,39 +11,37 @@ require UNITY_ROOT + '../auto/generate_test_runner'
|
|
11
11
|
require UNITY_ROOT + '../auto/colour_reporter'
|
12
12
|
|
13
13
|
module RakefileHelpers
|
14
|
-
|
15
|
-
C_EXTENSION = '.c'
|
16
|
-
|
14
|
+
C_EXTENSION = '.c'.freeze
|
17
15
|
def load_configuration(config_file)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
return if $configured
|
17
|
+
|
18
|
+
$cfg_file = "targets/#{config_file}" unless config_file =~ /[\\|\/]/
|
19
|
+
$cfg = YAML.load(File.read($cfg_file))
|
20
|
+
$colour_output = false unless $cfg['colour']
|
21
|
+
$configured = true if config_file != DEFAULT_CONFIG_FILE
|
24
22
|
end
|
25
23
|
|
26
24
|
def configure_clean
|
27
25
|
CLEAN.include($cfg['compiler']['build_path'] + '*.*') unless $cfg['compiler']['build_path'].nil?
|
28
26
|
end
|
29
27
|
|
30
|
-
def configure_toolchain(config_file=DEFAULT_CONFIG_FILE)
|
28
|
+
def configure_toolchain(config_file = DEFAULT_CONFIG_FILE)
|
31
29
|
config_file += '.yml' unless config_file =~ /\.yml$/
|
32
30
|
config_file = config_file unless config_file =~ /[\\|\/]/
|
33
31
|
load_configuration(config_file)
|
34
32
|
configure_clean
|
35
33
|
end
|
36
34
|
|
37
|
-
def
|
35
|
+
def unit_test_files
|
38
36
|
path = $cfg['compiler']['unit_tests_path'] + 'test*' + C_EXTENSION
|
39
|
-
path.
|
37
|
+
path.tr!('\\', '/')
|
40
38
|
FileList.new(path)
|
41
39
|
end
|
42
40
|
|
43
|
-
def
|
41
|
+
def local_include_dirs
|
44
42
|
include_dirs = $cfg['compiler']['includes']['items'].dup
|
45
|
-
include_dirs.delete_if {|dir| dir.is_a?(Array)}
|
46
|
-
|
43
|
+
include_dirs.delete_if { |dir| dir.is_a?(Array) }
|
44
|
+
include_dirs
|
47
45
|
end
|
48
46
|
|
49
47
|
def extract_headers(filename)
|
@@ -51,41 +49,37 @@ module RakefileHelpers
|
|
51
49
|
lines = File.readlines(filename)
|
52
50
|
lines.each do |line|
|
53
51
|
m = line.match(/^\s*#include\s+\"\s*(.+\.[hH])\s*\"/)
|
54
|
-
|
55
|
-
includes << m[1]
|
56
|
-
end
|
52
|
+
includes << m[1] unless m.nil?
|
57
53
|
end
|
58
|
-
|
54
|
+
includes
|
59
55
|
end
|
60
56
|
|
61
57
|
def find_source_file(header, paths)
|
62
58
|
paths.each do |dir|
|
63
59
|
src_file = dir + header.ext(C_EXTENSION)
|
64
|
-
if
|
65
|
-
return src_file
|
66
|
-
end
|
60
|
+
return src_file if File.exist?(src_file)
|
67
61
|
end
|
68
|
-
|
62
|
+
nil
|
69
63
|
end
|
70
64
|
|
71
65
|
def tackit(strings)
|
72
|
-
if strings.is_a?(Array)
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
66
|
+
result = if strings.is_a?(Array)
|
67
|
+
"\"#{strings.join}\""
|
68
|
+
else
|
69
|
+
strings
|
70
|
+
end
|
71
|
+
result
|
78
72
|
end
|
79
73
|
|
80
74
|
def squash(prefix, items)
|
81
75
|
result = ''
|
82
76
|
items.each { |item| result += " #{prefix}#{tackit(item)}" }
|
83
|
-
|
77
|
+
result
|
84
78
|
end
|
85
79
|
|
86
80
|
def should(behave, &block)
|
87
81
|
if block
|
88
|
-
puts
|
82
|
+
puts 'Should ' + behave
|
89
83
|
yield block
|
90
84
|
else
|
91
85
|
puts "UNIMPLEMENTED CASE: Should #{behave}"
|
@@ -93,91 +87,103 @@ module RakefileHelpers
|
|
93
87
|
end
|
94
88
|
|
95
89
|
def build_compiler_fields(inject_defines)
|
96
|
-
command
|
97
|
-
if $cfg['compiler']['defines']['items'].nil?
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
options
|
90
|
+
command = tackit($cfg['compiler']['path'])
|
91
|
+
defines = if $cfg['compiler']['defines']['items'].nil?
|
92
|
+
''
|
93
|
+
else
|
94
|
+
squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=putcharSpy'] + inject_defines)
|
95
|
+
end
|
96
|
+
options = squash('', $cfg['compiler']['options'])
|
103
97
|
includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items'])
|
104
98
|
includes = includes.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR)
|
105
|
-
|
99
|
+
|
100
|
+
{ :command => command, :defines => defines, :options => options, :includes => includes }
|
106
101
|
end
|
107
102
|
|
108
|
-
def compile(file, defines=[])
|
103
|
+
def compile(file, defines = [])
|
109
104
|
compiler = build_compiler_fields(defines)
|
110
|
-
|
111
|
-
cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " +
|
105
|
+
cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " \
|
112
106
|
"#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}"
|
113
107
|
obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}"
|
114
108
|
execute(cmd_str + obj_file)
|
115
|
-
|
109
|
+
|
110
|
+
obj_file
|
116
111
|
end
|
117
112
|
|
118
113
|
def build_linker_fields
|
119
|
-
command
|
120
|
-
if $cfg['linker']['options'].nil?
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
if
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
114
|
+
command = tackit($cfg['linker']['path'])
|
115
|
+
options = if $cfg['linker']['options'].nil?
|
116
|
+
''
|
117
|
+
else
|
118
|
+
squash('', $cfg['linker']['options'])
|
119
|
+
end
|
120
|
+
includes = if $cfg['linker']['includes'].nil? || $cfg['linker']['includes']['items'].nil?
|
121
|
+
''
|
122
|
+
else
|
123
|
+
squash($cfg['linker']['includes']['prefix'], $cfg['linker']['includes']['items'])
|
124
|
+
end.gsub(/\\ /, ' ').gsub(/\\\"/, '"').gsub(/\\$/, '') # Remove trailing slashes (for IAR)
|
125
|
+
|
126
|
+
{ :command => command, :options => options, :includes => includes }
|
132
127
|
end
|
133
128
|
|
134
129
|
def link_it(exe_name, obj_list)
|
135
130
|
linker = build_linker_fields
|
136
131
|
cmd_str = "#{linker[:command]}#{linker[:options]}#{linker[:includes]} " +
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
132
|
+
(obj_list.map { |obj| "#{$cfg['linker']['object_files']['path']}#{obj} " }).join +
|
133
|
+
$cfg['linker']['bin_files']['prefix'] + ' ' +
|
134
|
+
$cfg['linker']['bin_files']['destination'] +
|
135
|
+
exe_name + $cfg['linker']['bin_files']['extension']
|
141
136
|
execute(cmd_str)
|
142
137
|
end
|
143
138
|
|
144
139
|
def build_simulator_fields
|
145
140
|
return nil if $cfg['simulator'].nil?
|
146
|
-
if $cfg['simulator']['path'].nil?
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
if $cfg['simulator']['pre_support'].nil?
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
if $cfg['simulator']['post_support'].nil?
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
141
|
+
command = if $cfg['simulator']['path'].nil?
|
142
|
+
''
|
143
|
+
else
|
144
|
+
(tackit($cfg['simulator']['path']) + ' ')
|
145
|
+
end
|
146
|
+
pre_support = if $cfg['simulator']['pre_support'].nil?
|
147
|
+
''
|
148
|
+
else
|
149
|
+
squash('', $cfg['simulator']['pre_support'])
|
150
|
+
end
|
151
|
+
post_support = if $cfg['simulator']['post_support'].nil?
|
152
|
+
''
|
153
|
+
else
|
154
|
+
squash('', $cfg['simulator']['post_support'])
|
155
|
+
end
|
156
|
+
|
157
|
+
{ :command => command, :pre_support => pre_support, :post_support => post_support }
|
158
|
+
end
|
159
|
+
|
160
|
+
def run_astyle(style_what)
|
161
|
+
report "Styling C Code..."
|
162
|
+
command = "AStyle " \
|
163
|
+
"--style=allman --indent=spaces=4 --indent-switches --indent-preproc-define --indent-preproc-block " \
|
164
|
+
"--pad-oper --pad-comma --unpad-paren --pad-header " \
|
165
|
+
"--align-pointer=type --align-reference=name " \
|
166
|
+
"--add-brackets --mode=c --suffix=none " \
|
167
|
+
"#{style_what}"
|
168
|
+
execute(command, false)
|
169
|
+
report "Styling C:PASS"
|
162
170
|
end
|
163
171
|
|
164
|
-
def execute(command_string, ok_to_fail=false)
|
172
|
+
def execute(command_string, ok_to_fail = false)
|
165
173
|
report command_string if $verbose
|
166
174
|
output = `#{command_string}`.chomp
|
167
|
-
report(output) if
|
168
|
-
|
169
|
-
|
170
|
-
end
|
171
|
-
return output
|
175
|
+
report(output) if $verbose && !output.nil? && !output.empty?
|
176
|
+
raise "Command failed. (Returned #{$?.exitstatus})" if !$?.exitstatus.zero? && !ok_to_fail
|
177
|
+
output
|
172
178
|
end
|
173
179
|
|
174
180
|
def report_summary
|
175
181
|
summary = UnityTestSummary.new
|
176
|
-
summary.
|
182
|
+
summary.root = UNITY_ROOT
|
177
183
|
results_glob = "#{$cfg['compiler']['build_path']}*.test*"
|
178
|
-
results_glob.
|
184
|
+
results_glob.tr!('\\', '/')
|
179
185
|
results = Dir[results_glob]
|
180
|
-
summary.
|
186
|
+
summary.targets = results
|
181
187
|
report summary.run
|
182
188
|
end
|
183
189
|
|
@@ -187,16 +193,16 @@ module RakefileHelpers
|
|
187
193
|
# Tack on TEST define for compiling unit tests
|
188
194
|
load_configuration($cfg_file)
|
189
195
|
test_defines = ['TEST']
|
190
|
-
$cfg['compiler']['defines']['items']
|
196
|
+
$cfg['compiler']['defines']['items'] ||= []
|
191
197
|
$cfg['compiler']['defines']['items'] << 'TEST'
|
192
198
|
|
193
|
-
include_dirs =
|
199
|
+
include_dirs = local_include_dirs
|
194
200
|
|
195
201
|
# Build and execute each unit test
|
196
202
|
test_files.each do |test|
|
197
203
|
obj_list = []
|
198
204
|
|
199
|
-
|
205
|
+
unless $cfg['compiler']['aux_sources'].nil?
|
200
206
|
$cfg['compiler']['aux_sources'].each do |aux|
|
201
207
|
obj_list << compile(aux, test_defines)
|
202
208
|
end
|
@@ -206,25 +212,23 @@ module RakefileHelpers
|
|
206
212
|
extract_headers(test).each do |header|
|
207
213
|
# Compile corresponding source file if it exists
|
208
214
|
src_file = find_source_file(header, include_dirs)
|
209
|
-
|
210
|
-
|
211
|
-
end
|
215
|
+
|
216
|
+
obj_list << compile(src_file, test_defines) unless src_file.nil?
|
212
217
|
end
|
213
218
|
|
214
219
|
# Build the test runner (generate if configured to do so)
|
215
220
|
test_base = File.basename(test, C_EXTENSION)
|
216
221
|
|
217
222
|
runner_name = test_base + '_Runner.c'
|
218
|
-
runner_path = ''
|
219
223
|
|
220
|
-
if $cfg['compiler']['runner_path'].nil?
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
224
|
+
runner_path = if $cfg['compiler']['runner_path'].nil?
|
225
|
+
$cfg['compiler']['build_path'] + runner_name
|
226
|
+
else
|
227
|
+
$cfg['compiler']['runner_path'] + runner_name
|
228
|
+
end
|
225
229
|
|
226
230
|
options = $cfg[:unity]
|
227
|
-
options[:use_param_tests] =
|
231
|
+
options[:use_param_tests] = test =~ /parameterized/ ? true : false
|
228
232
|
UnityTestRunnerGenerator.new(options).run(test, runner_path)
|
229
233
|
obj_list << compile(runner_path, test_defines)
|
230
234
|
|
@@ -237,21 +241,20 @@ module RakefileHelpers
|
|
237
241
|
# Execute unit test and generate results file
|
238
242
|
simulator = build_simulator_fields
|
239
243
|
executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension']
|
240
|
-
if simulator.nil?
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
244
|
+
cmd_str = if simulator.nil?
|
245
|
+
executable
|
246
|
+
else
|
247
|
+
"#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}"
|
248
|
+
end
|
245
249
|
output = execute(cmd_str)
|
246
250
|
test_results = $cfg['compiler']['build_path'] + test_base
|
247
251
|
if output.match(/OK$/m).nil?
|
248
252
|
test_results += '.testfail'
|
249
253
|
else
|
250
|
-
report output
|
254
|
+
report output unless $verbose # Verbose already prints this line, as does a failure
|
251
255
|
test_results += '.testpass'
|
252
256
|
end
|
253
257
|
File.open(test_results, 'w') { |f| f.print output }
|
254
|
-
|
255
258
|
end
|
256
259
|
end
|
257
260
|
end
|