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
@@ -0,0 +1,149 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
require 'fff_mock_generator.rb'
|
3
|
+
|
4
|
+
# Test the contents of the .c file created for the mock.
|
5
|
+
describe "FffMockGenerator.create_mock_source" do
|
6
|
+
|
7
|
+
context "when there is nothing to mock," do
|
8
|
+
let(:mock_source) {
|
9
|
+
parsed_header = {}
|
10
|
+
FffMockGenerator.create_mock_source("mock_my_module", parsed_header)
|
11
|
+
}
|
12
|
+
it "then the generated file includes the fff header" do
|
13
|
+
expect(mock_source).to include(
|
14
|
+
# fff.h also requires including string.h
|
15
|
+
%{#include <string.h>\n} +
|
16
|
+
%{#include "fff.h"}
|
17
|
+
)
|
18
|
+
end
|
19
|
+
it "then the generated file includes the mock header" do
|
20
|
+
expect(mock_source).to include(
|
21
|
+
%{#include "mock_my_module.h"\n}
|
22
|
+
)
|
23
|
+
end
|
24
|
+
it "then the generated file defines the init function" do
|
25
|
+
expect(mock_source).to include(
|
26
|
+
"void mock_my_module_Init(void)\n" +
|
27
|
+
"{\n" +
|
28
|
+
" FFF_RESET_HISTORY();\n" +
|
29
|
+
"}"
|
30
|
+
)
|
31
|
+
end
|
32
|
+
it "then the generated file defines the verify function" do
|
33
|
+
expect(mock_source).to include(
|
34
|
+
"void mock_my_module_Verify(void)\n" +
|
35
|
+
"{\n" +
|
36
|
+
"}"
|
37
|
+
)
|
38
|
+
end
|
39
|
+
it "then the generated file defines the destroy function" do
|
40
|
+
expect(mock_source).to include(
|
41
|
+
"void mock_my_module_Destroy(void)\n" +
|
42
|
+
"{\n" +
|
43
|
+
"}"
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "when there are multiple functions," do
|
49
|
+
let(:mock_source) {
|
50
|
+
parsed_header = create_cmock_style_parsed_header(
|
51
|
+
[ {:name => 'a_function', :return_type => 'int', :args => ['char *']},
|
52
|
+
{:name => 'another_function', :return_type => 'void'},
|
53
|
+
{:name => 'three', :return_type => 'bool', :args => ['float', 'int']}
|
54
|
+
])
|
55
|
+
FffMockGenerator.create_mock_source("mock_display", parsed_header)
|
56
|
+
}
|
57
|
+
it "then the generated file contains the first fake function definition" do
|
58
|
+
expect(mock_source).to include(
|
59
|
+
"DEFINE_FAKE_VALUE_FUNC1(int, a_function, char *);"
|
60
|
+
)
|
61
|
+
end
|
62
|
+
it "then the generated file contains the second fake function definition" do
|
63
|
+
expect(mock_source).to include(
|
64
|
+
"DEFINE_FAKE_VOID_FUNC0(another_function);"
|
65
|
+
)
|
66
|
+
end
|
67
|
+
it "then the generated file contains the third fake function definition" do
|
68
|
+
expect(mock_source).to include(
|
69
|
+
"DEFINE_FAKE_VALUE_FUNC2(bool, three, float, int);"
|
70
|
+
)
|
71
|
+
end
|
72
|
+
it "then the init function resets all of the fakes" do
|
73
|
+
expect(mock_source).to include(
|
74
|
+
"void mock_display_Init(void)\n" +
|
75
|
+
"{\n" +
|
76
|
+
" FFF_RESET_HISTORY();\n" +
|
77
|
+
" RESET_FAKE(a_function)\n" +
|
78
|
+
" RESET_FAKE(another_function)\n" +
|
79
|
+
" RESET_FAKE(three)\n" +
|
80
|
+
"}"
|
81
|
+
)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context "when there is a void function with variable arguments and " +
|
86
|
+
"additional arguments" do
|
87
|
+
let(:mock_source){
|
88
|
+
parsed_header = {}
|
89
|
+
parsed_header[:functions] = [{
|
90
|
+
:name => "function_with_var_args",
|
91
|
+
:return => {:type => "void"},
|
92
|
+
:var_arg => "...",
|
93
|
+
:args => [{:type => 'char *'}, {:type => 'int'}]
|
94
|
+
}]
|
95
|
+
FffMockGenerator.create_mock_source("mock_display", parsed_header)
|
96
|
+
}
|
97
|
+
it "then the generated file contains the vararg definition" do
|
98
|
+
expect(mock_source).to include(
|
99
|
+
"DEFINE_FAKE_VOID_FUNC3_VARARG(function_with_var_args, char *, int, ...)"
|
100
|
+
)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
context "when there is a function with a pointer to a const value" do
|
105
|
+
let(:mock_source){
|
106
|
+
parsed_header = {}
|
107
|
+
parsed_header[:functions] = [{
|
108
|
+
:name => "const_test_function",
|
109
|
+
:return => {:type => "void"},
|
110
|
+
:args => [{:type => "char *", :name => "a", :ptr? => false, :const? => true},
|
111
|
+
{:type => "char *", :name => "b", :ptr? => false, :const? => false}]
|
112
|
+
}]
|
113
|
+
FffMockGenerator.create_mock_source("mock_display", parsed_header)
|
114
|
+
}
|
115
|
+
it "then the generated file contains the correct const argument in the declaration" do
|
116
|
+
expect(mock_source).to include(
|
117
|
+
"DEFINE_FAKE_VOID_FUNC2(const_test_function, const char *, char *)"
|
118
|
+
)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
context "when there are pre-includes" do
|
123
|
+
let(:mock_source) {
|
124
|
+
parsed_source = {}
|
125
|
+
FffMockGenerator.create_mock_source("mock_display", parsed_source,
|
126
|
+
[%{"another_header.h"}])
|
127
|
+
}
|
128
|
+
it "then they are included before the other files" do
|
129
|
+
expect(mock_source).to include(
|
130
|
+
%{#include "another_header.h"\n} +
|
131
|
+
%{#include <string.h>}
|
132
|
+
)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
context "when there are post-includes" do
|
137
|
+
let(:mock_source) {
|
138
|
+
parsed_source = {}
|
139
|
+
FffMockGenerator.create_mock_source("mock_display", parsed_source,
|
140
|
+
nil, [%{"another_header.h"}])
|
141
|
+
}
|
142
|
+
it "then they are included before the other files" do
|
143
|
+
expect(mock_source).to include(
|
144
|
+
%{#include "mock_display.h"\n} +
|
145
|
+
%{#include "another_header.h"\n}
|
146
|
+
)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Create a CMock-style parsed header hash. This the type of hash created by
|
2
|
+
# CMock when parsing header files for automock generation. It contains all of
|
3
|
+
# includes, typedefs and functions (with return types and arguments) parsed from
|
4
|
+
# the header file.
|
5
|
+
def create_cmock_style_parsed_header(functions, typedefs = nil)
|
6
|
+
parsed_header = {
|
7
|
+
:includes => nil,
|
8
|
+
:functions => [],
|
9
|
+
:typedefs => []
|
10
|
+
}
|
11
|
+
|
12
|
+
# Add the typedefs.
|
13
|
+
if typedefs
|
14
|
+
typedefs.each do |typedef|
|
15
|
+
parsed_header[:typedefs] << typedef
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# Add the functions.
|
20
|
+
if functions
|
21
|
+
functions.each do |function|
|
22
|
+
# Build the array of arguments.
|
23
|
+
args = []
|
24
|
+
if function.key?(:args)
|
25
|
+
function[:args].each do |arg|
|
26
|
+
args << {
|
27
|
+
:type => arg
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
parsed_header[:functions] << {
|
32
|
+
:name => function[:name],
|
33
|
+
:modifier => "",
|
34
|
+
:return => {
|
35
|
+
:type => function[:return_type],
|
36
|
+
:name => "cmock_to_return",
|
37
|
+
:ptr? => false,
|
38
|
+
:const? => false,
|
39
|
+
:str => "void cmock_to_return",
|
40
|
+
:void? => true
|
41
|
+
},
|
42
|
+
:var_arg => nil,
|
43
|
+
:args_string => "void",
|
44
|
+
:args => args,
|
45
|
+
:args_call => "",
|
46
|
+
:contains_ptr? => false
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
parsed_header
|
51
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require 'ceedling/plugin'
|
2
|
+
require 'ceedling/constants'
|
3
|
+
require 'pp'
|
4
|
+
|
5
|
+
class JunitTestsReport < Plugin
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@results_list = {}
|
9
|
+
@test_counter = 0
|
10
|
+
end
|
11
|
+
|
12
|
+
def post_test_fixture_execute(arg_hash)
|
13
|
+
context = arg_hash[:context]
|
14
|
+
|
15
|
+
@results_list[context] = [] if (@results_list[context].nil?)
|
16
|
+
|
17
|
+
@results_list[context] << arg_hash[:result_file]
|
18
|
+
end
|
19
|
+
|
20
|
+
def post_build
|
21
|
+
@results_list.each_key do |context|
|
22
|
+
results = @ceedling[:plugin_reportinator].assemble_test_results(@results_list[context])
|
23
|
+
|
24
|
+
file_path = File.join( PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s, 'report.xml' )
|
25
|
+
|
26
|
+
@ceedling[:file_wrapper].open( file_path, 'w' ) do |f|
|
27
|
+
@testsuite_counter = 0
|
28
|
+
@testcase_counter = 0
|
29
|
+
suites = reorganise_results( results )
|
30
|
+
|
31
|
+
write_header( results, f )
|
32
|
+
suites.each{|suite| write_suite( suite, f ) }
|
33
|
+
write_footer( f )
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def write_header( results, stream )
|
41
|
+
stream.puts '<?xml version="1.0" encoding="utf-8" ?>'
|
42
|
+
stream.puts('<testsuites tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d">' % results[:counts])
|
43
|
+
end
|
44
|
+
|
45
|
+
def write_footer( stream )
|
46
|
+
stream.puts '</testsuites>'
|
47
|
+
end
|
48
|
+
|
49
|
+
def reorganise_results( results )
|
50
|
+
# Reorganise the output by test suite instead of by result
|
51
|
+
suites = Hash.new{ |h,k| h[k] = {collection: [], total: 0, success: 0, failed: 0, ignored: 0, stdout: []} }
|
52
|
+
results[:successes].each do |result|
|
53
|
+
source = result[:source]
|
54
|
+
name = source[:file].sub(/\..{1,4}$/, "")
|
55
|
+
suites[name][:collection] += result[:collection].map{|test| test.merge(result: :success)}
|
56
|
+
suites[name][:total] += result[:collection].length
|
57
|
+
suites[name][:success] += result[:collection].length
|
58
|
+
end
|
59
|
+
results[:failures].each do |result|
|
60
|
+
source = result[:source]
|
61
|
+
name = source[:file].sub(/\..{1,4}$/, "")
|
62
|
+
suites[name][:collection] += result[:collection].map{|test| test.merge(result: :failed)}
|
63
|
+
suites[name][:total] += result[:collection].length
|
64
|
+
suites[name][:failed] += result[:collection].length
|
65
|
+
end
|
66
|
+
results[:ignores].each do |result|
|
67
|
+
source = result[:source]
|
68
|
+
name = source[:file].sub(/\..{1,4}$/, "")
|
69
|
+
suites[name][:collection] += result[:collection].map{|test| test.merge(result: :ignored)}
|
70
|
+
suites[name][:total] += result[:collection].length
|
71
|
+
suites[name][:ignored] += result[:collection].length
|
72
|
+
end
|
73
|
+
results[:stdout].each do |result|
|
74
|
+
source = result[:source]
|
75
|
+
name = source[:file].sub(/\..{1,4}$/, "")
|
76
|
+
suites[name][:stdout] += result[:collection]
|
77
|
+
end
|
78
|
+
suites.map{|name, data| data.merge(name: name) }
|
79
|
+
end
|
80
|
+
|
81
|
+
def write_suite( suite, stream )
|
82
|
+
stream.puts(' <testsuite name="%<name>s" tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d">' % suite)
|
83
|
+
|
84
|
+
suite[:collection].each do |test|
|
85
|
+
write_test( test, stream )
|
86
|
+
end
|
87
|
+
|
88
|
+
unless suite[:stdout].empty?
|
89
|
+
stream.puts(' <system-out>')
|
90
|
+
suite[:stdout].each{|line| stream.puts line }
|
91
|
+
stream.puts(' </system-out>')
|
92
|
+
end
|
93
|
+
|
94
|
+
stream.puts(' </testsuite>')
|
95
|
+
end
|
96
|
+
|
97
|
+
def write_test( test, stream )
|
98
|
+
case test[:result]
|
99
|
+
when :success
|
100
|
+
stream.puts(' <testcase name="%<test>s" />' % test)
|
101
|
+
when :failed
|
102
|
+
stream.puts(' <testcase name="%<test>s">' % test)
|
103
|
+
if test[:message].empty?
|
104
|
+
stream.puts(' <failure />')
|
105
|
+
else
|
106
|
+
stream.puts(' <failure message="%s" />' % test[:message])
|
107
|
+
end
|
108
|
+
stream.puts(' </testcase>')
|
109
|
+
when :ignored
|
110
|
+
stream.puts(' <testcase name="%<test>s">' % test)
|
111
|
+
stream.puts(' <skipped />')
|
112
|
+
stream.puts(' </testcase>')
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
ceedling-subprojects
|
2
|
+
====================
|
3
|
+
|
4
|
+
Plugin for supporting subprojects that are built as static libraries. It continues to support
|
5
|
+
dependency tracking, without getting confused between your main project files and your
|
6
|
+
subproject files. It accepts different compiler flags and linker flags, allowing you to
|
7
|
+
optimize for your situation.
|
8
|
+
|
9
|
+
First, you're going to want to add the extension to your list of known extensions:
|
10
|
+
|
11
|
+
```
|
12
|
+
:extension:
|
13
|
+
:subprojects: '.a'
|
14
|
+
```
|
15
|
+
|
16
|
+
Define a new section called :subprojects. There, you can list as many subprojects
|
17
|
+
as you may need under the :paths key. For each, you specify a unique place to build
|
18
|
+
and a unique name.
|
19
|
+
|
20
|
+
```
|
21
|
+
:subprojects:
|
22
|
+
:paths:
|
23
|
+
- :name: libprojectA
|
24
|
+
:source:
|
25
|
+
- ./subprojectA/first/dir
|
26
|
+
- ./subprojectA/second/dir
|
27
|
+
:include:
|
28
|
+
- ./subprojectA/include/dir
|
29
|
+
:build_root: ./subprojectA/build/dir
|
30
|
+
:defines:
|
31
|
+
- DEFINE_JUST_FOR_THIS_FILE
|
32
|
+
- AND_ANOTHER
|
33
|
+
- :name: libprojectB
|
34
|
+
:source:
|
35
|
+
- ./subprojectB/only/dir
|
36
|
+
:include:
|
37
|
+
- ./subprojectB/first/include/dir
|
38
|
+
- ./subprojectB/second/include/dir
|
39
|
+
:build_root: ./subprojectB/build/dir
|
40
|
+
:defines: [] #none for this one
|
41
|
+
```
|
42
|
+
|
43
|
+
You can specify the compiler and linker, just as you would a release build:
|
44
|
+
|
45
|
+
```
|
46
|
+
:tools:
|
47
|
+
:subprojects_compiler:
|
48
|
+
:executable: gcc
|
49
|
+
:arguments:
|
50
|
+
- -g
|
51
|
+
- -I"$": COLLECTION_PATHS_SUBPROJECTS
|
52
|
+
- -D$: COLLECTION_DEFINES_SUBPROJECTS
|
53
|
+
- -c "${1}"
|
54
|
+
- -o "${2}"
|
55
|
+
:subprojects_linker:
|
56
|
+
:executable: ar
|
57
|
+
:arguments:
|
58
|
+
- rcs
|
59
|
+
- ${2}
|
60
|
+
- ${1}
|
61
|
+
```
|
62
|
+
|
63
|
+
That's all there is to it! Happy Hacking!
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
#:extension:
|
3
|
+
# :subprojects: '.a'
|
4
|
+
|
5
|
+
:subprojects:
|
6
|
+
:paths: []
|
7
|
+
# - :name: subprojectA
|
8
|
+
# :source:
|
9
|
+
# - ./first/subproject/dir
|
10
|
+
# - ./second/subproject/dir
|
11
|
+
# :include:
|
12
|
+
# - ./first/include/dir
|
13
|
+
# :build_root: ./subproject/build/dir
|
14
|
+
# :defines:
|
15
|
+
# - FIRST_DEFINE
|
16
|
+
|
17
|
+
:tools:
|
18
|
+
:subprojects_compiler:
|
19
|
+
:executable: gcc
|
20
|
+
:arguments:
|
21
|
+
- -g
|
22
|
+
- -I"$": COLLECTION_PATHS_SUBPROJECTS
|
23
|
+
- -D$: COLLECTION_DEFINES_SUBPROJECTS
|
24
|
+
- -c "${1}"
|
25
|
+
- -o "${2}"
|
26
|
+
:subprojects_linker:
|
27
|
+
:executable: ar
|
28
|
+
:arguments:
|
29
|
+
- rcs
|
30
|
+
- ${2}
|
31
|
+
- ${1}
|
32
|
+
|
33
|
+
...
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'ceedling/plugin'
|
2
|
+
require 'ceedling/constants'
|
3
|
+
|
4
|
+
SUBPROJECTS_ROOT_NAME = 'subprojects'
|
5
|
+
SUBPROJECTS_TASK_ROOT = SUBPROJECTS_ROOT_NAME + ':'
|
6
|
+
SUBPROJECTS_SYM = SUBPROJECTS_ROOT_NAME.to_sym
|
7
|
+
|
8
|
+
class Subprojects < Plugin
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
12
|
+
|
13
|
+
# Add to the test paths
|
14
|
+
SUBPROJECTS_PATHS.each do |subproj|
|
15
|
+
subproj[:source].each do |path|
|
16
|
+
COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << path
|
17
|
+
end
|
18
|
+
subproj[:include].each do |path|
|
19
|
+
COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << path
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
#gather information about the subprojects
|
24
|
+
@subprojects = {}
|
25
|
+
@subproject_lookup_by_path = {}
|
26
|
+
SUBPROJECTS_PATHS.each do |subproj|
|
27
|
+
@subprojects[ subproj[:name] ] = subproj.clone
|
28
|
+
@subprojects[ subproj[:name] ][:c] = []
|
29
|
+
@subprojects[ subproj[:name] ][:asm] = []
|
30
|
+
subproj[:source].each do |path|
|
31
|
+
search_path = "#{path[-1].match(/\\|\//) ? path : "#{path}/"}*#{EXTENSION_SOURCE}"
|
32
|
+
@subprojects[ subproj[:name] ][:c] += Dir[search_path]
|
33
|
+
if (EXTENSION_ASSEMBLY && !EXTENSION_ASSEMBLY.empty?)
|
34
|
+
search_path = "#{path[-1].match(/\\|\//) ? path : "#{path}/"}*#{EXTENSION_ASSEMBLY}"
|
35
|
+
@subprojects[ subproj[:name] ][:asm] += Dir[search_path]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
@subproject_lookup_by_path[ subproj[:build_root] ] = subproj[:name]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def find_my_project( c_file, file_type = :c )
|
43
|
+
@subprojects.each_pair do |subprojname, subproj|
|
44
|
+
return subprojname if (subproj[file_type].include?(c_file))
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def find_my_paths( c_file, file_type = :c )
|
49
|
+
@subprojects.each_pair do |subprojname, subproj|
|
50
|
+
return (subproj[:source] + (subproj[:include] || [])) if (subproj[file_type].include?(c_file))
|
51
|
+
end
|
52
|
+
return []
|
53
|
+
end
|
54
|
+
|
55
|
+
def find_my_defines( c_file, file_type = :c )
|
56
|
+
@subprojects.each_pair do |subprojname, subproj|
|
57
|
+
return (subproj[:defines] || []) if (subproj[file_type].include?(c_file))
|
58
|
+
end
|
59
|
+
return []
|
60
|
+
end
|
61
|
+
|
62
|
+
def list_all_object_files_for_subproject( lib_name )
|
63
|
+
subproj = File.basename(lib_name, EXTENSION_SUBPROJECTS)
|
64
|
+
objpath = "#{@subprojects[subproj][:build_root]}/out/c"
|
65
|
+
bbb = @subprojects[subproj][:c].map{|f| "#{objpath}/#{File.basename(f,EXTENSION_SOURCE)}#{EXTENSION_OBJECT}" }
|
66
|
+
bbb
|
67
|
+
end
|
68
|
+
|
69
|
+
def find_library_source_file_for_object( obj_name )
|
70
|
+
cname = "#{File.basename(obj_name, EXTENSION_OBJECT)}#{EXTENSION_SOURCE}"
|
71
|
+
dname = File.dirname(obj_name)[0..-7]
|
72
|
+
pname = @subproject_lookup_by_path[dname]
|
73
|
+
return @ceedling[:file_finder].find_file_from_list(cname, @subprojects[pname][:c], :error)
|
74
|
+
end
|
75
|
+
|
76
|
+
def find_library_assembly_file_for_object( obj_name )
|
77
|
+
cname = "#{File.basename(obj_name, EXTENSION_OBJECT)}#{EXTENSION_ASEMBLY}"
|
78
|
+
dname = File.dirname(obj_name)[0..-7]
|
79
|
+
pname = @subproject_lookup_by_path[dname]
|
80
|
+
return @ceedling[:file_finder].find_file_from_list(cname, @subprojects[pname][:asm], :error)
|
81
|
+
end
|
82
|
+
|
83
|
+
def replace_constant(constant, new_value)
|
84
|
+
Object.send(:remove_const, constant.to_sym) if (Object.const_defined? constant)
|
85
|
+
Object.const_set(constant, new_value)
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
# end blocks always executed following rake run
|
91
|
+
END {
|
92
|
+
}
|