ceedling 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/project_as_gem.yml +13 -0
- data/assets/project_with_guts.yml +13 -0
- data/bin/ceedling +91 -67
- data/docs/CeedlingPacket.md +61 -23
- data/docs/CeedlingPacket.odt +0 -0
- data/docs/CeedlingPacket.pdf +0 -0
- data/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/examples/temp_sensor/test/TestTemperatureCalculator.c +4 -1
- data/lib/ceedling/configurator.rb +14 -1
- data/lib/ceedling/configurator_builder.rb +2 -1
- data/lib/ceedling/configurator_validator.rb +12 -3
- data/lib/ceedling/constants.rb +3 -1
- data/lib/ceedling/defaults.rb +12 -1
- data/lib/ceedling/file_finder.rb +3 -0
- data/lib/ceedling/file_path_utils.rb +1 -1
- data/lib/ceedling/file_wrapper.rb +4 -4
- data/lib/ceedling/generator.rb +12 -3
- data/lib/ceedling/preprocessinator_helper.rb +5 -5
- data/lib/ceedling/preprocessinator_includes_handler.rb +10 -1
- data/lib/ceedling/project_config_manager.rb +1 -2
- data/lib/ceedling/project_file_loader.rb +27 -9
- data/lib/ceedling/rakefile.rb +6 -6
- data/lib/ceedling/release_invoker.rb +21 -6
- data/lib/ceedling/rules_release.rake +9 -5
- data/lib/ceedling/rules_tests.rake +6 -1
- data/lib/ceedling/setupinator.rb +1 -0
- data/lib/ceedling/tasks_base.rake +3 -0
- data/lib/ceedling/tasks_filesystem.rake +10 -7
- data/lib/ceedling/tasks_release.rake +3 -1
- data/lib/ceedling/test_includes_extractor.rb +16 -12
- data/lib/ceedling/test_invoker.rb +40 -0
- data/lib/ceedling/version.rb +3 -3
- data/lib/ceedling/version.rb.erb +1 -1
- data/plugins/command_hooks/lib/command_hooks.rb +1 -1
- data/plugins/fake_function_framework/examples/fff_example/src/bar.h +1 -0
- data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +1 -0
- data/plugins/fake_function_framework/lib/fff_mock_generator.rb +4 -0
- data/plugins/fake_function_framework/spec/{fff_mock_generator_spec.rb → fff_mock_header_generator_spec.rb} +34 -194
- data/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb +149 -0
- data/plugins/fake_function_framework/spec/header_generator.rb +51 -0
- data/plugins/junit_tests_report/lib/junit_tests_report.rb +115 -0
- data/plugins/subprojects/README.md +63 -0
- data/plugins/subprojects/config/defaults.yml +33 -0
- data/plugins/subprojects/lib/subprojects.rb +92 -0
- data/plugins/subprojects/subprojects.rake +78 -0
- data/spec/preprocessinator_includes_handler_spec.rb +15 -5
- data/spec/spec_helper.rb +2 -2
- data/spec/spec_system_helper.rb +49 -1
- data/spec/system/deployment_spec.rb +29 -0
- data/vendor/c_exception/README.md +8 -2
- data/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
- data/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/c_exception/vendor/unity/README.md +19 -10
- data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/c_exception/vendor/unity/src/unity.c +396 -330
- data/vendor/c_exception/vendor/unity/src/unity.h +50 -4
- data/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/c_exception/vendor/unity/test/Makefile +17 -17
- data/vendor/c_exception/vendor/unity/test/rakefile +63 -3
- data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
- data/vendor/cmock/README.md +10 -1
- data/vendor/cmock/config/test_environment.rb +7 -7
- data/vendor/cmock/docs/CMock_Summary.md +325 -128
- data/vendor/cmock/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/examples/make_example/Makefile +2 -2
- data/vendor/cmock/examples/temp_sensor/gcc.yml +5 -4
- data/vendor/cmock/examples/temp_sensor/iar_v4.yml +5 -4
- data/vendor/cmock/examples/temp_sensor/iar_v5.yml +5 -4
- data/vendor/cmock/examples/temp_sensor/rakefile.rb +11 -1
- data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +12 -10
- data/vendor/cmock/lib/cmock.rb +0 -3
- data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +6 -2
- data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -1
- data/vendor/cmock/lib/cmock_header_parser.rb +5 -6
- data/vendor/cmock/release/version.info +1 -1
- data/vendor/cmock/scripts/create_makefile.rb +4 -2
- data/vendor/cmock/scripts/test_summary.rb +17 -9
- data/vendor/cmock/src/cmock.c +1 -0
- data/vendor/cmock/src/cmock.h +1 -1
- data/vendor/cmock/src/cmock_internals.h +14 -1
- data/vendor/cmock/test/c/TestCMockC.yml +4 -4
- data/vendor/cmock/test/c/TestCMockCDynamic.yml +4 -4
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_FLASH.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_RAM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_SIM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_FLASH.xcl +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_RAM.xcl +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/ioat91sam7x256.ddf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.dep +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewd +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewp +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.eww +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X-EK.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.inc +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.rdf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.tcl +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256_inc.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/ioat91sam7x256.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/lib_AT91SAM7X256.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.cspy.bat +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dbgdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dni +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.wsdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup.s79 +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup_SAM7.c +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_FLASH.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_RAM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_SIM.mac +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_FLASH.icf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_RAM.icf +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.dep +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewd +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewp +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.eww +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X-EK.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X256_inc.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/lib_AT91SAM7X256.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/project.h +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dni +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.cspy.bat +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dbgdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dni +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.wsdt +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_Binary.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_RAM_Debug.jlink +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup.s +0 -0
- data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup_SAM7.c +0 -0
- data/vendor/cmock/{Rakefile → test/rakefile} +9 -9
- data/vendor/cmock/{rakefile_helper.rb → test/rakefile_helper.rb} +13 -13
- data/vendor/cmock/test/system/test_compilation/config.yml +4 -4
- data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +2 -0
- data/vendor/cmock/{targets → test/targets}/clang_strict.yml +11 -11
- data/vendor/cmock/{targets → test/targets}/gcc.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/gcc_64.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/gcc_tiny.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/iar_arm_v4.yml +9 -9
- data/vendor/cmock/{targets → test/targets}/iar_arm_v5.yml +10 -10
- data/vendor/cmock/test/test_helper.rb +4 -8
- data/vendor/cmock/test/unit/cmock_config_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_file_writer_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +3 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +15 -2
- data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +6 -10
- data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +1 -1
- data/vendor/cmock/vendor/c_exception/README.md +8 -2
- data/vendor/cmock/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
- data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +19 -10
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +396 -330
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +50 -4
- data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +17 -17
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +63 -3
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
- data/vendor/cmock/vendor/unity/README.md +19 -10
- data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/cmock/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/cmock/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/cmock/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/cmock/vendor/unity/release/version.info +1 -1
- data/vendor/cmock/vendor/unity/src/unity.c +396 -330
- data/vendor/cmock/vendor/unity/src/unity.h +50 -4
- data/vendor/cmock/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/cmock/vendor/unity/test/Makefile +17 -17
- data/vendor/cmock/vendor/unity/test/rakefile +63 -3
- data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/cmock/vendor/unity/test/tests/testunity.c +1338 -151
- data/vendor/deep_merge/Rakefile +1 -1
- data/vendor/unity/README.md +19 -10
- data/vendor/unity/auto/colour_prompt.rb +67 -64
- data/vendor/unity/auto/colour_reporter.rb +20 -20
- data/vendor/unity/auto/generate_module.rb +149 -142
- data/vendor/unity/auto/generate_test_runner.rb +234 -232
- data/vendor/unity/auto/parse_output.rb +220 -0
- data/vendor/unity/auto/stylize_as_junit.rb +108 -120
- data/vendor/unity/auto/test_file_filter.rb +11 -9
- data/vendor/unity/auto/type_sanitizer.rb +1 -3
- data/vendor/unity/auto/unity_test_summary.py +6 -2
- data/vendor/unity/auto/unity_test_summary.rb +45 -57
- data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/unity/docs/UnityAssertionsReference.md +716 -0
- data/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
- data/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
- data/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
- data/vendor/unity/examples/example_1/makefile +22 -17
- data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/unity/examples/example_2/makefile +16 -17
- data/vendor/unity/examples/example_3/rakefile.rb +15 -15
- data/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
- data/vendor/unity/examples/example_3/readme.txt +4 -10
- data/vendor/unity/examples/unity_config.h +14 -26
- data/vendor/unity/extras/fixture/rakefile.rb +12 -12
- data/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
- data/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
- data/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
- data/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
- data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
- data/vendor/unity/release/version.info +1 -1
- data/vendor/unity/src/unity.c +396 -330
- data/vendor/unity/src/unity.h +50 -4
- data/vendor/unity/src/unity_internals.h +119 -84
- data/vendor/unity/test/Makefile +17 -17
- data/vendor/unity/test/rakefile +63 -3
- data/vendor/unity/test/rakefile_helper.rb +108 -105
- data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/unity/test/targets/clang_file.yml +0 -6
- data/vendor/unity/test/targets/clang_strict.yml +1 -9
- data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
- data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
- data/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
- data/vendor/unity/test/tests/testunity.c +1338 -151
- metadata +102 -157
- data/test_graveyard/integration/paths.yml +0 -17
- data/test_graveyard/integration/paths_test.rb +0 -80
- data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +0 -75
- data/test_graveyard/integration/rake_rules_cmock_test.rb +0 -74
- data/test_graveyard/integration/rake_rules_preprocess_test.rb +0 -178
- data/test_graveyard/integration/rake_rules_test.rb +0 -268
- data/test_graveyard/integration/rake_tasks_test.rb +0 -103
- data/test_graveyard/integration_test_helper.rb +0 -34
- data/test_graveyard/rakefile_rules.rb +0 -10
- data/test_graveyard/rakefile_rules_aux_dependencies.rb +0 -10
- data/test_graveyard/rakefile_rules_cmock.rb +0 -10
- data/test_graveyard/rakefile_rules_preprocess.rb +0 -10
- data/test_graveyard/rakefile_tasks.rb +0 -10
- data/test_graveyard/system/file_system_dependencies.yml +0 -20
- data/test_graveyard/system/file_system_kitchen_sink.yml +0 -20
- data/test_graveyard/system/file_system_mocks.yml +0 -20
- data/test_graveyard/system/file_system_preprocess.yml +0 -20
- data/test_graveyard/system/file_system_simple.yml +0 -20
- data/test_graveyard/system/file_system_test.rb +0 -78
- data/test_graveyard/system/mocks/include/a_file.h +0 -2
- data/test_graveyard/system/mocks/include/other_stuff.h +0 -2
- data/test_graveyard/system/mocks/include/stuff.h +0 -3
- data/test_graveyard/system/mocks/source/a_file.c +0 -9
- data/test_graveyard/system/mocks/test/test_a_file.c +0 -41
- data/test_graveyard/system/mocks/test/test_no_file.c +0 -14
- data/test_graveyard/system/project_mocks.yml +0 -43
- data/test_graveyard/system/project_mocks_test.rb +0 -38
- data/test_graveyard/system/project_simple.yml +0 -36
- data/test_graveyard/system/project_simple_test.rb +0 -39
- data/test_graveyard/system/rule_mocks_test.rb +0 -44
- data/test_graveyard/system/rule_runners_test.rb +0 -44
- data/test_graveyard/system/simple/include/other_stuff.h +0 -2
- data/test_graveyard/system/simple/include/stuff.h +0 -3
- data/test_graveyard/system/simple/source/other_stuff.c +0 -6
- data/test_graveyard/system/simple/source/stuff.c +0 -7
- data/test_graveyard/system/simple/test/test_other_stuff.c +0 -30
- data/test_graveyard/system/simple/test/test_stuff.c +0 -51
- data/test_graveyard/system_test_helper.rb +0 -73
- data/test_graveyard/test_helper.rb +0 -93
- data/test_graveyard/unit/busted/configurator_builder_test.rb +0 -569
- data/test_graveyard/unit/busted/configurator_helper_test.rb +0 -234
- data/test_graveyard/unit/busted/configurator_test.rb +0 -232
- data/test_graveyard/unit/busted/configurator_validator_test.rb +0 -169
- data/test_graveyard/unit/busted/deep_merge_fix_test.rb +0 -55
- data/test_graveyard/unit/busted/dependinator_test.rb +0 -129
- data/test_graveyard/unit/busted/file_finder_helper_test.rb +0 -45
- data/test_graveyard/unit/busted/file_finder_test.rb +0 -114
- data/test_graveyard/unit/busted/file_path_utils_test.rb +0 -97
- data/test_graveyard/unit/busted/file_system_utils_test.rb +0 -21
- data/test_graveyard/unit/busted/generator_test.rb +0 -187
- data/test_graveyard/unit/busted/generator_test_results_test.rb +0 -129
- data/test_graveyard/unit/busted/generator_test_runner_test.rb +0 -475
- data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +0 -39
- data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +0 -156
- data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +0 -93
- data/test_graveyard/unit/busted/preprocessinator_test.rb +0 -57
- data/test_graveyard/unit/busted/project_file_loader_test.rb +0 -142
- data/test_graveyard/unit/busted/setupinator_test.rb +0 -45
- data/test_graveyard/unit/busted/streaminator_test.rb +0 -49
- data/test_graveyard/unit/busted/task_invoker_test.rb +0 -69
- data/test_graveyard/unit/busted/test_includes_extractor_test.rb +0 -111
- data/test_graveyard/unit/busted/test_invoker_helper_test.rb +0 -62
- data/test_graveyard/unit/busted/test_invoker_test.rb +0 -47
- data/test_graveyard/unit/busted/tool_executor_helper_test.rb +0 -100
- data/test_graveyard/unit/busted/tool_executor_test.rb +0 -351
- data/test_graveyard/unit/busted/verbosinator_test.rb +0 -65
- data/test_graveyard/unit/preprocessinator_extractor_test.rb +0 -731
- data/test_graveyard/unit_test_helper.rb +0 -16
- data/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
- data/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
- data/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
- data/vendor/cmock/docs/CMock Summary.odt +0 -0
- data/vendor/cmock/docs/CMock Summary.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
- data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
- data/vendor/cmock/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
- data/vendor/unity/auto/parseOutput.rb +0 -191
- data/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
- data/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
- data/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
- data/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#============================================================
|
|
2
|
+
# Author: John Theofanopoulos
|
|
3
|
+
# A simple parser. Takes the output files generated during the build process and
|
|
4
|
+
# extracts information relating to the tests.
|
|
5
|
+
#
|
|
6
|
+
# Notes:
|
|
7
|
+
# To capture an output file under VS builds use the following:
|
|
8
|
+
# devenv [build instructions] > Output.txt & type Output.txt
|
|
9
|
+
#
|
|
10
|
+
# To capture an output file under GCC/Linux builds use the following:
|
|
11
|
+
# make | tee Output.txt
|
|
12
|
+
#
|
|
13
|
+
# To use this parser use the following command
|
|
14
|
+
# ruby parseOutput.rb [options] [file]
|
|
15
|
+
# options: -xml : produce a JUnit compatible XML file
|
|
16
|
+
# file : file to scan for results
|
|
17
|
+
#============================================================
|
|
18
|
+
|
|
19
|
+
class ParseOutput
|
|
20
|
+
def initialize
|
|
21
|
+
@test_flag = false
|
|
22
|
+
@xml_out = false
|
|
23
|
+
@array_list = false
|
|
24
|
+
@total_tests = false
|
|
25
|
+
@class_index = false
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Set the flag to indicate if there will be an XML output file or not
|
|
29
|
+
def set_xml_output
|
|
30
|
+
@xml_out = true
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# if write our output to XML
|
|
34
|
+
def write_xml_output
|
|
35
|
+
output = File.open('report.xml', 'w')
|
|
36
|
+
output << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
|
37
|
+
@array_list.each do |item|
|
|
38
|
+
output << item << "\n"
|
|
39
|
+
end
|
|
40
|
+
output << "</testsuite>\n"
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# This function will try and determine when the suite is changed. This is
|
|
44
|
+
# is the name that gets added to the classname parameter.
|
|
45
|
+
def test_suite_verify(test_suite_name)
|
|
46
|
+
return if @test_flag
|
|
47
|
+
|
|
48
|
+
@test_flag = true
|
|
49
|
+
# Split the path name
|
|
50
|
+
test_name = test_suite_name.split('/')
|
|
51
|
+
# Remove the extension
|
|
52
|
+
base_name = test_name[test_name.size - 1].split('.')
|
|
53
|
+
@test_suite = 'test.' + base_name[0]
|
|
54
|
+
printf "New Test: %s\n", @test_suite
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Test was flagged as having passed so format the output
|
|
58
|
+
def test_passed(array)
|
|
59
|
+
last_item = array.length - 1
|
|
60
|
+
test_name = array[last_item - 1]
|
|
61
|
+
test_suite_verify(array[@class_name])
|
|
62
|
+
printf "%-40s PASS\n", test_name
|
|
63
|
+
|
|
64
|
+
return unless @xml_out
|
|
65
|
+
|
|
66
|
+
@array_list.push ' <testcase classname="' + @test_suite + '" name="' + test_name + '"/>'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Test was flagged as having passed so format the output.
|
|
70
|
+
# This is using the Unity fixture output and not the original Unity output.
|
|
71
|
+
def test_passed_unity_fixture(array)
|
|
72
|
+
test_suite = array[0].sub('TEST(', '')
|
|
73
|
+
test_suite = test_suite.sub(',', '')
|
|
74
|
+
test_name = array[1].sub(')', '')
|
|
75
|
+
|
|
76
|
+
return unless @xml_out
|
|
77
|
+
|
|
78
|
+
@array_list.push ' <testcase classname="' + test_suite + '" name="' + test_name + '"/>'
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Test was flagged as being ingored so format the output
|
|
82
|
+
def test_ignored(array)
|
|
83
|
+
last_item = array.length - 1
|
|
84
|
+
test_name = array[last_item - 2]
|
|
85
|
+
reason = array[last_item].chomp
|
|
86
|
+
test_suite_verify(array[@class_name])
|
|
87
|
+
printf "%-40s IGNORED\n", test_name
|
|
88
|
+
|
|
89
|
+
if test_name.start_with? 'TEST('
|
|
90
|
+
array2 = test_name.split(' ')
|
|
91
|
+
@test_suite = array2[0].sub('TEST(', '')
|
|
92
|
+
@test_suite = @test_suite.sub(',', '')
|
|
93
|
+
test_name = array2[1].sub(')', '')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
return unless @xml_out
|
|
97
|
+
|
|
98
|
+
@array_list.push ' <testcase classname="' + @test_suite + '" name="' + test_name + '">'
|
|
99
|
+
@array_list.push ' <skipped type="TEST IGNORED"> ' + reason + ' </skipped>'
|
|
100
|
+
@array_list.push ' </testcase>'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Test was flagged as having failed so format the line
|
|
104
|
+
def test_failed(array)
|
|
105
|
+
last_item = array.length - 1
|
|
106
|
+
test_name = array[last_item - 2]
|
|
107
|
+
reason = array[last_item].chomp + ' at line: ' + array[last_item - 3]
|
|
108
|
+
test_suite_verify(array[@class_name])
|
|
109
|
+
printf "%-40s FAILED\n", test_name
|
|
110
|
+
|
|
111
|
+
if test_name.start_with? 'TEST('
|
|
112
|
+
array2 = test_name.split(' ')
|
|
113
|
+
@test_suite = array2[0].sub('TEST(', '')
|
|
114
|
+
@test_suite = @test_suite.sub(',', '')
|
|
115
|
+
test_name = array2[1].sub(')', '')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
return unless @xml_out
|
|
119
|
+
|
|
120
|
+
@array_list.push ' <testcase classname="' + @test_suite + '" name="' + test_name + '">'
|
|
121
|
+
@array_list.push ' <failure type="ASSERT FAILED"> ' + reason + ' </failure>'
|
|
122
|
+
@array_list.push ' </testcase>'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Figure out what OS we are running on. For now we are assuming if it's not Windows it must
|
|
126
|
+
# be Unix based.
|
|
127
|
+
def detect_os
|
|
128
|
+
os = RUBY_PLATFORM.split('-')
|
|
129
|
+
@class_name = if os.size == 2
|
|
130
|
+
if os[1] == 'mingw32'
|
|
131
|
+
1
|
|
132
|
+
else
|
|
133
|
+
0
|
|
134
|
+
end
|
|
135
|
+
else
|
|
136
|
+
0
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Main function used to parse the file that was captured.
|
|
141
|
+
def process(name)
|
|
142
|
+
@test_flag = false
|
|
143
|
+
@array_list = []
|
|
144
|
+
|
|
145
|
+
detect_os
|
|
146
|
+
|
|
147
|
+
puts 'Parsing file: ' + name
|
|
148
|
+
|
|
149
|
+
test_pass = 0
|
|
150
|
+
test_fail = 0
|
|
151
|
+
test_ignore = 0
|
|
152
|
+
puts ''
|
|
153
|
+
puts '=================== RESULTS ====================='
|
|
154
|
+
puts ''
|
|
155
|
+
File.open(name).each do |line|
|
|
156
|
+
# Typical test lines look like this:
|
|
157
|
+
# <path>/<test_file>.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0
|
|
158
|
+
# <path>/<test_file>.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented
|
|
159
|
+
# <path>/<test_file>.c:115:test_tc5100_initCanVoidPtrs:PASS
|
|
160
|
+
#
|
|
161
|
+
# where path is different on Unix vs Windows devices (Windows leads with a drive letter)
|
|
162
|
+
line_array = line.split(':')
|
|
163
|
+
|
|
164
|
+
# If we were able to split the line then we can look to see if any of our target words
|
|
165
|
+
# were found. Case is important.
|
|
166
|
+
if (line_array.size >= 4) || (line.start_with? 'TEST(')
|
|
167
|
+
# Determine if this test passed
|
|
168
|
+
if line.include? ':PASS'
|
|
169
|
+
test_passed(line_array)
|
|
170
|
+
test_pass += 1
|
|
171
|
+
elsif line.include? ':FAIL:'
|
|
172
|
+
test_failed(line_array)
|
|
173
|
+
test_fail += 1
|
|
174
|
+
elsif line.include? ':IGNORE:'
|
|
175
|
+
test_ignored(line_array)
|
|
176
|
+
test_ignore += 1
|
|
177
|
+
elsif line.start_with? 'TEST('
|
|
178
|
+
if line.include? ' PASS'
|
|
179
|
+
line_array = line.split(' ')
|
|
180
|
+
test_passed_unity_fixture(line_array)
|
|
181
|
+
test_pass += 1
|
|
182
|
+
end
|
|
183
|
+
# If none of the keywords are found there are no more tests for this suite so clear
|
|
184
|
+
# the test flag
|
|
185
|
+
else
|
|
186
|
+
@test_flag = false
|
|
187
|
+
end
|
|
188
|
+
else
|
|
189
|
+
@test_flag = false
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
puts ''
|
|
193
|
+
puts '=================== SUMMARY ====================='
|
|
194
|
+
puts ''
|
|
195
|
+
puts 'Tests Passed : ' + test_pass.to_s
|
|
196
|
+
puts 'Tests Failed : ' + test_fail.to_s
|
|
197
|
+
puts 'Tests Ignored : ' + test_ignore.to_s
|
|
198
|
+
@total_tests = test_pass + test_fail + test_ignore
|
|
199
|
+
|
|
200
|
+
return unless @xml_out
|
|
201
|
+
|
|
202
|
+
heading = '<testsuite tests="' + @total_tests.to_s + '" failures="' + test_fail.to_s + '"' + ' skips="' + test_ignore.to_s + '">'
|
|
203
|
+
@array_list.insert(0, heading)
|
|
204
|
+
write_xml_output
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# If the command line has no values in, used a default value of Output.txt
|
|
209
|
+
parse_my_file = ParseOutput.new
|
|
210
|
+
|
|
211
|
+
if ARGV.size >= 1
|
|
212
|
+
ARGV.each do |a|
|
|
213
|
+
if a == '-xml'
|
|
214
|
+
parse_my_file.set_xml_output
|
|
215
|
+
else
|
|
216
|
+
parse_my_file.process(a)
|
|
217
|
+
break
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
@@ -12,7 +12,6 @@ require 'pp'
|
|
|
12
12
|
VERSION = 1.0
|
|
13
13
|
|
|
14
14
|
class ArgvParser
|
|
15
|
-
|
|
16
15
|
#
|
|
17
16
|
# Return a structure describing the options.
|
|
18
17
|
#
|
|
@@ -20,41 +19,41 @@ class ArgvParser
|
|
|
20
19
|
# The options specified on the command line will be collected in *options*.
|
|
21
20
|
# We set default values here.
|
|
22
21
|
options = OpenStruct.new
|
|
23
|
-
options.results_dir =
|
|
24
|
-
options.root_path =
|
|
25
|
-
options.out_file =
|
|
22
|
+
options.results_dir = '.'
|
|
23
|
+
options.root_path = '.'
|
|
24
|
+
options.out_file = 'results.xml'
|
|
26
25
|
|
|
27
|
-
opts = OptionParser.new do |
|
|
28
|
-
|
|
26
|
+
opts = OptionParser.new do |o|
|
|
27
|
+
o.banner = 'Usage: unity_to_junit.rb [options]'
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
o.separator ''
|
|
30
|
+
o.separator 'Specific options:'
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
#puts "results #{results}"
|
|
32
|
+
o.on('-r', '--results <dir>', 'Look for Unity Results files here.') do |results|
|
|
33
|
+
# puts "results #{results}"
|
|
35
34
|
options.results_dir = results
|
|
36
35
|
end
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
o.on('-p', '--root_path <path>', 'Prepend this path to files in results.') do |root_path|
|
|
39
38
|
options.root_path = root_path
|
|
40
39
|
end
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
#puts "out_file: #{out_file}"
|
|
41
|
+
o.on('-o', '--output <filename>', 'XML file to generate.') do |out_file|
|
|
42
|
+
# puts "out_file: #{out_file}"
|
|
44
43
|
options.out_file = out_file
|
|
45
44
|
end
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
o.separator ''
|
|
47
|
+
o.separator 'Common options:'
|
|
49
48
|
|
|
50
49
|
# No argument, shows at tail. This will print an options summary.
|
|
51
|
-
|
|
52
|
-
puts
|
|
50
|
+
o.on_tail('-h', '--help', 'Show this message') do
|
|
51
|
+
puts o
|
|
53
52
|
exit
|
|
54
53
|
end
|
|
55
54
|
|
|
56
55
|
# Another typical switch to print the version.
|
|
57
|
-
|
|
56
|
+
o.on_tail('--version', 'Show version') do
|
|
58
57
|
puts "unity_to_junit.rb version #{VERSION}"
|
|
59
58
|
exit
|
|
60
59
|
end
|
|
@@ -62,13 +61,13 @@ class ArgvParser
|
|
|
62
61
|
|
|
63
62
|
opts.parse!(args)
|
|
64
63
|
options
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
end # class OptparseExample
|
|
64
|
+
end # parse()
|
|
65
|
+
end # class OptparseExample
|
|
68
66
|
|
|
69
67
|
class UnityToJUnit
|
|
70
68
|
include FileUtils::Verbose
|
|
71
69
|
attr_reader :report, :total_tests, :failures, :ignored
|
|
70
|
+
attr_writer :targets, :root, :out_file
|
|
72
71
|
|
|
73
72
|
def initialize
|
|
74
73
|
@report = ''
|
|
@@ -77,125 +76,115 @@ class UnityToJUnit
|
|
|
77
76
|
|
|
78
77
|
def run
|
|
79
78
|
# Clean up result file names
|
|
80
|
-
results = @targets.map {|target| target.
|
|
81
|
-
#puts "Output File: #{@out_file}"
|
|
82
|
-
f = File.new(@out_file,
|
|
79
|
+
results = @targets.map { |target| target.tr('\\', '/') }
|
|
80
|
+
# puts "Output File: #{@out_file}"
|
|
81
|
+
f = File.new(@out_file, 'w')
|
|
83
82
|
write_xml_header(f)
|
|
84
|
-
write_suites_header(
|
|
83
|
+
write_suites_header(f)
|
|
85
84
|
results.each do |result_file|
|
|
86
|
-
lines = File.readlines(result_file).map
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
#use line[0] from the test output to get the test_file path and name
|
|
98
|
-
test_file_str = lines[0].
|
|
99
|
-
test_file_str = test_file_str.split(
|
|
100
|
-
test_file = if
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
lines = File.readlines(result_file).map(&:chomp)
|
|
86
|
+
|
|
87
|
+
raise "Empty test result file: #{result_file}" if lines.empty?
|
|
88
|
+
|
|
89
|
+
result_output = get_details(result_file, lines)
|
|
90
|
+
tests, failures, ignored = parse_test_summary(lines)
|
|
91
|
+
result_output[:counts][:total] = tests
|
|
92
|
+
result_output[:counts][:failed] = failures
|
|
93
|
+
result_output[:counts][:ignored] = ignored
|
|
94
|
+
result_output[:counts][:passed] = (result_output[:counts][:total] - result_output[:counts][:failed] - result_output[:counts][:ignored])
|
|
95
|
+
|
|
96
|
+
# use line[0] from the test output to get the test_file path and name
|
|
97
|
+
test_file_str = lines[0].tr('\\', '/')
|
|
98
|
+
test_file_str = test_file_str.split(':')
|
|
99
|
+
test_file = if test_file_str.length < 2
|
|
100
|
+
result_file
|
|
101
|
+
else
|
|
102
|
+
test_file_str[0] + ':' + test_file_str[1]
|
|
103
|
+
end
|
|
105
104
|
result_output[:source][:path] = File.dirname(test_file)
|
|
106
105
|
result_output[:source][:file] = File.basename(test_file)
|
|
107
106
|
|
|
108
107
|
# save result_output
|
|
109
|
-
@unit_name = File.basename(test_file,
|
|
108
|
+
@unit_name = File.basename(test_file, '.*')
|
|
110
109
|
|
|
111
|
-
write_suite_header(
|
|
112
|
-
write_failures(
|
|
113
|
-
write_tests(
|
|
114
|
-
write_ignored(
|
|
115
|
-
write_suite_footer(
|
|
110
|
+
write_suite_header(result_output[:counts], f)
|
|
111
|
+
write_failures(result_output, f)
|
|
112
|
+
write_tests(result_output, f)
|
|
113
|
+
write_ignored(result_output, f)
|
|
114
|
+
write_suite_footer(f)
|
|
116
115
|
end
|
|
117
|
-
write_suites_footer(
|
|
116
|
+
write_suites_footer(f)
|
|
118
117
|
f.close
|
|
119
118
|
end
|
|
120
119
|
|
|
121
|
-
def
|
|
122
|
-
@targets = target_array
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def set_root_path(path)
|
|
126
|
-
@root = path
|
|
127
|
-
end
|
|
128
|
-
def set_out_file(filename)
|
|
129
|
-
@out_file = filename
|
|
130
|
-
end
|
|
131
|
-
def usage(err_msg=nil)
|
|
120
|
+
def usage(err_msg = nil)
|
|
132
121
|
puts "\nERROR: "
|
|
133
122
|
puts err_msg if err_msg
|
|
134
|
-
puts
|
|
135
|
-
puts
|
|
136
|
-
puts
|
|
137
|
-
puts
|
|
138
|
-
puts
|
|
139
|
-
puts
|
|
140
|
-
puts
|
|
141
|
-
puts
|
|
142
|
-
puts
|
|
143
|
-
puts
|
|
123
|
+
puts 'Usage: unity_to_junit.rb [options]'
|
|
124
|
+
puts ''
|
|
125
|
+
puts 'Specific options:'
|
|
126
|
+
puts ' -r, --results <dir> Look for Unity Results files here.'
|
|
127
|
+
puts ' -p, --root_path <path> Prepend this path to files in results.'
|
|
128
|
+
puts ' -o, --output <filename> XML file to generate.'
|
|
129
|
+
puts ''
|
|
130
|
+
puts 'Common options:'
|
|
131
|
+
puts ' -h, --help Show this message'
|
|
132
|
+
puts ' --version Show version'
|
|
144
133
|
|
|
145
134
|
exit 1
|
|
146
135
|
end
|
|
147
136
|
|
|
148
137
|
protected
|
|
149
|
-
|
|
150
|
-
|
|
138
|
+
|
|
139
|
+
def get_details(_result_file, lines)
|
|
140
|
+
results = results_structure
|
|
151
141
|
lines.each do |line|
|
|
152
|
-
line = line.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
when 'PASS' then results[:successes] << {:test => test_name, :line => src_line, :message => msg}
|
|
142
|
+
line = line.tr('\\', '/')
|
|
143
|
+
_src_file, src_line, test_name, status, msg = line.split(/:/)
|
|
144
|
+
case status
|
|
145
|
+
when 'IGNORE' then results[:ignores] << { test: test_name, line: src_line, message: msg }
|
|
146
|
+
when 'FAIL' then results[:failures] << { test: test_name, line: src_line, message: msg }
|
|
147
|
+
when 'PASS' then results[:successes] << { test: test_name, line: src_line, message: msg }
|
|
159
148
|
end
|
|
160
149
|
end
|
|
161
|
-
|
|
150
|
+
results
|
|
162
151
|
end
|
|
163
152
|
|
|
164
153
|
def parse_test_summary(summary)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
154
|
+
raise "Couldn't parse test results: #{summary}" unless summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
|
|
155
|
+
[Regexp.last_match(1).to_i, Regexp.last_match(2).to_i, Regexp.last_match(3).to_i]
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def here
|
|
159
|
+
File.expand_path(File.dirname(__FILE__))
|
|
170
160
|
end
|
|
171
|
-
def here; File.expand_path(File.dirname(__FILE__)); end
|
|
172
161
|
|
|
173
162
|
private
|
|
174
163
|
|
|
175
|
-
def
|
|
176
|
-
|
|
177
|
-
:
|
|
178
|
-
:
|
|
179
|
-
:
|
|
180
|
-
:
|
|
181
|
-
:
|
|
182
|
-
:
|
|
164
|
+
def results_structure
|
|
165
|
+
{
|
|
166
|
+
source: { path: '', file: '' },
|
|
167
|
+
successes: [],
|
|
168
|
+
failures: [],
|
|
169
|
+
ignores: [],
|
|
170
|
+
counts: { total: 0, passed: 0, failed: 0, ignored: 0 },
|
|
171
|
+
stdout: []
|
|
183
172
|
}
|
|
184
173
|
end
|
|
185
174
|
|
|
186
|
-
def write_xml_header(
|
|
175
|
+
def write_xml_header(stream)
|
|
187
176
|
stream.puts "<?xml version='1.0' encoding='utf-8' ?>"
|
|
188
177
|
end
|
|
189
178
|
|
|
190
|
-
def write_suites_header(
|
|
191
|
-
stream.puts
|
|
179
|
+
def write_suites_header(stream)
|
|
180
|
+
stream.puts '<testsuites>'
|
|
192
181
|
end
|
|
193
182
|
|
|
194
|
-
def write_suite_header(
|
|
183
|
+
def write_suite_header(counts, stream)
|
|
195
184
|
stream.puts "\t<testsuite errors=\"0\" skipped=\"#{counts[:ignored]}\" failures=\"#{counts[:failed]}\" tests=\"#{counts[:total]}\" name=\"unity\">"
|
|
196
185
|
end
|
|
197
186
|
|
|
198
|
-
def write_failures(
|
|
187
|
+
def write_failures(results, stream)
|
|
199
188
|
result = results[:failures]
|
|
200
189
|
result.each do |item|
|
|
201
190
|
filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*'))
|
|
@@ -206,15 +195,14 @@ class UnityToJUnit
|
|
|
206
195
|
end
|
|
207
196
|
end
|
|
208
197
|
|
|
209
|
-
def write_tests(
|
|
198
|
+
def write_tests(results, stream)
|
|
210
199
|
result = results[:successes]
|
|
211
200
|
result.each do |item|
|
|
212
|
-
filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*'))
|
|
213
201
|
stream.puts "\t\t<testcase classname=\"#{@unit_name}\" name=\"#{item[:test]}\" time=\"0\" />"
|
|
214
202
|
end
|
|
215
203
|
end
|
|
216
204
|
|
|
217
|
-
def write_ignored(
|
|
205
|
+
def write_ignored(results, stream)
|
|
218
206
|
result = results[:ignores]
|
|
219
207
|
result.each do |item|
|
|
220
208
|
filename = File.join(results[:source][:path], File.basename(results[:source][:file], '.*'))
|
|
@@ -226,39 +214,39 @@ class UnityToJUnit
|
|
|
226
214
|
end
|
|
227
215
|
end
|
|
228
216
|
|
|
229
|
-
def write_suite_footer(
|
|
217
|
+
def write_suite_footer(stream)
|
|
230
218
|
stream.puts "\t</testsuite>"
|
|
231
219
|
end
|
|
232
220
|
|
|
233
|
-
def write_suites_footer(
|
|
234
|
-
stream.puts
|
|
221
|
+
def write_suites_footer(stream)
|
|
222
|
+
stream.puts '</testsuites>'
|
|
235
223
|
end
|
|
236
|
-
end #UnityToJUnit
|
|
224
|
+
end # UnityToJUnit
|
|
237
225
|
|
|
238
226
|
if __FILE__ == $0
|
|
239
|
-
#parse out the command options
|
|
227
|
+
# parse out the command options
|
|
240
228
|
options = ArgvParser.parse(ARGV)
|
|
241
229
|
|
|
242
|
-
#create an instance to work with
|
|
230
|
+
# create an instance to work with
|
|
243
231
|
utj = UnityToJUnit.new
|
|
244
232
|
begin
|
|
245
|
-
#look in the specified or current directory for result files
|
|
246
|
-
targets = "#{options.results_dir.
|
|
233
|
+
# look in the specified or current directory for result files
|
|
234
|
+
targets = "#{options.results_dir.tr('\\', '/')}**/*.test*"
|
|
247
235
|
|
|
248
236
|
results = Dir[targets]
|
|
249
237
|
raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty?
|
|
250
|
-
utj.
|
|
238
|
+
utj.targets = results
|
|
251
239
|
|
|
252
|
-
#set the root path
|
|
253
|
-
utj.
|
|
240
|
+
# set the root path
|
|
241
|
+
utj.root = options.root_path
|
|
254
242
|
|
|
255
|
-
#set the output XML file name
|
|
256
|
-
#puts "Output File from options: #{options.out_file}"
|
|
257
|
-
utj.
|
|
243
|
+
# set the output XML file name
|
|
244
|
+
# puts "Output File from options: #{options.out_file}"
|
|
245
|
+
utj.out_file = options.out_file
|
|
258
246
|
|
|
259
|
-
#run the summarizer
|
|
247
|
+
# run the summarizer
|
|
260
248
|
puts utj.run
|
|
261
|
-
rescue
|
|
249
|
+
rescue StandardError => e
|
|
262
250
|
utj.usage e.message
|
|
263
251
|
end
|
|
264
252
|
end
|