ceedling 1.0.1 → 1.1.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/GIT_COMMIT_SHA +1 -1
- data/Gemfile +7 -1
- data/Gemfile.lock +19 -12
- data/README.md +140 -156
- data/Rakefile +189 -9
- data/assets/example_file.c +1 -1
- data/assets/example_file.h +1 -1
- data/assets/example_file_call.c +1 -1
- data/assets/example_file_call.h +1 -1
- data/assets/example_file_with_statics.c +10 -0
- data/assets/example_file_with_stdio.c +13 -0
- data/assets/example_file_with_stdio.h +15 -0
- data/assets/project.yml +20 -18
- data/assets/test_example_file.c +1 -1
- data/assets/test_example_file_boom.c +1 -1
- data/assets/test_example_file_crash_assert.c +25 -0
- data/assets/{test_example_file_crash.c → test_example_file_crash_sigsegv.c} +4 -3
- data/assets/test_example_file_source_include.c +17 -0
- data/assets/test_example_file_success.c +1 -1
- data/assets/test_example_file_unity_printf.c +1 -1
- data/assets/test_example_file_verbose.c +1 -1
- data/assets/test_example_file_with_mock.c +1 -1
- data/assets/test_example_file_with_stdio.c +18 -0
- data/assets/test_example_with_parameterized_tests.c +1 -1
- data/assets/tests_with_defines/src/adc_hardware.c +1 -1
- data/assets/tests_with_defines/src/adc_hardware.h +1 -1
- data/assets/tests_with_defines/src/adc_hardware_configurator.c +1 -1
- data/assets/tests_with_defines/src/adc_hardware_configurator.h +1 -1
- data/assets/tests_with_defines/test/test_adc_hardware.c +1 -1
- data/assets/tests_with_defines/test/test_adc_hardware_special.c +1 -1
- data/assets/tests_with_encoding/src/unicoder.c +12 -0
- data/assets/tests_with_encoding/src/unicoder.h +14 -0
- data/assets/tests_with_encoding/test/test_unicoder.c +15 -0
- data/assets/tests_with_encoding/test/test_unicoder_partial.c +17 -0
- data/assets/tests_with_fallback_conditionals/src/conditional_module.c +18 -0
- data/assets/tests_with_fallback_conditionals/src/conditional_module.h +13 -0
- data/assets/tests_with_fallback_conditionals/src/optional_dep.h +12 -0
- data/assets/tests_with_fallback_conditionals/test/test_conditionals.c +49 -0
- data/assets/tests_with_preprocessing/src/adc_hardwareA.c +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardwareA.h +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardwareB.c +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardwareB.h +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardwareC.c +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardwareC.h +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardware_configuratorA.h +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardware_configuratorB.h +1 -1
- data/assets/tests_with_preprocessing/src/adc_hardware_configuratorC.h +1 -1
- data/assets/tests_with_preprocessing/test/test_adc_hardwareA.c +1 -1
- data/assets/tests_with_preprocessing/test/test_adc_hardwareB.c +1 -1
- data/assets/tests_with_preprocessing/test/test_adc_hardwareC.c +1 -1
- data/assets/uncovered_example_file.c +1 -1
- data/bin/actions_wrapper.rb +1 -1
- data/bin/app_cfg.rb +1 -1
- data/bin/ceedling +14 -3
- data/bin/cli.rb +110 -38
- data/bin/cli_handler.rb +167 -68
- data/bin/cli_helper.rb +179 -55
- data/bin/configinator.rb +71 -12
- data/bin/merginator.rb +82 -0
- data/bin/mixin_standardizer.rb +127 -0
- data/bin/mixinator.rb +199 -33
- data/bin/mixins.rb +4 -2
- data/bin/objects.yml +22 -1
- data/bin/path_validator.rb +1 -1
- data/bin/projectinator.rb +29 -20
- data/bin/rake_patches.rb +31 -0
- data/bin/recursive_merger.rb +128 -0
- data/bin/versionator.rb +2 -2
- data/ceedling.gemspec +31 -14
- data/config/test_environment.rb +1 -1
- data/docs/BreakingChanges.md +16 -3
- data/docs/Changelog.md +177 -6
- data/docs/KnownIssues.md +26 -0
- data/docs/ReleaseNotes.md +133 -19
- data/docs/mkdocs/assets/images/ceedling-logo-circle.png +0 -0
- data/docs/mkdocs/assets/images/ceedling.svg +90 -0
- data/docs/mkdocs/assets/images/favicon.png +0 -0
- data/docs/mkdocs/assets/stylesheets/admonitions.css +152 -0
- data/docs/mkdocs/assets/stylesheets/fixes-local.css +15 -0
- data/docs/mkdocs/assets/stylesheets/styling.css +102 -0
- data/docs/mkdocs/configuration/environment-vars.md +14 -0
- data/docs/mkdocs/configuration/global-collections.md +156 -0
- data/docs/mkdocs/configuration/index.md +75 -0
- data/docs/mkdocs/configuration/loading.md +89 -0
- data/docs/mkdocs/configuration/mixins.md +607 -0
- data/docs/mkdocs/configuration/parallel-builds.md +97 -0
- data/docs/mkdocs/configuration/project-file.md +198 -0
- data/docs/mkdocs/configuration/reference/cexception.md +35 -0
- data/docs/mkdocs/configuration/reference/cmock.md +106 -0
- data/docs/mkdocs/configuration/reference/defines.md +352 -0
- data/docs/mkdocs/configuration/reference/environment.md +55 -0
- data/docs/mkdocs/configuration/reference/extension.md +63 -0
- data/docs/mkdocs/configuration/reference/files.md +154 -0
- data/docs/mkdocs/configuration/reference/flags.md +296 -0
- data/docs/mkdocs/configuration/reference/index.md +168 -0
- data/docs/mkdocs/configuration/reference/libraries.md +82 -0
- data/docs/mkdocs/configuration/reference/mixins.md +24 -0
- data/docs/mkdocs/configuration/reference/paths.md +276 -0
- data/docs/mkdocs/configuration/reference/plugins.md +60 -0
- data/docs/mkdocs/configuration/reference/project.md +333 -0
- data/docs/mkdocs/configuration/reference/release-build.md +62 -0
- data/docs/mkdocs/configuration/reference/test-build.md +55 -0
- data/docs/mkdocs/configuration/reference/test-runner.md +61 -0
- data/docs/mkdocs/configuration/reference/tools.md +457 -0
- data/docs/mkdocs/configuration/reference/unity.md +49 -0
- data/docs/mkdocs/configuration/which-ceedling.md +77 -0
- data/docs/mkdocs/development/index.md +50 -0
- data/docs/mkdocs/development/plugins/configuration.md +164 -0
- data/docs/mkdocs/development/plugins/index.md +84 -0
- data/docs/{PluginDevelopmentGuide.md → mkdocs/development/plugins/plugin-subclass.md} +61 -312
- data/docs/mkdocs/development/plugins/rake-tasks.md +54 -0
- data/docs/mkdocs/development/workflow.md +284 -0
- data/docs/mkdocs/getting-started/command-line.md +477 -0
- data/docs/mkdocs/getting-started/example-projects/cipher-quest.md +65 -0
- data/docs/mkdocs/getting-started/example-projects/index.md +49 -0
- data/docs/mkdocs/getting-started/example-projects/temp-sensor.md +60 -0
- data/docs/mkdocs/getting-started/example-projects/wondrous-forest.md +45 -0
- data/docs/mkdocs/getting-started/index.md +41 -0
- data/docs/mkdocs/getting-started/installation.md +172 -0
- data/docs/mkdocs/getting-started/quick-start.md +65 -0
- data/docs/mkdocs/help.md +49 -0
- data/docs/mkdocs/index.md +215 -0
- data/docs/mkdocs/overview/build-system.md +115 -0
- data/docs/mkdocs/overview/index.md +29 -0
- data/docs/mkdocs/overview/test-environments.md +33 -0
- data/docs/mkdocs/overview/tools-and-frameworks.md +115 -0
- data/{plugins/beep/README.md → docs/mkdocs/plugins/beep.md} +10 -9
- data/{plugins/bullseye/README.md → docs/mkdocs/plugins/bullseye.md} +8 -12
- data/{plugins/command_hooks/README.md → docs/mkdocs/plugins/command-hooks.md} +69 -47
- data/{plugins/compile_commands_json_db/README.md → docs/mkdocs/plugins/compile-commands-json-db.md} +7 -5
- data/docs/mkdocs/plugins/cppcheck.md +377 -0
- data/{plugins/dependencies/README.md → docs/mkdocs/plugins/dependencies.md} +39 -50
- data/{plugins/fff/README.md → docs/mkdocs/plugins/fff.md} +42 -37
- data/docs/mkdocs/plugins/gcov/examples.md +92 -0
- data/docs/mkdocs/plugins/gcov/gcovr.md +251 -0
- data/docs/mkdocs/plugins/gcov/index.md +68 -0
- data/docs/mkdocs/plugins/gcov/overview.md +145 -0
- data/docs/mkdocs/plugins/gcov/reportgenerator.md +58 -0
- data/docs/mkdocs/plugins/gcov/reporting.md +147 -0
- data/docs/mkdocs/plugins/gcov/setup.md +232 -0
- data/docs/mkdocs/plugins/gcov/tool-versions.md +60 -0
- data/docs/mkdocs/plugins/gcov/troubleshooting.md +78 -0
- data/docs/mkdocs/plugins/index.md +221 -0
- data/{plugins/module_generator/README.md → docs/mkdocs/plugins/module-generator.md} +44 -44
- data/{plugins/report_build_warnings_log/README.md → docs/mkdocs/plugins/report-build-warnings-log.md} +6 -4
- data/{plugins/report_tests_gtestlike_stdout/README.md → docs/mkdocs/plugins/report-tests-gtestlike-stdout.md} +9 -7
- data/{plugins/report_tests_ide_stdout/README.md → docs/mkdocs/plugins/report-tests-ide-stdout.md} +8 -7
- data/{plugins/report_tests_log_factory/README.md → docs/mkdocs/plugins/report-tests-log-factory.md} +44 -36
- data/{plugins/report_tests_pretty_stdout/README.md → docs/mkdocs/plugins/report-tests-pretty-stdout.md} +8 -6
- data/{plugins/report_tests_raw_output_log/README.md → docs/mkdocs/plugins/report-tests-raw-output-log.md} +9 -7
- data/{plugins/report_tests_teamcity_stdout/README.md → docs/mkdocs/plugins/report-tests-teamcity-stdout.md} +8 -6
- data/docs/mkdocs/plugins/sample_html_report.png +0 -0
- data/docs/mkdocs/plugins/valgrind.md +192 -0
- data/docs/mkdocs/project/release-history.md +61 -0
- data/docs/{CeedlingUpgrade.md → mkdocs/project/upgrade.md} +9 -7
- data/docs/mkdocs/reference/build-directives.md +37 -0
- data/docs/mkdocs/reference/command-line.md +323 -0
- data/docs/mkdocs/reference/environment-vars.md +60 -0
- data/docs/mkdocs/reference/gcov-plugin.md +577 -0
- data/docs/mkdocs/reference/global-collections.md +160 -0
- data/docs/mkdocs/reference/index.md +65 -0
- data/docs/mkdocs/reference/partials-macros.md +79 -0
- data/docs/mkdocs/reference/project-configuration.md +46 -0
- data/docs/mkdocs/snapshot/assets/project.yml +404 -0
- data/docs/mkdocs/snapshot/examples/cipher_quest/README.md +210 -0
- data/docs/mkdocs/snapshot/examples/temp_sensor/README.md +283 -0
- data/docs/mkdocs/snapshot/examples/wondrous_forest/README.md +92 -0
- data/docs/mkdocs/snapshot/plugins/gcov/config/defaults.yml +33 -0
- data/docs/mkdocs/snapshot/plugins/gcov/config/defaults_gcov.rb +136 -0
- data/docs/mkdocs/snapshot.yml +20 -0
- data/docs/mkdocs/testing-guide/build-directives.md +153 -0
- data/docs/mkdocs/testing-guide/conventions.md +616 -0
- data/docs/mkdocs/testing-guide/frameworks.md +192 -0
- data/docs/mkdocs/testing-guide/index.md +80 -0
- data/docs/mkdocs/testing-guide/partials/configuration.md +67 -0
- data/docs/mkdocs/testing-guide/partials/conventions.md +68 -0
- data/docs/mkdocs/testing-guide/partials/directives.md +212 -0
- data/docs/mkdocs/testing-guide/partials/example.md +149 -0
- data/docs/mkdocs/testing-guide/partials/index.md +79 -0
- data/docs/mkdocs/testing-guide/partials/overview.md +81 -0
- data/docs/mkdocs/testing-guide/partials/variables.md +244 -0
- data/docs/mkdocs/testing-guide/test-cases.md +194 -0
- data/docs/mkdocs/testing-guide/test-sample.md +94 -0
- data/docs/mkdocs/testing-guide/test-suite-anatomy.md +58 -0
- data/examples/cipher_quest/README.md +210 -0
- data/examples/cipher_quest/mixin/release_analyze.yml +28 -0
- data/examples/cipher_quest/mixin/release_caesar.yml +28 -0
- data/examples/cipher_quest/mixin/release_full.yml +30 -0
- data/examples/cipher_quest/mixin/release_rot13.yml +28 -0
- data/examples/cipher_quest/project.yml +108 -0
- data/examples/cipher_quest/src/analyzer.c +83 -0
- data/examples/cipher_quest/src/analyzer.h +29 -0
- data/examples/cipher_quest/src/cipher.c +59 -0
- data/examples/cipher_quest/src/cipher.h +27 -0
- data/examples/cipher_quest/src/main.c +151 -0
- data/examples/cipher_quest/src/text_utils.c +119 -0
- data/examples/cipher_quest/src/text_utils.h +23 -0
- data/examples/cipher_quest/test/TestAnalyzer.c +133 -0
- data/examples/cipher_quest/test/TestCipherCaesar.c +81 -0
- data/examples/cipher_quest/test/TestCipherRot13.c +74 -0
- data/examples/cipher_quest/test/TestTextUtils.c +184 -0
- data/examples/temp_sensor/README.md +279 -14
- data/examples/temp_sensor/mixin/add_gcov.yml +1 -1
- data/examples/temp_sensor/mixin/add_unity_helper.yml +1 -1
- data/examples/temp_sensor/project.yml +4 -15
- data/examples/temp_sensor/src/AdcConductor.c +5 -1
- data/examples/temp_sensor/src/AdcConductor.h +1 -1
- data/examples/temp_sensor/src/AdcHardware.c +1 -1
- data/examples/temp_sensor/src/AdcHardware.h +1 -1
- data/examples/temp_sensor/src/AdcHardwareConfigurator.c +2 -1
- data/examples/temp_sensor/src/AdcHardwareConfigurator.h +1 -1
- data/examples/temp_sensor/src/AdcModel.c +2 -2
- data/examples/temp_sensor/src/AdcModel.h +1 -1
- data/examples/temp_sensor/src/AdcTemperatureSensor.c +2 -1
- data/examples/temp_sensor/src/AdcTemperatureSensor.h +1 -1
- data/examples/temp_sensor/src/Executor.c +1 -1
- data/examples/temp_sensor/src/Executor.h +1 -1
- data/examples/temp_sensor/src/IntrinsicsWrapper.c +1 -1
- data/examples/temp_sensor/src/IntrinsicsWrapper.h +1 -1
- data/examples/temp_sensor/src/Main.c +3 -3
- data/examples/temp_sensor/src/Main.h +1 -1
- data/examples/temp_sensor/src/Model.c +1 -1
- data/examples/temp_sensor/src/Model.h +1 -1
- data/examples/temp_sensor/src/ModelConfig.h +1 -1
- data/examples/temp_sensor/src/TaskScheduler.c +1 -1
- data/examples/temp_sensor/src/TaskScheduler.h +1 -1
- data/examples/temp_sensor/src/TemperatureFilter.c +1 -1
- data/examples/temp_sensor/src/TemperatureFilter.h +1 -1
- data/examples/temp_sensor/src/TimerConductor.c +1 -1
- data/examples/temp_sensor/src/TimerConductor.h +1 -1
- data/examples/temp_sensor/src/TimerConfigurator.c +2 -1
- data/examples/temp_sensor/src/TimerConfigurator.h +1 -1
- data/examples/temp_sensor/src/TimerHardware.c +1 -1
- data/examples/temp_sensor/src/TimerHardware.h +1 -1
- data/examples/temp_sensor/src/TimerInterruptConfigurator.c +2 -1
- data/examples/temp_sensor/src/TimerInterruptConfigurator.h +1 -1
- data/examples/temp_sensor/src/TimerInterruptHandler.c +2 -1
- data/examples/temp_sensor/src/TimerInterruptHandler.h +1 -1
- data/examples/temp_sensor/src/TimerModel.c +1 -1
- data/examples/temp_sensor/src/TimerModel.h +1 -1
- data/examples/temp_sensor/src/Types.h +5 -2
- data/examples/temp_sensor/src/UsartConductor.c +1 -1
- data/examples/temp_sensor/src/UsartConductor.h +1 -1
- data/examples/temp_sensor/src/UsartConfigurator.c +2 -1
- data/examples/temp_sensor/src/UsartConfigurator.h +1 -1
- data/examples/temp_sensor/src/UsartHardware.c +1 -1
- data/examples/temp_sensor/src/UsartHardware.h +1 -1
- data/examples/temp_sensor/src/UsartModel.c +2 -2
- data/examples/temp_sensor/src/UsartModel.h +1 -1
- data/examples/temp_sensor/src/UsartPutChar.c +2 -1
- data/examples/temp_sensor/src/UsartPutChar.h +1 -1
- data/examples/temp_sensor/src/UsartTransmitBufferStatus.c +2 -1
- data/examples/temp_sensor/src/UsartTransmitBufferStatus.h +1 -1
- data/examples/temp_sensor/src/{TemperatureCalculator.c → calculators/TemperatureCalculator.c} +1 -1
- data/examples/temp_sensor/src/{TemperatureCalculator.h → calculators/TemperatureCalculator.h} +1 -1
- data/examples/temp_sensor/src/{UsartBaudRateRegisterCalculator.c → calculators/UsartBaudRateRegisterCalculator.c} +1 -1
- data/examples/temp_sensor/src/{UsartBaudRateRegisterCalculator.h → calculators/UsartBaudRateRegisterCalculator.h} +1 -1
- data/examples/temp_sensor/test/TestExecutor.c +1 -1
- data/examples/temp_sensor/test/TestMain.c +5 -1
- data/examples/temp_sensor/test/TestModel.c +1 -1
- data/examples/temp_sensor/test/TestTaskScheduler.c +1 -1
- data/examples/temp_sensor/test/TestTemperatureCalculator.c +2 -2
- data/examples/temp_sensor/test/TestTemperatureFilter.c +5 -2
- data/examples/temp_sensor/test/TestTimerConductor.c +1 -1
- data/examples/temp_sensor/test/TestTimerHardware.c +1 -1
- data/examples/temp_sensor/test/TestTimerIntegrated.c +8 -4
- data/examples/temp_sensor/test/TestTimerModel.c +1 -1
- data/examples/temp_sensor/test/TestTimerPlatformStandin.c +154 -0
- data/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +1 -1
- data/examples/temp_sensor/test/TestUsartConductor.c +1 -1
- data/examples/temp_sensor/test/TestUsartHardware.c +1 -1
- data/examples/temp_sensor/test/TestUsartIntegrated.c +9 -5
- data/examples/temp_sensor/test/TestUsartModel.c +2 -2
- data/examples/temp_sensor/test/TestUsartPlatformStandin.c +145 -0
- data/examples/temp_sensor/test/adc/TestAdcConductor.c +1 -1
- data/examples/temp_sensor/test/adc/TestAdcHardware.c +1 -1
- data/examples/temp_sensor/test/adc/TestAdcModel.c +1 -1
- data/examples/temp_sensor/test/adc/TestAdcPlatformStandin.c +100 -0
- data/examples/temp_sensor/test/platform/at91sam7s256.c +25 -0
- data/examples/temp_sensor/test/platform/at91sam7s256.h +183 -0
- data/examples/temp_sensor/test/support/UnityHelper.c +1 -1
- data/examples/temp_sensor/test/support/UnityHelper.h +1 -1
- data/examples/wondrous_forest/README.md +92 -0
- data/{lib/ceedling/release_invoker_helper.rb → examples/wondrous_forest/mixin/add_gcov.yml} +14 -4
- data/examples/wondrous_forest/project.yml +86 -0
- data/examples/wondrous_forest/src/AlertManager.c +125 -0
- data/examples/wondrous_forest/src/AlertManager.h +30 -0
- data/examples/wondrous_forest/src/EventQueue.c +73 -0
- data/examples/wondrous_forest/src/EventQueue.h +22 -0
- data/examples/wondrous_forest/src/ForestMonitor.c +88 -0
- data/examples/wondrous_forest/src/ForestMonitor.h +18 -0
- data/examples/wondrous_forest/src/HumiditySensor.c +57 -0
- data/examples/wondrous_forest/src/HumiditySensor.h +17 -0
- data/examples/wondrous_forest/src/LightSensor.c +51 -0
- data/examples/wondrous_forest/src/LightSensor.h +18 -0
- data/examples/wondrous_forest/src/SensorHal.c +62 -0
- data/examples/wondrous_forest/src/SensorHal.h +19 -0
- data/examples/wondrous_forest/src/SoilMoisture.c +61 -0
- data/examples/wondrous_forest/src/SoilMoisture.h +19 -0
- data/examples/wondrous_forest/src/TemperatureSensor.c +67 -0
- data/examples/wondrous_forest/src/TemperatureSensor.h +18 -0
- data/examples/wondrous_forest/src/Types.h +84 -0
- data/examples/wondrous_forest/src/UartDriver.c +55 -0
- data/examples/wondrous_forest/src/UartDriver.h +18 -0
- data/examples/wondrous_forest/test/TestAlertManager.c +105 -0
- data/examples/wondrous_forest/test/TestEventQueue.c +117 -0
- data/examples/wondrous_forest/test/TestForestMonitor.c +118 -0
- data/examples/wondrous_forest/test/TestHumiditySensor.c +85 -0
- data/examples/wondrous_forest/test/TestLightSensor.c +79 -0
- data/examples/wondrous_forest/test/TestSensorHal.c +58 -0
- data/examples/wondrous_forest/test/TestSoilMoisture.c +96 -0
- data/examples/wondrous_forest/test/TestTemperatureSensor.c +100 -0
- data/examples/wondrous_forest/test/TestUartDriver.c +55 -0
- data/lib/ceedling/application.rb +1 -1
- data/lib/ceedling/array_patches.rb +28 -0
- data/lib/ceedling/batchinator.rb +76 -0
- data/lib/ceedling/c_extractor/c_extractor.rb +340 -0
- data/lib/ceedling/c_extractor/c_extractor_code_text.rb +283 -0
- data/lib/ceedling/c_extractor/c_extractor_constants.rb +38 -0
- data/lib/ceedling/c_extractor/c_extractor_declarations.rb +415 -0
- data/lib/ceedling/c_extractor/c_extractor_definitions.rb +157 -0
- data/lib/ceedling/c_extractor/c_extractor_functions.rb +402 -0
- data/lib/ceedling/c_extractor/c_extractor_preprocessing.rb +262 -0
- data/lib/ceedling/c_extractor/c_extractor_types.rb +122 -0
- data/lib/ceedling/cacheinator.rb +1 -1
- data/lib/ceedling/cacheinator_helper.rb +23 -4
- data/lib/ceedling/ceedling.h +40 -0
- data/lib/ceedling/{config_matchinator.rb → config/config_matchinator.rb} +67 -5
- data/lib/ceedling/{config_walkinator.rb → config/config_walkinator.rb} +1 -1
- data/lib/ceedling/{configurator.rb → config/configurator.rb} +269 -107
- data/lib/ceedling/{configurator_builder.rb → config/configurator_builder.rb} +25 -6
- data/lib/ceedling/{configurator_plugins.rb → config/configurator_plugins.rb} +2 -4
- data/lib/ceedling/{configurator_setup.rb → config/configurator_setup.rb} +39 -71
- data/lib/ceedling/{configurator_validator.rb → config/configurator_validator.rb} +1 -1
- data/lib/ceedling/constants.rb +59 -18
- data/lib/ceedling/defaults.rb +31 -44
- data/lib/ceedling/defineinator.rb +2 -2
- data/lib/ceedling/dependinator.rb +1 -1
- data/lib/ceedling/encodinator.rb +1 -1
- data/lib/ceedling/erb_wrapper.rb +1 -1
- data/lib/ceedling/exceptions.rb +23 -3
- data/lib/ceedling/file_finder.rb +39 -10
- data/lib/ceedling/file_finder_helper.rb +2 -2
- data/lib/ceedling/file_path_collection_utils.rb +37 -23
- data/lib/ceedling/file_path_utils.rb +183 -26
- data/lib/ceedling/file_system_wrapper.rb +1 -1
- data/lib/ceedling/file_wrapper.rb +14 -1
- data/lib/ceedling/flaginator.rb +1 -1
- data/lib/ceedling/{generator.rb → generators/generator.rb} +86 -23
- data/lib/ceedling/{generator_helper.rb → generators/generator_helper.rb} +17 -11
- data/lib/ceedling/{generator_mocks.rb → generators/generator_mocks.rb} +1 -1
- data/lib/ceedling/generators/generator_partials.rb +177 -0
- data/lib/ceedling/{generator_test_results.rb → generators/generator_test_results.rb} +43 -17
- data/lib/ceedling/generators/generator_test_results_backtrace.rb +290 -0
- data/lib/ceedling/{generator_test_results_sanity_checker.rb → generators/generator_test_results_sanity_checker.rb} +1 -1
- data/lib/ceedling/generators/generator_test_runner.rb +97 -0
- data/lib/ceedling/includes/include_factory.rb +43 -0
- data/lib/ceedling/{include_pathinator.rb → includes/include_pathinator.rb} +1 -1
- data/lib/ceedling/includes/includes.rb +341 -0
- data/lib/ceedling/loginator.rb +115 -12
- data/lib/ceedling/makefile.rb +1 -1
- data/lib/ceedling/objects.yml +145 -43
- data/lib/ceedling/parsing_parcels.rb +35 -9
- data/lib/ceedling/partials/partializer.rb +444 -0
- data/lib/ceedling/partials/partializer_config.rb +217 -0
- data/lib/ceedling/partials/partializer_helper.rb +344 -0
- data/lib/ceedling/partials/partializer_runtime.rb +29 -0
- data/lib/ceedling/partials/partializer_utils.rb +222 -0
- data/lib/ceedling/partials/partials.rb +82 -0
- data/lib/ceedling/{plugin.rb → plugins/plugin.rb} +1 -1
- data/lib/ceedling/{plugin_manager.rb → plugins/plugin_manager.rb} +47 -21
- data/lib/ceedling/{plugin_manager_helper.rb → plugins/plugin_manager_helper.rb} +1 -1
- data/lib/ceedling/{plugin_reportinator.rb → plugins/plugin_reportinator.rb} +10 -18
- data/lib/ceedling/{plugin_reportinator_helper.rb → plugins/plugin_reportinator_helper.rb} +22 -26
- data/lib/ceedling/plugins/report_tests_stdout_plugin.rb +88 -0
- data/lib/ceedling/preprocess/README.md +184 -0
- data/lib/ceedling/preprocess/c_comment_scanner.rb +194 -0
- data/lib/ceedling/preprocess/c_preprocessor_conditionals.rb +170 -0
- data/lib/ceedling/preprocess/preprocessinator.rb +605 -0
- data/lib/ceedling/preprocess/preprocessinator_bare_includes_extractor.rb +69 -0
- data/lib/ceedling/preprocess/preprocessinator_code_finder.rb +150 -0
- data/lib/ceedling/preprocess/preprocessinator_comment_stripper.rb +80 -0
- data/lib/ceedling/preprocess/preprocessinator_file_assembler.rb +378 -0
- data/lib/ceedling/preprocess/preprocessinator_includes_handler.rb +224 -0
- data/lib/ceedling/preprocess/preprocessinator_line_marker_includes_extractor.rb +215 -0
- data/lib/ceedling/preprocess/preprocessinator_reconstructor.rb +398 -0
- data/lib/ceedling/rake_app/rake_invocation_tracker.rb +39 -0
- data/lib/ceedling/rake_app/rake_task_registry.rb +210 -0
- data/lib/ceedling/{rake_utils.rb → rake_app/rake_utils.rb} +1 -1
- data/lib/ceedling/{rake_wrapper.rb → rake_app/rake_wrapper.rb} +1 -1
- data/lib/ceedling/rake_app/rakefile_component_resolver.rb +77 -0
- data/lib/ceedling/rakefile.rb +16 -8
- data/lib/ceedling/release_invoker.rb +48 -4
- data/lib/ceedling/reportinator.rb +39 -18
- data/lib/ceedling/ruby_expandinator.rb +61 -0
- data/lib/ceedling/rules_release.rake +4 -2
- data/lib/ceedling/rules_tests.rake +1 -23
- data/lib/ceedling/setupinator.rb +23 -11
- data/lib/ceedling/stream_wrapper.rb +1 -1
- data/lib/ceedling/system_utils.rb +1 -1
- data/lib/ceedling/system_wrapper.rb +18 -21
- data/lib/ceedling/tasks_base.rake +3 -3
- data/lib/ceedling/tasks_filesystem.rake +22 -12
- data/lib/ceedling/tasks_release.rake +11 -18
- data/lib/ceedling/tasks_tests.rake +1 -1
- data/lib/ceedling/test_context_extractor.rb +178 -109
- data/lib/ceedling/test_invoker/test_build_executor.rb +661 -0
- data/lib/ceedling/test_invoker/test_build_planner.rb +277 -0
- data/lib/ceedling/test_invoker/test_build_setup.rb +441 -0
- data/lib/ceedling/test_invoker/test_invoker.rb +251 -0
- data/lib/ceedling/test_invoker/test_invoker_types.rb +56 -0
- data/lib/ceedling/test_runner_manager.rb +1 -1
- data/lib/ceedling/tool_executor.rb +29 -19
- data/lib/ceedling/tool_executor_helper.rb +7 -15
- data/lib/ceedling/tool_validator.rb +24 -8
- data/lib/ceedling/verbosinator.rb +1 -1
- data/lib/ceedling/yaml_wrapper.rb +72 -12
- data/lib/ceedling.rb +1 -1
- data/lib/snapshot.rb +43 -0
- data/lib/version.rb +2 -2
- data/license.txt +1 -1
- data/mkdocs.local.yml +45 -0
- data/mkdocs.yml +202 -0
- data/plugins/beep/config/defaults.yml +1 -1
- data/plugins/beep/config/defaults_beep.rb +1 -1
- data/plugins/beep/lib/beep.rb +7 -5
- data/plugins/bullseye/assets/template.erb +1 -1
- data/plugins/bullseye/bullseye.rake +1 -1
- data/plugins/bullseye/config/defaults.yml +1 -1
- data/plugins/bullseye/lib/bullseye.rb +9 -9
- data/plugins/command_hooks/lib/command_hooks.rb +43 -38
- data/plugins/compile_commands_json_db/lib/compile_commands_json_db.rb +2 -2
- data/plugins/cppcheck/AUTHORS.md +8 -0
- data/plugins/cppcheck/config/defaults.yml +44 -0
- data/plugins/cppcheck/config/defaults_cppcheck.rb +32 -0
- data/plugins/cppcheck/cppcheck.rake +54 -0
- data/plugins/cppcheck/lib/cppcheck.rb +247 -0
- data/plugins/cppcheck/lib/cppcheck_constants.rb +20 -0
- data/plugins/cppcheck/lib/cppcheck_reports.rb +160 -0
- data/plugins/dependencies/Rakefile +1 -1
- data/plugins/dependencies/config/defaults.yml +1 -1
- data/plugins/dependencies/dependencies.rake +3 -3
- data/plugins/dependencies/example/boss/project.yml +1 -3
- data/plugins/dependencies/example/boss/src/boss.c +1 -1
- data/plugins/dependencies/example/boss/src/boss.h +1 -1
- data/plugins/dependencies/example/boss/src/main.c +1 -1
- data/plugins/dependencies/example/boss/test/test_boss.c +1 -1
- data/plugins/dependencies/example/supervisor/project.yml +1 -3
- data/plugins/dependencies/example/supervisor/src/supervisor.c +1 -1
- data/plugins/dependencies/example/supervisor/src/supervisor.h +1 -1
- data/plugins/dependencies/example/supervisor/test/test_supervisor.c +1 -1
- data/plugins/dependencies/lib/dependencies.rb +14 -2
- data/plugins/fff/Rakefile +1 -1
- data/plugins/fff/config/fff.yml +1 -1
- data/plugins/fff/examples/fff_example/project.yml +2 -2
- data/plugins/fff/examples/fff_example/src/bar.c +1 -1
- data/plugins/fff/examples/fff_example/src/bar.h +1 -1
- data/plugins/fff/examples/fff_example/src/custom_types.h +1 -1
- data/plugins/fff/examples/fff_example/src/display.c +1 -1
- data/plugins/fff/examples/fff_example/src/display.h +1 -1
- data/plugins/fff/examples/fff_example/src/event_processor.c +1 -1
- data/plugins/fff/examples/fff_example/src/event_processor.h +1 -1
- data/plugins/fff/examples/fff_example/src/foo.c +1 -1
- data/plugins/fff/examples/fff_example/src/foo.h +1 -1
- data/plugins/fff/examples/fff_example/src/subfolder/zzz.c +1 -1
- data/plugins/fff/examples/fff_example/src/subfolder/zzz.h +1 -1
- data/plugins/fff/examples/fff_example/test/test_event_processor.c +1 -1
- data/plugins/fff/examples/fff_example/test/test_foo.c +1 -1
- data/plugins/fff/lib/fff.rb +10 -5
- data/plugins/fff/lib/fff_mock_generator.rb +1 -1
- data/plugins/fff/spec/fff_mock_header_generator_spec.rb +1 -1
- data/plugins/fff/spec/fff_mock_source_generator_spec.rb +1 -1
- data/plugins/fff/spec/header_generator.rb +1 -1
- data/plugins/fff/spec/spec_helper.rb +1 -1
- data/plugins/fff/src/fff_unity_helper.h +1 -1
- data/plugins/gcov/config/defaults.yml +4 -1
- data/plugins/gcov/config/defaults_gcov.rb +40 -13
- data/plugins/gcov/gcov.rake +31 -1
- data/plugins/gcov/lib/console_reportinator.rb +180 -0
- data/plugins/gcov/lib/gcov.rb +189 -103
- data/plugins/gcov/lib/gcov_constants.rb +16 -4
- data/plugins/gcov/lib/gcov_reportinator.rb +63 -0
- data/{spec/configurator_helper_spec.rb → plugins/gcov/lib/gcov_types.rb} +2 -6
- data/plugins/gcov/lib/gcovr_reportinator.rb +237 -136
- data/plugins/gcov/lib/reportgenerator_reportinator.rb +242 -116
- data/plugins/module_generator/Rakefile +1 -1
- data/plugins/module_generator/assets/stubby1.h +1 -1
- data/plugins/module_generator/assets/stubby2.h +1 -1
- data/plugins/module_generator/config/module_generator.yml +1 -1
- data/plugins/module_generator/example/project.yml +1 -3
- data/plugins/module_generator/lib/module_generator.rb +2 -2
- data/plugins/module_generator/module_generator.rake +1 -1
- data/plugins/report_build_warnings_log/lib/report_build_warnings_log.rb +14 -20
- data/plugins/report_tests_gtestlike_stdout/assets/template.erb +3 -3
- data/plugins/report_tests_gtestlike_stdout/config/report_tests_gtestlike_stdout.yml +1 -1
- data/plugins/report_tests_gtestlike_stdout/lib/report_tests_gtestlike_stdout.rb +4 -61
- data/plugins/report_tests_ide_stdout/config/report_tests_ide_stdout.yml +1 -1
- data/plugins/report_tests_ide_stdout/lib/report_tests_ide_stdout.rb +7 -60
- data/plugins/report_tests_log_factory/config/defaults.yml +1 -1
- data/plugins/report_tests_log_factory/lib/cppunit_tests_reporter.rb +5 -5
- data/plugins/report_tests_log_factory/lib/html_tests_reporter.rb +302 -133
- data/plugins/report_tests_log_factory/lib/json_tests_reporter.rb +9 -7
- data/plugins/report_tests_log_factory/lib/junit_tests_reporter.rb +6 -5
- data/plugins/report_tests_log_factory/lib/report_tests_log_factory.rb +72 -36
- data/plugins/report_tests_log_factory/lib/tests_reporter.rb +8 -8
- data/plugins/report_tests_pretty_stdout/assets/template.erb +1 -2
- data/plugins/report_tests_pretty_stdout/config/report_tests_pretty_stdout.yml +1 -1
- data/plugins/report_tests_pretty_stdout/lib/report_tests_pretty_stdout.rb +4 -65
- data/plugins/report_tests_raw_output_log/lib/report_tests_raw_output_log.rb +4 -4
- data/plugins/report_tests_teamcity_stdout/config/defaults.yml +1 -1
- data/plugins/report_tests_teamcity_stdout/config/report_tests_teamcity_stdout.yml +1 -1
- data/plugins/report_tests_teamcity_stdout/lib/report_tests_teamcity_stdout.rb +2 -2
- data/plugins/valgrind/config/defaults.yml +19 -0
- data/plugins/valgrind/config/defaults_valgrind.rb +20 -0
- data/plugins/valgrind/lib/valgrind.rb +132 -0
- data/plugins/valgrind/lib/valgrind_constants.rb +13 -0
- data/plugins/valgrind/valgrind.rake +87 -0
- data/site-local/404.html +4002 -0
- data/site-local/assets/images/ceedling-logo-circle.png +0 -0
- data/site-local/assets/images/ceedling.svg +90 -0
- data/site-local/assets/images/favicon.png +0 -0
- data/site-local/assets/javascripts/bundle.79ae519e.min.js +16 -0
- data/site-local/assets/javascripts/bundle.79ae519e.min.js.map +7 -0
- data/site-local/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- data/site-local/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- data/site-local/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- data/site-local/assets/javascripts/lunr/tinyseg.js +206 -0
- data/site-local/assets/javascripts/lunr/wordcut.js +6708 -0
- data/site-local/assets/javascripts/workers/search.2c215733.min.js +42 -0
- data/site-local/assets/javascripts/workers/search.2c215733.min.js.map +7 -0
- data/site-local/assets/stylesheets/admonitions.css +152 -0
- data/site-local/assets/stylesheets/fixes-local.css +15 -0
- data/site-local/assets/stylesheets/main.484c7ddc.min.css +1 -0
- data/site-local/assets/stylesheets/main.484c7ddc.min.css.map +1 -0
- data/site-local/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
- data/site-local/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
- data/site-local/assets/stylesheets/styling.css +102 -0
- data/site-local/configuration/environment-vars.html +4102 -0
- data/site-local/configuration/global-collections.html +4248 -0
- data/site-local/configuration/index.html +4169 -0
- data/site-local/configuration/loading.html +4348 -0
- data/site-local/configuration/mixins.html +5060 -0
- data/site-local/configuration/parallel-builds.html +4347 -0
- data/site-local/configuration/project-file.html +4474 -0
- data/site-local/configuration/reference/cexception.html +4225 -0
- data/site-local/configuration/reference/cmock.html +4401 -0
- data/site-local/configuration/reference/defines.html +4734 -0
- data/site-local/configuration/reference/environment.html +4242 -0
- data/site-local/configuration/reference/extension.html +4387 -0
- data/site-local/configuration/reference/files.html +4541 -0
- data/site-local/configuration/reference/flags.html +4681 -0
- data/site-local/configuration/reference/index.html +4290 -0
- data/site-local/configuration/reference/libraries.html +4365 -0
- data/site-local/configuration/reference/mixins.html +4195 -0
- data/site-local/configuration/reference/paths.html +4714 -0
- data/site-local/configuration/reference/plugins.html +4262 -0
- data/site-local/configuration/reference/project.html +4777 -0
- data/site-local/configuration/reference/release-build.html +4287 -0
- data/site-local/configuration/reference/test-build.html +4264 -0
- data/site-local/configuration/reference/test-runner.html +4289 -0
- data/site-local/configuration/reference/tools.html +5120 -0
- data/site-local/configuration/reference/unity.html +4255 -0
- data/site-local/configuration/which-ceedling.html +4269 -0
- data/site-local/development/index.html +4148 -0
- data/site-local/development/plugins/configuration.html +4446 -0
- data/site-local/development/plugins/index.html +4212 -0
- data/site-local/development/plugins/plugin-subclass.html +5068 -0
- data/site-local/development/plugins/rake-tasks.html +4236 -0
- data/site-local/development/workflow.html +4664 -0
- data/site-local/getting-started/command-line.html +5498 -0
- data/site-local/getting-started/example-projects/cipher-quest.html +4272 -0
- data/site-local/getting-started/example-projects/index.html +4173 -0
- data/site-local/getting-started/example-projects/temp-sensor.html +4322 -0
- data/site-local/getting-started/example-projects/wondrous-forest.html +4290 -0
- data/site-local/getting-started/index.html +4116 -0
- data/site-local/getting-started/installation.html +4452 -0
- data/site-local/getting-started/quick-start.html +4262 -0
- data/site-local/help.html +4081 -0
- data/site-local/index.html +4364 -0
- data/site-local/overview/build-system.html +4288 -0
- data/site-local/overview/index.html +4103 -0
- data/site-local/overview/test-environments.html +4116 -0
- data/site-local/overview/tools-and-frameworks.html +4433 -0
- data/site-local/plugins/beep.html +4413 -0
- data/site-local/plugins/bullseye.html +4249 -0
- data/site-local/plugins/command-hooks.html +5023 -0
- data/site-local/plugins/compile-commands-json-db.html +4243 -0
- data/site-local/plugins/cppcheck.html +4851 -0
- data/site-local/plugins/dependencies.html +4828 -0
- data/site-local/plugins/fff.html +4661 -0
- data/site-local/plugins/gcov/examples.html +4293 -0
- data/site-local/plugins/gcov/gcovr.html +4512 -0
- data/site-local/plugins/gcov/index.html +4150 -0
- data/site-local/plugins/gcov/overview.html +4410 -0
- data/site-local/plugins/gcov/reportgenerator.html +4164 -0
- data/site-local/plugins/gcov/reporting.html +4336 -0
- data/site-local/plugins/gcov/setup.html +4597 -0
- data/site-local/plugins/gcov/tool-versions.html +4269 -0
- data/site-local/plugins/gcov/troubleshooting.html +4313 -0
- data/site-local/plugins/index.html +4348 -0
- data/site-local/plugins/module-generator.html +4588 -0
- data/site-local/plugins/report-build-warnings-log.html +4229 -0
- data/site-local/plugins/report-tests-gtestlike-stdout.html +4357 -0
- data/site-local/plugins/report-tests-ide-stdout.html +4270 -0
- data/site-local/plugins/report-tests-log-factory.html +4792 -0
- data/site-local/plugins/report-tests-pretty-stdout.html +4265 -0
- data/site-local/plugins/report-tests-raw-output-log.html +4292 -0
- data/site-local/plugins/report-tests-teamcity-stdout.html +4291 -0
- data/site-local/plugins/sample_html_report.png +0 -0
- data/site-local/plugins/valgrind.html +4605 -0
- data/site-local/project/release-history.html +4225 -0
- data/site-local/project/upgrade.html +4314 -0
- data/site-local/reference/build-directives.html +4210 -0
- data/site-local/reference/command-line.html +4989 -0
- data/site-local/reference/environment-vars.html +4278 -0
- data/site-local/reference/gcov-plugin.html +5886 -0
- data/site-local/reference/global-collections.html +4385 -0
- data/site-local/reference/index.html +4126 -0
- data/site-local/reference/partials-macros.html +4326 -0
- data/site-local/reference/project-configuration.html +4253 -0
- data/site-local/sitemap.xml +3 -0
- data/site-local/sitemap.xml.gz +0 -0
- data/site-local/snapshot/assets/project.yml +404 -0
- data/site-local/snapshot/examples/cipher_quest/index.html +4292 -0
- data/site-local/snapshot/examples/temp_sensor/index.html +4416 -0
- data/site-local/snapshot/examples/wondrous_forest/index.html +4200 -0
- data/site-local/snapshot/plugins/gcov/config/defaults.yml +33 -0
- data/site-local/snapshot/plugins/gcov/config/defaults_gcov.rb +136 -0
- data/site-local/testing-guide/build-directives.html +4481 -0
- data/site-local/testing-guide/conventions.html +5233 -0
- data/site-local/testing-guide/frameworks.html +4488 -0
- data/site-local/testing-guide/index.html +4174 -0
- data/site-local/testing-guide/partials/configuration.html +4347 -0
- data/site-local/testing-guide/partials/conventions.html +4327 -0
- data/site-local/testing-guide/partials/directives.html +4680 -0
- data/site-local/testing-guide/partials/example.html +4448 -0
- data/site-local/testing-guide/partials/index.html +4167 -0
- data/site-local/testing-guide/partials/overview.html +4322 -0
- data/site-local/testing-guide/partials/variables.html +4548 -0
- data/site-local/testing-guide/test-cases.html +4436 -0
- data/site-local/testing-guide/test-sample.html +4265 -0
- data/site-local/testing-guide/test-suite-anatomy.html +4249 -0
- data/spec/manual/stress_test.rb +1 -1
- data/spec/support/other_target.yml +1 -1
- data/spec/support/spec_helper.rb +20 -0
- data/spec/support/system/gem_dir_layout.rb +20 -0
- data/spec/support/system/spec_system_helper.rb +206 -0
- data/spec/support/system/system_context.rb +310 -0
- data/spec/support/system/system_test_output.rb +28 -0
- data/spec/support/target.yml +1 -1
- data/spec/system/cppcheck_deployment_spec.rb +49 -0
- data/spec/system/deployment_as_gem_spec.rb +86 -48
- data/spec/system/deployment_as_vendor_spec.rb +141 -79
- data/spec/system/encoding_stress_spec.rb +153 -0
- data/spec/system/example_cipher_quest_spec.rb +186 -0
- data/spec/system/example_temp_sensor_spec.rb +41 -35
- data/spec/system/example_wondrous_forest_spec.rb +117 -0
- data/spec/{gcov → system}/gcov_deployment_spec.rb +55 -26
- data/spec/system/mixin_ordering_spec.rb +548 -0
- data/spec/system/preprocessing_encoding_spec.rb +114 -0
- data/spec/system/preprocessing_fallback_conditionals_spec.rb +166 -0
- data/spec/system/preprocessing_locale_spec.rb +153 -0
- data/spec/system/preprocessing_parameterized_tests_spec.rb +183 -0
- data/spec/system/ruby_replacement_spec.rb +141 -0
- data/spec/{spec_system_helper.rb → system/support/common_test_cases.rb} +301 -350
- data/spec/system/support/cppcheck_common_test_cases.rb +98 -0
- data/spec/system/support/cppcheck_helpers.rb +27 -0
- data/spec/{gcov/gcov_test_cases_spec.rb → system/support/gcov_common_test_cases.rb} +224 -111
- data/spec/system/support/gcov_helpers.rb +81 -0
- data/spec/system/support/valgrind_common_test_cases.rb +120 -0
- data/spec/system/support/valgrind_helpers.rb +21 -0
- data/spec/system/upgrade_as_vendor_spec.rb +74 -39
- data/spec/system/valgrind_deployment_spec.rb +53 -0
- data/spec/units/bin/cli_helper_spec.rb +69 -0
- data/spec/units/bin/merginator_spec.rb +279 -0
- data/spec/units/bin/mixin_standardizer_spec.rb +231 -0
- data/spec/units/bin/mixinator_spec.rb +583 -0
- data/spec/units/bin/projectinator_mixin_spec.rb +362 -0
- data/spec/units/bin/recursive_merger_spec.rb +241 -0
- data/spec/units/c_extractor/c_extractor_code_text_spec.rb +2091 -0
- data/spec/units/c_extractor/c_extractor_declarations_spec.rb +746 -0
- data/spec/units/c_extractor/c_extractor_definitions_spec.rb +417 -0
- data/spec/units/c_extractor/c_extractor_functions_spec.rb +2742 -0
- data/spec/units/c_extractor/c_extractor_integration_spec.rb +935 -0
- data/spec/units/c_extractor/c_extractor_preprocessing_spec.rb +497 -0
- data/spec/units/c_extractor/c_extractor_spec.rb +356 -0
- data/spec/units/config_matchinator_spec.rb +401 -0
- data/spec/{config_walkinator_spec.rb → units/config_walkinator_spec.rb} +2 -2
- data/spec/{configurator_builder_spec.rb → units/configurator_builder_spec.rb} +1 -1
- data/spec/units/configurator_spec.rb +187 -0
- data/spec/{file_finder_helper_spec.rb → units/file_finder_helper_spec.rb} +1 -1
- data/spec/units/file_path_collection_utils_spec.rb +222 -0
- data/spec/units/file_path_utils_spec.rb +274 -0
- data/spec/units/generators/generator_helper_spec.rb +112 -0
- data/spec/units/generators/generator_partials_spec.rb +795 -0
- data/spec/units/generators/generator_test_results_backtrace_spec.rb +492 -0
- data/spec/{generator_test_results_sanity_checker_spec.rb → units/generators/generator_test_results_sanity_checker_spec.rb} +5 -4
- data/spec/units/generators/generator_test_results_spec.rb +412 -0
- data/spec/units/generators/generator_test_runner_spec.rb +120 -0
- data/spec/units/includes/include_spec.rb +716 -0
- data/spec/units/includes/includes_spec.rb +1069 -0
- data/spec/units/parsing_parcels_spec.rb +139 -0
- data/spec/units/partials/partializer_config_spec.rb +388 -0
- data/spec/units/partials/partializer_helper_spec.rb +992 -0
- data/spec/units/partials/partializer_spec.rb +1629 -0
- data/spec/units/partials/partializer_utils_spec.rb +587 -0
- data/spec/units/plugin_manager_spec.rb +48 -0
- data/spec/units/plugins/cppcheck_spec.rb +557 -0
- data/spec/units/preprocess/c_comment_scanner_spec.rb +409 -0
- data/spec/units/preprocess/c_preprocessor_conditionals_spec.rb +396 -0
- data/spec/units/preprocess/preprocessinator_code_finder_spec.rb +361 -0
- data/spec/units/preprocess/preprocessinator_comment_stripper_spec.rb +580 -0
- data/spec/units/preprocess/preprocessinator_file_assembler_spec.rb +263 -0
- data/spec/units/preprocess/preprocessinator_includes_handler_spec.rb +337 -0
- data/spec/{preprocessinator_extractor_spec.rb → units/preprocess/preprocessinator_reconstructor_spec.rb} +297 -5
- data/spec/units/reportinator_spec.rb +251 -0
- data/spec/units/ruby_expandinator_spec.rb +91 -0
- data/spec/{system_utils_spec.rb → units/system_utils_spec.rb} +4 -4
- data/spec/units/test_context_extractor_spec.rb +437 -0
- data/spec/{tool_executor_helper_spec.rb → units/tool_executor_helper_spec.rb} +19 -33
- data/spec/units/tool_executor_spec.rb +83 -0
- data/spec/units/tool_validator_spec.rb +60 -0
- data/spec/units/yaml_wrapper_spec.rb +108 -0
- data/vendor/cmock/Gemfile +4 -1
- data/vendor/cmock/LICENSE.txt +1 -1
- data/vendor/cmock/config/production_environment.rb +1 -1
- data/vendor/cmock/config/test_environment.rb +1 -1
- data/vendor/cmock/docs/CMockChangeLog.md +47 -0
- data/vendor/cmock/docs/CMockKnownIssues.md +0 -1
- data/vendor/cmock/docs/CMock_ArgumentValidation.md +180 -25
- data/vendor/cmock/docs/CMock_Summary.md +158 -16
- data/vendor/cmock/examples/make_example/Makefile +1 -1
- data/vendor/cmock/examples/make_example/src/foo.c +1 -1
- data/vendor/cmock/examples/make_example/src/foo.h +1 -1
- data/vendor/cmock/examples/make_example/src/main.c +1 -1
- data/vendor/cmock/examples/make_example/test/test_foo.c +1 -1
- data/vendor/cmock/examples/make_example/test/test_main.c +2 -2
- data/vendor/cmock/examples/temp_sensor/project.yml +75 -0
- data/vendor/cmock/examples/temp_sensor/rakefile.rb +3 -3
- data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +163 -119
- data/vendor/cmock/examples/temp_sensor/src/AT91SAM7X256.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcConductor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcConductor.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcHardware.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcHardware.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcModel.c +3 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcModel.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Executor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Executor.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Main.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Main.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Model.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Model.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/ModelConfig.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TaskScheduler.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TaskScheduler.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TemperatureCalculator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TemperatureCalculator.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TemperatureFilter.c +2 -2
- data/vendor/cmock/examples/temp_sensor/src/TemperatureFilter.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerConductor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerConductor.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerConfigurator.c +2 -2
- data/vendor/cmock/examples/temp_sensor/src/TimerConfigurator.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerHardware.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerHardware.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c +10 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerInterruptHandler.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerInterruptHandler.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerModel.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/TimerModel.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/Types.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartConductor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartConductor.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartConfigurator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartConfigurator.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartHardware.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartHardware.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartModel.c +2 -2
- data/vendor/cmock/examples/temp_sensor/src/UsartModel.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartPutChar.c +2 -2
- data/vendor/cmock/examples/temp_sensor/src/UsartPutChar.h +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c +1 -1
- data/vendor/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestAdcConductor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestAdcModel.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestExecutor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestMain.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestModel.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTaskScheduler.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTemperatureFilter.c +2 -2
- data/vendor/cmock/examples/temp_sensor/test/TestTimerConductor.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTimerConfigurator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTimerHardware.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestTimerModel.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestUsartConductor.c +7 -5
- data/vendor/cmock/examples/temp_sensor/test/TestUsartConfigurator.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestUsartHardware.c +3 -2
- data/vendor/cmock/examples/temp_sensor/test/TestUsartModel.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestUsartPutChar.c +1 -1
- data/vendor/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c +1 -1
- data/vendor/cmock/lib/cmock.rb +1 -1
- data/vendor/cmock/lib/cmock_config.rb +8 -2
- data/vendor/cmock/lib/cmock_file_writer.rb +38 -1
- data/vendor/cmock/lib/cmock_generator.rb +44 -27
- data/vendor/cmock/lib/cmock_generator_plugin_array.rb +68 -15
- data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +13 -3
- data/vendor/cmock/lib/cmock_generator_plugin_cexception.rb +12 -3
- data/vendor/cmock/lib/cmock_generator_plugin_expect.rb +33 -15
- data/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb +13 -8
- data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +15 -10
- data/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb +4 -2
- data/vendor/cmock/lib/cmock_generator_plugin_ignore_stateless.rb +15 -10
- data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +53 -3
- data/vendor/cmock/lib/cmock_generator_utils.rb +159 -43
- data/vendor/cmock/lib/cmock_header_parser.rb +217 -26
- data/vendor/cmock/lib/cmock_plugin_manager.rb +1 -1
- data/vendor/cmock/lib/cmock_unityhelper_parser.rb +7 -2
- data/vendor/cmock/lib/cmock_version.rb +1 -1
- data/vendor/cmock/scripts/create_makefile.rb +7 -5
- data/vendor/cmock/src/cmock.c +132 -129
- data/vendor/cmock/src/cmock.h +7 -13
- data/vendor/cmock/src/cmock_internals.h +73 -39
- data/vendor/cmock/test/c/TestCMockC.c +1 -7
- data/vendor/cmock/test/c/TestCMockC.yml +1 -1
- data/vendor/cmock/test/c/TestCMockCDynamic.c +1 -7
- data/vendor/cmock/test/c/TestCMockCDynamic.yml +1 -1
- data/vendor/cmock/test/c/TestCMockCDynamic_Runner.c +1 -7
- data/vendor/cmock/test/c/TestCMockC_Runner.c +1 -7
- data/vendor/cmock/{vendor/unity/test/targets/gcc_manual_math.yml → test/gcc_64_valgrind.yml} +8 -17
- data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h +1 -1
- data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h +1 -1
- data/vendor/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h +1 -1
- data/vendor/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c +1 -1
- data/vendor/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h +1 -1
- data/vendor/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h +1 -1
- data/vendor/cmock/test/iar/iar_v5/incIAR/project.h +1 -1
- data/vendor/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c +1 -1
- data/vendor/cmock/test/project.yml +32 -0
- data/vendor/cmock/test/rakefile +74 -58
- data/vendor/cmock/test/rakefile_helper.rb +359 -152
- data/vendor/cmock/test/system/systest_generator.rb +2 -2
- data/vendor/cmock/test/system/test_compilation/callingconv.h +1 -7
- data/vendor/cmock/test/system/test_compilation/config.yml +10 -1
- data/vendor/cmock/test/system/test_compilation/const.h +7 -13
- data/vendor/cmock/test/system/test_compilation/inline.h +1 -2
- data/vendor/cmock/test/system/test_compilation/osek.h +1 -7
- data/vendor/cmock/test/system/test_compilation/parsing.h +37 -7
- data/vendor/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +5 -13
- data/vendor/cmock/test/system/test_interactions/all_plugins_coexist.yml +5 -5
- data/vendor/cmock/test/system/test_interactions/array_handling.yml +758 -0
- data/vendor/cmock/test/system/test_interactions/basic_expect_and_return.yml +2 -2
- data/vendor/cmock/test/system/test_interactions/char_string_array_plugin.yml +113 -0
- data/vendor/cmock/test/system/test_interactions/const_custom_type.yml +68 -0
- data/vendor/cmock/test/system/test_interactions/const_primitives_handling.yml +4 -3
- data/vendor/cmock/test/system/test_interactions/const_ptr_return_and_arg.yml +89 -0
- data/vendor/cmock/test/system/test_interactions/debug_output.yml +235 -0
- data/vendor/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml +16 -16
- data/vendor/cmock/test/system/test_interactions/enforce_strict_ordering.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +3 -3
- data/vendor/cmock/test/system/test_interactions/expect_and_throw.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/expect_any_args.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/fancy_pointer_handling.yml +3 -3
- data/vendor/cmock/test/system/test_interactions/function_pointer_handling.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/ignore_and_return.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/ignore_and_return_stateless.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/newer_standards_stuff1.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml +2 -2
- data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +7 -4
- data/vendor/cmock/test/system/test_interactions/out_of_memory.yml +65 -8
- data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/parsing_challenges_with_func_pointers.yml +88 -0
- data/vendor/cmock/test/system/test_interactions/pointer_handling.yml +465 -0
- data/vendor/cmock/test/system/test_interactions/{return_thru_ptr_and_expect_any_args.yml → return_thru_ptr_expect_any_args.yml} +9 -13
- data/vendor/cmock/test/system/test_interactions/return_thru_ptr_ignore.yml +142 -0
- data/vendor/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +13 -9
- data/vendor/cmock/test/system/test_interactions/skeleton.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/skeleton_update.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/stubs_with_callbacks.yml +14 -2
- data/vendor/cmock/test/system/test_interactions/teardown_mock_calls.yml +57 -0
- data/vendor/cmock/test/system/test_interactions/teardown_mock_expectations.yml +59 -0
- data/vendor/cmock/test/system/test_interactions/unity_64bit_support.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/unity_ignores.yml +1 -1
- data/vendor/cmock/test/system/test_interactions/unity_void_pointer_compare.yml +9 -9
- data/vendor/cmock/test/system/test_interactions/void_pointer_no_array_plugin.yml +133 -0
- data/vendor/cmock/test/system/test_interactions/void_pointer_treat_as_void_array_plugin.yml +102 -0
- data/vendor/cmock/test/system/test_interactions/volatile_pointer_handling.yml +291 -0
- data/vendor/cmock/test/system/test_interactions/wrong_expect_and_return.yml +9 -1
- data/vendor/cmock/test/targets/iar_arm.yml +14 -0
- data/vendor/cmock/test/targets/tiny.yml +36 -0
- data/vendor/cmock/test/test_helper.rb +1 -2
- data/vendor/cmock/test/unit/cmock_config_test.rb +1 -2
- data/vendor/cmock/test/unit/cmock_config_test.yml +1 -1
- data/vendor/cmock/test/unit/cmock_file_writer_test.rb +1 -1
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +6 -0
- data/vendor/cmock/test/unit/cmock_generator_no_error_stubs_plugin_array_test.rb +90 -0
- data/vendor/cmock/test/unit/cmock_generator_no_error_stubs_plugin_expect_any_args_test.rb +38 -0
- data/vendor/cmock/test/unit/cmock_generator_no_error_stubs_plugin_expect_test.rb +55 -0
- data/vendor/cmock/test/unit/cmock_generator_no_error_stubs_plugin_ignore_stateless_test.rb +42 -0
- data/vendor/cmock/test/unit/cmock_generator_no_error_stubs_plugin_ignore_test.rb +42 -0
- data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +63 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +24 -6
- 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 +118 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +4 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +2 -1
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_stateless_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +135 -3
- data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +177 -9
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +705 -109
- data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +4 -2
- data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +1 -1
- data/vendor/cmock/vendor/unity/CMakeLists.txt +10 -0
- data/vendor/cmock/vendor/unity/LICENSE.txt +1 -1
- data/vendor/cmock/vendor/unity/README.md +2 -2
- data/vendor/cmock/vendor/unity/auto/__init__.py +1 -1
- data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +1 -1
- data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +7 -1
- data/vendor/cmock/vendor/unity/auto/extract_version.py +1 -1
- data/vendor/cmock/vendor/unity/auto/generate_config.yml +1 -1
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +6 -6
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +95 -14
- data/vendor/cmock/vendor/unity/auto/parse_output.rb +10 -7
- data/vendor/cmock/vendor/unity/auto/stylize_as_junit.py +4 -3
- data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +4 -2
- data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +1 -1
- data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +1 -1
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +2 -2
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +5 -2
- data/vendor/cmock/vendor/unity/auto/yaml_helper.rb +1 -1
- data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +2 -2
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +66 -1
- data/vendor/cmock/vendor/unity/docs/UnityChangeLog.md +41 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +2 -2
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +28 -12
- data/vendor/cmock/vendor/unity/examples/example_1/makefile +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/makefile +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/project.yml +24 -0
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +2 -3
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +107 -153
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +3 -3
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h +1 -1
- data/vendor/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c +1 -1
- data/vendor/cmock/vendor/unity/examples/example_5/makefile +63 -0
- data/vendor/cmock/vendor/unity/examples/example_5/readme.txt +38 -0
- data/vendor/cmock/vendor/unity/examples/example_5/src/ProductionCode.c +56 -0
- data/vendor/cmock/vendor/unity/examples/example_5/src/ProductionCode.h +16 -0
- data/vendor/cmock/vendor/unity/examples/example_5/subprojects/unity.wrap +3 -0
- data/vendor/cmock/vendor/unity/examples/example_5/test/TestProductionCode.c +45 -0
- data/vendor/cmock/vendor/unity/examples/example_5/test/test_runners/TestProductionCode_Runner.c +48 -0
- data/vendor/cmock/vendor/unity/examples/example_5/test/unity_detail_config.h +25 -0
- data/vendor/cmock/vendor/unity/examples/unity_config.h +5 -3
- data/vendor/cmock/vendor/unity/extras/bdd/src/unity_bdd.h +1 -1
- data/vendor/cmock/vendor/unity/extras/bdd/test/test_bdd.c +1 -1
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +59 -15
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +4 -1
- data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +1 -1
- data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +1 -1
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +46 -1
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +4 -1
- data/vendor/cmock/vendor/unity/extras/memory/src/unity_memory.c +1 -1
- data/vendor/cmock/vendor/unity/extras/memory/src/unity_memory.h +1 -1
- data/vendor/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c +1 -1
- data/vendor/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c +1 -1
- data/vendor/cmock/vendor/unity/extras/memory/test/unity_output_Spy.c +1 -1
- data/vendor/cmock/vendor/unity/extras/memory/test/unity_output_Spy.h +1 -1
- data/vendor/cmock/vendor/unity/library.json +0 -7
- data/vendor/cmock/vendor/unity/meson.build +16 -8
- data/vendor/cmock/vendor/unity/meson_options.txt +5 -3
- data/vendor/cmock/vendor/unity/src/unity.c +480 -141
- data/vendor/cmock/vendor/unity/src/unity.h +16 -4
- data/vendor/cmock/vendor/unity/src/unity_internals.h +291 -148
- data/vendor/cmock/vendor/unity/test/Makefile +4 -6
- data/vendor/cmock/vendor/unity/test/rakefile +42 -21
- data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +154 -15
- data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +1 -1
- data/vendor/cmock/vendor/unity/test/targets/clang.yml +157 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc.yml +139 -0
- data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +9 -16
- data/vendor/cmock/vendor/unity/test/targets/iar_arm.yml +88 -0
- data/vendor/cmock/vendor/unity/test/targets/no_stdlib.yml +23 -0
- data/vendor/cmock/vendor/unity/test/testdata/CException.h +1 -1
- data/vendor/cmock/vendor/unity/test/testdata/Defs.h +1 -1
- data/vendor/cmock/vendor/unity/test/testdata/cmock.h +1 -1
- data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +1 -1
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +1 -1
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +1 -1
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +1 -1
- data/vendor/cmock/vendor/unity/test/tests/self_assessment_utils.h +23 -7
- data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1 -4
- data/vendor/cmock/vendor/unity/test/tests/test_unity_arrays.c +1 -1
- data/vendor/cmock/vendor/unity/test/tests/test_unity_core.c +33 -38
- data/vendor/cmock/vendor/unity/test/tests/test_unity_doubles.c +4 -4
- data/vendor/cmock/vendor/unity/test/tests/test_unity_floats.c +15 -6
- data/vendor/cmock/vendor/unity/test/tests/test_unity_integers.c +35 -1
- data/vendor/cmock/vendor/unity/test/tests/test_unity_integers_64.c +1 -1
- data/vendor/cmock/vendor/unity/test/tests/test_unity_memory.c +69 -1
- data/vendor/cmock/vendor/unity/test/tests/test_unity_parameterized.c +5 -5
- data/vendor/cmock/vendor/unity/test/tests/test_unity_parameterizedDemo.c +1 -1
- data/vendor/cmock/vendor/unity/test/tests/test_unity_strings.c +65 -1
- data/vendor/cmock/vendor/unity/test/tests/types_for_test.h +1 -1
- data/vendor/unity/CMakeLists.txt +10 -0
- data/vendor/unity/LICENSE.txt +1 -1
- data/vendor/unity/README.md +2 -2
- data/vendor/unity/auto/__init__.py +1 -1
- data/vendor/unity/auto/colour_prompt.rb +1 -1
- data/vendor/unity/auto/colour_reporter.rb +7 -1
- data/vendor/unity/auto/extract_version.py +1 -1
- data/vendor/unity/auto/generate_config.yml +1 -1
- data/vendor/unity/auto/generate_module.rb +6 -6
- data/vendor/unity/auto/generate_test_runner.rb +95 -14
- data/vendor/unity/auto/parse_output.rb +10 -7
- data/vendor/unity/auto/stylize_as_junit.py +4 -3
- data/vendor/unity/auto/stylize_as_junit.rb +4 -2
- data/vendor/unity/auto/test_file_filter.rb +1 -1
- data/vendor/unity/auto/type_sanitizer.rb +1 -1
- data/vendor/unity/auto/unity_test_summary.py +2 -2
- data/vendor/unity/auto/unity_test_summary.rb +5 -2
- data/vendor/unity/auto/yaml_helper.rb +1 -1
- data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +2 -2
- data/vendor/unity/docs/UnityAssertionsReference.md +66 -1
- data/vendor/unity/docs/UnityChangeLog.md +41 -0
- data/vendor/unity/docs/UnityConfigurationGuide.md +2 -2
- data/vendor/unity/docs/UnityHelperScriptsGuide.md +28 -12
- data/vendor/unity/examples/example_1/makefile +1 -1
- data/vendor/unity/examples/example_1/src/ProductionCode.c +1 -1
- data/vendor/unity/examples/example_1/src/ProductionCode.h +1 -1
- data/vendor/unity/examples/example_1/src/ProductionCode2.c +1 -1
- data/vendor/unity/examples/example_1/src/ProductionCode2.h +1 -1
- data/vendor/unity/examples/example_1/test/TestProductionCode.c +1 -1
- data/vendor/unity/examples/example_1/test/TestProductionCode2.c +1 -1
- data/vendor/unity/examples/example_2/makefile +1 -1
- data/vendor/unity/examples/example_2/src/ProductionCode.c +1 -1
- data/vendor/unity/examples/example_2/src/ProductionCode.h +1 -1
- data/vendor/unity/examples/example_2/src/ProductionCode2.c +1 -1
- data/vendor/unity/examples/example_2/src/ProductionCode2.h +1 -1
- data/vendor/unity/examples/example_2/test/TestProductionCode.c +1 -1
- data/vendor/unity/examples/example_2/test/TestProductionCode2.c +1 -1
- data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +1 -1
- data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +1 -1
- data/vendor/unity/examples/example_2/test/test_runners/all_tests.c +1 -1
- data/vendor/unity/examples/example_3/helper/UnityHelper.c +1 -1
- data/vendor/unity/examples/example_3/helper/UnityHelper.h +1 -1
- data/vendor/unity/examples/example_3/project.yml +24 -0
- data/vendor/unity/examples/example_3/rakefile.rb +2 -3
- data/vendor/unity/examples/example_3/rakefile_helper.rb +107 -153
- data/vendor/unity/examples/example_3/src/ProductionCode.c +3 -3
- data/vendor/unity/examples/example_3/src/ProductionCode.h +1 -1
- data/vendor/unity/examples/example_3/src/ProductionCode2.c +1 -1
- data/vendor/unity/examples/example_3/src/ProductionCode2.h +1 -1
- data/vendor/unity/examples/example_3/test/TestProductionCode.c +1 -1
- data/vendor/unity/examples/example_3/test/TestProductionCode2.c +1 -1
- data/vendor/unity/examples/example_4/src/ProductionCode.c +1 -1
- data/vendor/unity/examples/example_4/src/ProductionCode.h +1 -1
- data/vendor/unity/examples/example_4/src/ProductionCode2.c +1 -1
- data/vendor/unity/examples/example_4/src/ProductionCode2.h +1 -1
- data/vendor/unity/examples/example_4/test/TestProductionCode.c +1 -1
- data/vendor/unity/examples/example_4/test/TestProductionCode2.c +1 -1
- data/vendor/unity/examples/example_5/makefile +63 -0
- data/vendor/unity/examples/example_5/readme.txt +38 -0
- data/vendor/unity/examples/example_5/src/ProductionCode.c +56 -0
- data/vendor/unity/examples/example_5/src/ProductionCode.h +16 -0
- data/vendor/unity/examples/example_5/subprojects/unity.wrap +3 -0
- data/vendor/unity/examples/example_5/test/TestProductionCode.c +45 -0
- data/vendor/unity/examples/example_5/test/test_runners/TestProductionCode_Runner.c +48 -0
- data/vendor/unity/examples/example_5/test/unity_detail_config.h +25 -0
- data/vendor/unity/examples/unity_config.h +5 -3
- data/vendor/unity/extras/bdd/src/unity_bdd.h +1 -1
- data/vendor/unity/extras/bdd/test/test_bdd.c +1 -1
- data/vendor/unity/extras/fixture/src/unity_fixture.c +59 -15
- data/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +4 -1
- data/vendor/unity/extras/fixture/test/main/AllTests.c +1 -1
- data/vendor/unity/extras/fixture/test/template_fixture_tests.c +1 -1
- data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +46 -1
- data/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +4 -1
- data/vendor/unity/extras/memory/src/unity_memory.c +1 -1
- data/vendor/unity/extras/memory/src/unity_memory.h +1 -1
- data/vendor/unity/extras/memory/test/unity_memory_Test.c +1 -1
- data/vendor/unity/extras/memory/test/unity_memory_TestRunner.c +1 -1
- data/vendor/unity/extras/memory/test/unity_output_Spy.c +1 -1
- data/vendor/unity/extras/memory/test/unity_output_Spy.h +1 -1
- data/vendor/unity/library.json +0 -7
- data/vendor/unity/meson.build +16 -8
- data/vendor/unity/meson_options.txt +5 -3
- data/vendor/unity/src/unity.c +480 -141
- data/vendor/unity/src/unity.h +16 -4
- data/vendor/unity/src/unity_internals.h +291 -148
- data/vendor/unity/test/Makefile +4 -6
- data/vendor/unity/test/rakefile +42 -21
- data/vendor/unity/test/rakefile_helper.rb +154 -15
- data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +1 -1
- data/vendor/unity/test/targets/clang.yml +157 -0
- data/vendor/unity/test/targets/gcc.yml +139 -0
- data/vendor/unity/test/targets/hitech_picc18.yml +9 -16
- data/vendor/unity/test/targets/iar_arm.yml +88 -0
- data/vendor/unity/test/targets/no_stdlib.yml +23 -0
- data/vendor/unity/test/testdata/CException.h +1 -1
- data/vendor/unity/test/testdata/Defs.h +1 -1
- data/vendor/unity/test/testdata/cmock.h +1 -1
- data/vendor/unity/test/testdata/mockMock.h +1 -1
- data/vendor/unity/test/testdata/testRunnerGenerator.c +1 -1
- data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +1 -1
- data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +1 -1
- data/vendor/unity/test/tests/self_assessment_utils.h +23 -7
- data/vendor/unity/test/tests/test_generate_test_runner.rb +1 -4
- data/vendor/unity/test/tests/test_unity_arrays.c +1 -1
- data/vendor/unity/test/tests/test_unity_core.c +33 -38
- data/vendor/unity/test/tests/test_unity_doubles.c +4 -4
- data/vendor/unity/test/tests/test_unity_floats.c +15 -6
- data/vendor/unity/test/tests/test_unity_integers.c +35 -1
- data/vendor/unity/test/tests/test_unity_integers_64.c +1 -1
- data/vendor/unity/test/tests/test_unity_memory.c +69 -1
- data/vendor/unity/test/tests/test_unity_parameterized.c +5 -5
- data/vendor/unity/test/tests/test_unity_parameterizedDemo.c +1 -1
- data/vendor/unity/test/tests/test_unity_strings.c +65 -1
- data/vendor/unity/test/tests/types_for_test.h +1 -1
- metadata +702 -177
- data/docs/CeedlingPacket.md +0 -5651
- data/lib/ceedling/build_batchinator.rb +0 -113
- data/lib/ceedling/generator_test_results_backtrace.rb +0 -215
- data/lib/ceedling/generator_test_runner.rb +0 -84
- data/lib/ceedling/preprocessinator.rb +0 -239
- data/lib/ceedling/preprocessinator_extractor.rb +0 -257
- data/lib/ceedling/preprocessinator_file_handler.rb +0 -229
- data/lib/ceedling/preprocessinator_includes_handler.rb +0 -382
- data/lib/ceedling/task_invoker.rb +0 -70
- data/lib/ceedling/test_invoker.rb +0 -506
- data/lib/ceedling/test_invoker_helper.rb +0 -347
- data/plugins/gcov/README.md +0 -893
- data/plugins/gcov/lib/reportinator_helper.rb +0 -30
- data/plugins/report_tests_log_factory/sample_html_report.png +0 -0
- data/spec/configurator_spec.rb +0 -18
- data/spec/generator_test_results_spec.rb +0 -131
- data/spec/parsing_parcels_spec.rb +0 -66
- data/spec/preprocessinator_includes_handler_spec.rb +0 -289
- data/spec/reportinator_spec.rb +0 -26
- data/spec/spec_helper.rb +0 -31
- data/spec/test_context_extractor_spec.rb +0 -328
- data/spec/uncategorized_specs_spec.rb +0 -15
- data/vendor/cmock/examples/temp_sensor/targets/gcc.yml +0 -97
- data/vendor/cmock/examples/temp_sensor/targets/iar_v4.yml +0 -143
- data/vendor/cmock/examples/temp_sensor/targets/iar_v5.yml +0 -132
- data/vendor/cmock/scripts/create_mock.rb +0 -15
- data/vendor/cmock/scripts/create_runner.rb +0 -25
- data/vendor/cmock/scripts/test_summary.rb +0 -25
- data/vendor/cmock/test/system/test_interactions/array_and_pointer_handling.yml +0 -453
- data/vendor/cmock/test/targets/clang_strict.yml +0 -97
- data/vendor/cmock/test/targets/gcc.yml +0 -65
- data/vendor/cmock/test/targets/gcc_64.yml +0 -65
- data/vendor/cmock/test/targets/gcc_tiny.yml +0 -87
- data/vendor/cmock/test/targets/iar_arm_v4.yml +0 -117
- data/vendor/cmock/test/targets/iar_arm_v5.yml +0 -102
- data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +0 -54
- data/vendor/cmock/vendor/unity/test/targets/ansi.yml +0 -51
- data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -79
- data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +0 -79
- data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +0 -52
- data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +0 -53
- data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +0 -50
- data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +0 -62
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +0 -105
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +0 -99
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +0 -99
- data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -97
- data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +0 -101
- data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +0 -119
- data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +0 -106
- data/vendor/unity/examples/example_3/target_gcc_32.yml +0 -54
- data/vendor/unity/test/targets/ansi.yml +0 -51
- data/vendor/unity/test/targets/clang_file.yml +0 -79
- data/vendor/unity/test/targets/clang_strict.yml +0 -79
- data/vendor/unity/test/targets/gcc_32.yml +0 -52
- data/vendor/unity/test/targets/gcc_64.yml +0 -53
- data/vendor/unity/test/targets/gcc_auto_limits.yml +0 -50
- data/vendor/unity/test/targets/gcc_auto_stdint.yml +0 -62
- data/vendor/unity/test/targets/gcc_manual_math.yml +0 -50
- data/vendor/unity/test/targets/iar_arm_v4.yml +0 -105
- data/vendor/unity/test/targets/iar_arm_v5.yml +0 -99
- data/vendor/unity/test/targets/iar_arm_v5_3.yml +0 -99
- data/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -97
- data/vendor/unity/test/targets/iar_cortexm3_v5.yml +0 -101
- data/vendor/unity/test/targets/iar_msp430.yml +0 -119
- data/vendor/unity/test/targets/iar_sh2a_v6.yml +0 -106
|
@@ -0,0 +1,1629 @@
|
|
|
1
|
+
|
|
2
|
+
# =========================================================================
|
|
3
|
+
# Ceedling - Test-Centered Build System for C
|
|
4
|
+
# ThrowTheSwitch.org
|
|
5
|
+
# Copyright (c) 2010-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
|
|
6
|
+
# SPDX-License-Identifier: MIT
|
|
7
|
+
# =========================================================================
|
|
8
|
+
|
|
9
|
+
require 'spec_helper'
|
|
10
|
+
require 'ceedling/includes/includes'
|
|
11
|
+
require 'ceedling/partials/partializer'
|
|
12
|
+
require 'ceedling/partials/partials'
|
|
13
|
+
require 'ceedling/reportinator'
|
|
14
|
+
require 'ceedling/c_extractor/c_extractor_types'
|
|
15
|
+
require 'ostruct'
|
|
16
|
+
|
|
17
|
+
describe Partializer do
|
|
18
|
+
before(:each) do
|
|
19
|
+
@partializer_helper = double("PartializerHelper")
|
|
20
|
+
@file_finder = double("FileFinder")
|
|
21
|
+
@c_extractor = double("CExtractor")
|
|
22
|
+
@file_path_utils = double("FilePathUtils")
|
|
23
|
+
@reportinator = Reportinator.new
|
|
24
|
+
@loginator = double("Loginator").as_null_object
|
|
25
|
+
|
|
26
|
+
@partializer = described_class.new(
|
|
27
|
+
{
|
|
28
|
+
:partializer_helper => @partializer_helper,
|
|
29
|
+
:file_finder => @file_finder,
|
|
30
|
+
:c_extractor => @c_extractor,
|
|
31
|
+
:file_path_utils => @file_path_utils,
|
|
32
|
+
:reportinator => @reportinator,
|
|
33
|
+
:loginator => @loginator
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Logging happens in production use only and is not directly tested.
|
|
38
|
+
# Silence all private logging helpers so that test doubles for extracted
|
|
39
|
+
# functions and variable declarations do not need .signature / .text stubs.
|
|
40
|
+
allow(@partializer).to receive(:_log_module_contents)
|
|
41
|
+
allow(@partializer).to receive(:_log_impl_functions)
|
|
42
|
+
allow(@partializer).to receive(:_log_interface_functions)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
###
|
|
46
|
+
### populate_filepaths()
|
|
47
|
+
###
|
|
48
|
+
|
|
49
|
+
context "#populate_filepaths" do
|
|
50
|
+
def make_tests(present:)
|
|
51
|
+
OpenStruct.new(present?: present)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def make_mocks(present:, type: nil)
|
|
55
|
+
OpenStruct.new(present?: present, type: type)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def make_config(tests:, mocks:)
|
|
59
|
+
OpenStruct.new(
|
|
60
|
+
tests: tests,
|
|
61
|
+
mocks: mocks,
|
|
62
|
+
header: OpenStruct.new(filepath: nil),
|
|
63
|
+
source: OpenStruct.new(filepath: nil)
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it "returns the configs hash unchanged when empty" do
|
|
68
|
+
result = @partializer.populate_filepaths({})
|
|
69
|
+
expect(result).to eq({})
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it "populates header and source for a test config" do
|
|
73
|
+
configs = { 'mod' => make_config(tests: make_tests(present: true), mocks: make_mocks(present: false)) }
|
|
74
|
+
|
|
75
|
+
allow(@file_finder).to receive(:find_header_file).with('mod', :ignore).and_return('mod.h')
|
|
76
|
+
allow(@file_finder).to receive(:find_source_file).with('mod', :ignore).and_return('mod.c')
|
|
77
|
+
|
|
78
|
+
@partializer.populate_filepaths(configs)
|
|
79
|
+
|
|
80
|
+
expect(configs['mod'].header.filepath).to eq('mod.h')
|
|
81
|
+
expect(configs['mod'].source.filepath).to eq('mod.c')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it "populates header only for mock-public config" do
|
|
85
|
+
configs = { 'mod' => make_config(tests: make_tests(present: false), mocks: make_mocks(present: true, type: Partials::PUBLIC)) }
|
|
86
|
+
|
|
87
|
+
allow(@file_finder).to receive(:find_header_file).with('mod', :ignore).and_return('mod.h')
|
|
88
|
+
expect(@file_finder).not_to receive(:find_source_file)
|
|
89
|
+
|
|
90
|
+
@partializer.populate_filepaths(configs)
|
|
91
|
+
|
|
92
|
+
expect(configs['mod'].header.filepath).to eq('mod.h')
|
|
93
|
+
expect(configs['mod'].source.filepath).to be_nil
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it "populates header and source for mock-private config" do
|
|
97
|
+
configs = { 'mod' => make_config(tests: make_tests(present: false), mocks: make_mocks(present: true, type: Partials::PRIVATE)) }
|
|
98
|
+
|
|
99
|
+
allow(@file_finder).to receive(:find_header_file).with('mod', :ignore).and_return('mod.h')
|
|
100
|
+
allow(@file_finder).to receive(:find_source_file).with('mod', :ignore).and_return('mod.c')
|
|
101
|
+
|
|
102
|
+
@partializer.populate_filepaths(configs)
|
|
103
|
+
|
|
104
|
+
expect(configs['mod'].header.filepath).to eq('mod.h')
|
|
105
|
+
expect(configs['mod'].source.filepath).to eq('mod.c')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
it "populates header and source when mocks.type is nil" do
|
|
109
|
+
configs = { 'mod' => make_config(tests: make_tests(present: false), mocks: make_mocks(present: true, type: nil)) }
|
|
110
|
+
|
|
111
|
+
allow(@file_finder).to receive(:find_header_file).with('mod', :ignore).and_return('mod.h')
|
|
112
|
+
allow(@file_finder).to receive(:find_source_file).with('mod', :ignore).and_return('mod.c')
|
|
113
|
+
|
|
114
|
+
@partializer.populate_filepaths(configs)
|
|
115
|
+
|
|
116
|
+
expect(configs['mod'].header.filepath).to eq('mod.h')
|
|
117
|
+
expect(configs['mod'].source.filepath).to eq('mod.c')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
it "handles multiple modules independently" do
|
|
121
|
+
configs = {
|
|
122
|
+
'a' => make_config(tests: make_tests(present: true), mocks: make_mocks(present: false)),
|
|
123
|
+
'b' => make_config(tests: make_tests(present: false), mocks: make_mocks(present: true, type: Partials::PUBLIC))
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
allow(@file_finder).to receive(:find_header_file).with('a', :ignore).and_return('a.h')
|
|
127
|
+
allow(@file_finder).to receive(:find_source_file).with('a', :ignore).and_return('a.c')
|
|
128
|
+
allow(@file_finder).to receive(:find_header_file).with('b', :ignore).and_return('b.h')
|
|
129
|
+
expect(@file_finder).not_to receive(:find_source_file).with('b', :ignore)
|
|
130
|
+
|
|
131
|
+
@partializer.populate_filepaths(configs)
|
|
132
|
+
|
|
133
|
+
expect(configs['a'].header.filepath).to eq('a.h')
|
|
134
|
+
expect(configs['a'].source.filepath).to eq('a.c')
|
|
135
|
+
expect(configs['b'].header.filepath).to eq('b.h')
|
|
136
|
+
expect(configs['b'].source.filepath).to be_nil
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
###
|
|
141
|
+
### validate_config()
|
|
142
|
+
###
|
|
143
|
+
|
|
144
|
+
context "#validate_config" do
|
|
145
|
+
it "delegates to three validation helpers in order" do
|
|
146
|
+
c_module = double("CModule")
|
|
147
|
+
config = double("Config")
|
|
148
|
+
name = "test_foo"
|
|
149
|
+
|
|
150
|
+
expect(@partializer_helper).to receive(:validate_function_names_exist)
|
|
151
|
+
.with(c_module, config, name).ordered
|
|
152
|
+
expect(@partializer_helper).to receive(:validate_no_additions_subtractions_overlap)
|
|
153
|
+
.with(config, name).ordered
|
|
154
|
+
expect(@partializer_helper).to receive(:validate_additions_subtractions_visibility)
|
|
155
|
+
.with(c_module, config, name).ordered
|
|
156
|
+
|
|
157
|
+
@partializer.validate_config(c_module: c_module, config: config, name: name)
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
###
|
|
162
|
+
### sanitize()
|
|
163
|
+
###
|
|
164
|
+
|
|
165
|
+
context "#sanitize" do
|
|
166
|
+
def make_macro(text)
|
|
167
|
+
CExtractorTypes::CStatement.new(text: text, line_num: 1)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def make_module(macros: [], sequence: nil)
|
|
171
|
+
m = CExtractorTypes::CModule.new
|
|
172
|
+
m.macro_definitions = macros.dup
|
|
173
|
+
m.element_sequence = sequence || macros.dup
|
|
174
|
+
m
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
it "leaves macro_definitions unchanged when no macros contain CEEDLING_GENERATED" do
|
|
178
|
+
macro = make_macro('#define MY_GUARD_H')
|
|
179
|
+
mod = make_module(macros: [macro])
|
|
180
|
+
|
|
181
|
+
@partializer.sanitize(mod)
|
|
182
|
+
|
|
183
|
+
expect(mod.macro_definitions).to eq([macro])
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
it "leaves element_sequence unchanged when no macros contain CEEDLING_GENERATED" do
|
|
187
|
+
macro = make_macro('#define MY_GUARD_H')
|
|
188
|
+
mod = make_module(macros: [macro])
|
|
189
|
+
|
|
190
|
+
@partializer.sanitize(mod)
|
|
191
|
+
|
|
192
|
+
expect(mod.element_sequence).to eq([macro])
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
it "removes macros whose text includes CEEDLING_GENERATED from macro_definitions" do
|
|
196
|
+
generated = make_macro('#ifndef CEEDLING_GENERATED_FOO_H')
|
|
197
|
+
kept = make_macro('#define MY_DEFINE 1')
|
|
198
|
+
mod = make_module(macros: [generated, kept])
|
|
199
|
+
|
|
200
|
+
@partializer.sanitize(mod)
|
|
201
|
+
|
|
202
|
+
expect(mod.macro_definitions).to eq([kept])
|
|
203
|
+
expect(mod.macro_definitions).not_to include(generated)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
it "removes the same macro objects from element_sequence" do
|
|
207
|
+
generated = make_macro('#ifndef CEEDLING_GENERATED_BAR_H')
|
|
208
|
+
kept = make_macro('#define MY_DEFINE 2')
|
|
209
|
+
mod = make_module(macros: [generated, kept])
|
|
210
|
+
|
|
211
|
+
@partializer.sanitize(mod)
|
|
212
|
+
|
|
213
|
+
expect(mod.element_sequence).not_to include(generated)
|
|
214
|
+
expect(mod.element_sequence).to include(kept)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
it "removes all macros when every macro contains CEEDLING_GENERATED" do
|
|
218
|
+
m1 = make_macro('#ifndef CEEDLING_GENERATED_A_H')
|
|
219
|
+
m2 = make_macro('#define CEEDLING_GENERATED_A_H')
|
|
220
|
+
mod = make_module(macros: [m1, m2])
|
|
221
|
+
|
|
222
|
+
@partializer.sanitize(mod)
|
|
223
|
+
|
|
224
|
+
expect(mod.macro_definitions).to be_empty
|
|
225
|
+
expect(mod.element_sequence).to be_empty
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
it "does not remove non-macro elements from element_sequence" do
|
|
229
|
+
generated = make_macro('#ifndef CEEDLING_GENERATED_C_H')
|
|
230
|
+
other_elem = double('CFunction', text: 'void foo(void){}')
|
|
231
|
+
mod = CExtractorTypes::CModule.new
|
|
232
|
+
mod.macro_definitions = [generated]
|
|
233
|
+
mod.element_sequence = [generated, other_elem]
|
|
234
|
+
|
|
235
|
+
@partializer.sanitize(mod)
|
|
236
|
+
|
|
237
|
+
expect(mod.element_sequence).to include(other_elem)
|
|
238
|
+
expect(mod.element_sequence).not_to include(generated)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
it "handles empty macro_definitions without error" do
|
|
242
|
+
mod = make_module(macros: [])
|
|
243
|
+
|
|
244
|
+
expect { @partializer.sanitize(mod) }.not_to raise_error
|
|
245
|
+
expect(mod.macro_definitions).to be_empty
|
|
246
|
+
expect(mod.element_sequence).to be_empty
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
###
|
|
251
|
+
### validate_extracted_functions()
|
|
252
|
+
###
|
|
253
|
+
|
|
254
|
+
context "#validate_extracted_functions" do
|
|
255
|
+
def make_impl(name)
|
|
256
|
+
Partials.manufacture_function_definition(
|
|
257
|
+
name: name, signature: "void #{name}(void)", code_block: "void #{name}(void) {}"
|
|
258
|
+
)
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
def make_iface(name)
|
|
262
|
+
Partials.manufacture_function_declaration(name: name, signature: "void #{name}(void)")
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
it "does not raise when impl is nil" do
|
|
266
|
+
expect {
|
|
267
|
+
@partializer.validate_extracted_functions(
|
|
268
|
+
name: 'test_mod', partial: 'mod', impl: nil, interface: [make_iface('foo')]
|
|
269
|
+
)
|
|
270
|
+
}.not_to raise_error
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
it "does not raise when interface is nil" do
|
|
274
|
+
expect {
|
|
275
|
+
@partializer.validate_extracted_functions(
|
|
276
|
+
name: 'test_mod', partial: 'mod', impl: [make_impl('foo')], interface: nil
|
|
277
|
+
)
|
|
278
|
+
}.not_to raise_error
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
it "does not raise when impl is empty" do
|
|
282
|
+
expect {
|
|
283
|
+
@partializer.validate_extracted_functions(
|
|
284
|
+
name: 'test_mod', partial: 'mod', impl: [], interface: [make_iface('foo')]
|
|
285
|
+
)
|
|
286
|
+
}.not_to raise_error
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
it "does not raise when interface is empty" do
|
|
290
|
+
expect {
|
|
291
|
+
@partializer.validate_extracted_functions(
|
|
292
|
+
name: 'test_mod', partial: 'mod', impl: [make_impl('foo')], interface: []
|
|
293
|
+
)
|
|
294
|
+
}.not_to raise_error
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
it "does not raise when impl and interface have no overlapping functions" do
|
|
298
|
+
impl = [make_impl('foo'), make_impl('bar')]
|
|
299
|
+
interface = [make_iface('baz'), make_iface('qux')]
|
|
300
|
+
|
|
301
|
+
expect {
|
|
302
|
+
@partializer.validate_extracted_functions(
|
|
303
|
+
name: 'test_mod', partial: 'mod', impl: impl, interface: interface
|
|
304
|
+
)
|
|
305
|
+
}.not_to raise_error
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
it "raises CeedlingException when one function appears in both impl and interface" do
|
|
309
|
+
impl = [make_impl('foo'), make_impl('shared')]
|
|
310
|
+
interface = [make_iface('shared'), make_iface('bar')]
|
|
311
|
+
|
|
312
|
+
expect {
|
|
313
|
+
@partializer.validate_extracted_functions(
|
|
314
|
+
name: 'test_mod', partial: 'mod', impl: impl, interface: interface
|
|
315
|
+
)
|
|
316
|
+
}.to raise_error(CeedlingException, /shared/)
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
it "raises for each overlapping function when multiple functions overlap" do
|
|
320
|
+
impl = [make_impl('alpha'), make_impl('beta')]
|
|
321
|
+
interface = [make_iface('alpha'), make_iface('beta')]
|
|
322
|
+
|
|
323
|
+
expect {
|
|
324
|
+
@partializer.validate_extracted_functions(
|
|
325
|
+
name: 'test_mod', partial: 'mod', impl: impl, interface: interface
|
|
326
|
+
)
|
|
327
|
+
}.to raise_error(CeedlingException)
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
###
|
|
332
|
+
### remap_implementation_header_includes()
|
|
333
|
+
###
|
|
334
|
+
|
|
335
|
+
context "#remap_implementation_header_includes" do
|
|
336
|
+
it "returns empty array when input is empty and no partials" do
|
|
337
|
+
includes = []
|
|
338
|
+
partials = {}
|
|
339
|
+
result = @partializer.remap_implementation_header_includes(
|
|
340
|
+
name: 'module',
|
|
341
|
+
includes: includes,
|
|
342
|
+
partials: partials
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
expect(result).to eq([])
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
it "removes module's own header from includes" do
|
|
349
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('module.h'), UserInclude.new('header2.h')]
|
|
350
|
+
partials = {}
|
|
351
|
+
result = @partializer.remap_implementation_header_includes(
|
|
352
|
+
name: 'module',
|
|
353
|
+
includes: includes,
|
|
354
|
+
partials: partials
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
358
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
it "removes partialized module headers from includes" do
|
|
362
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('partial_module.h'), UserInclude.new('header2.h')]
|
|
363
|
+
partials = {
|
|
364
|
+
'partial_module' => { types: [:test_public] }
|
|
365
|
+
}
|
|
366
|
+
result = @partializer.remap_implementation_header_includes(
|
|
367
|
+
name: 'module',
|
|
368
|
+
includes: includes,
|
|
369
|
+
partials: partials
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
373
|
+
expect(result).not_to include(UserInclude.new('partial_module.h'))
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
it "removes multiple partialized module headers" do
|
|
377
|
+
includes = [
|
|
378
|
+
UserInclude.new('header1.h'),
|
|
379
|
+
UserInclude.new('partial1.h'),
|
|
380
|
+
UserInclude.new('partial2.h'),
|
|
381
|
+
UserInclude.new('header2.h')
|
|
382
|
+
]
|
|
383
|
+
partials = {
|
|
384
|
+
'partial1' => nil,
|
|
385
|
+
'partial2' => nil
|
|
386
|
+
}
|
|
387
|
+
result = @partializer.remap_implementation_header_includes(
|
|
388
|
+
name: 'module',
|
|
389
|
+
includes: includes,
|
|
390
|
+
partials: partials
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
394
|
+
expect(result).not_to include(UserInclude.new('partial1.h'))
|
|
395
|
+
expect(result).not_to include(UserInclude.new('partial2.h'))
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
it "preserves includes that are not partialized" do
|
|
399
|
+
includes = [
|
|
400
|
+
UserInclude.new('header1.h'),
|
|
401
|
+
UserInclude.new('partial_module.h'),
|
|
402
|
+
UserInclude.new('header2.h'),
|
|
403
|
+
UserInclude.new('header3.h')
|
|
404
|
+
]
|
|
405
|
+
partials = {
|
|
406
|
+
'partial_module' => nil
|
|
407
|
+
}
|
|
408
|
+
result = @partializer.remap_implementation_header_includes(
|
|
409
|
+
name: 'module',
|
|
410
|
+
includes: includes,
|
|
411
|
+
partials: partials
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
expect(result).to match_array(
|
|
415
|
+
[
|
|
416
|
+
UserInclude.new('header1.h'),
|
|
417
|
+
UserInclude.new('header2.h'),
|
|
418
|
+
UserInclude.new('header3.h')
|
|
419
|
+
]
|
|
420
|
+
)
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
it "removes duplicates after removing partialized headers" do
|
|
424
|
+
includes = [
|
|
425
|
+
UserInclude.new('header1.h'),
|
|
426
|
+
UserInclude.new('partial_module.h'),
|
|
427
|
+
UserInclude.new('header1.h'),
|
|
428
|
+
UserInclude.new('header2.h')
|
|
429
|
+
]
|
|
430
|
+
partials = {
|
|
431
|
+
'partial_module' => nil
|
|
432
|
+
}
|
|
433
|
+
result = @partializer.remap_implementation_header_includes(
|
|
434
|
+
name: 'module',
|
|
435
|
+
includes: includes,
|
|
436
|
+
partials: partials
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
it "handles case-insensitive module header removal" do
|
|
443
|
+
includes = [
|
|
444
|
+
UserInclude.new('header1.h'),
|
|
445
|
+
UserInclude.new('module.h'),
|
|
446
|
+
UserInclude.new('MODULE.H'),
|
|
447
|
+
UserInclude.new('header2.h')
|
|
448
|
+
]
|
|
449
|
+
partials = {}
|
|
450
|
+
result = @partializer.remap_implementation_header_includes(
|
|
451
|
+
name: 'module',
|
|
452
|
+
includes: includes,
|
|
453
|
+
partials: partials
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
457
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
458
|
+
expect(result).not_to include(UserInclude.new('MODULE.H'))
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
it "handles partials with different configuration types" do
|
|
462
|
+
includes = [
|
|
463
|
+
UserInclude.new('header1.h'),
|
|
464
|
+
UserInclude.new('partial1.h'),
|
|
465
|
+
UserInclude.new('partial2.h'),
|
|
466
|
+
UserInclude.new('partial3.h')
|
|
467
|
+
]
|
|
468
|
+
partials = {
|
|
469
|
+
'partial1' => nil,
|
|
470
|
+
'partial2' => nil,
|
|
471
|
+
'partial3' => nil
|
|
472
|
+
}
|
|
473
|
+
result = @partializer.remap_implementation_header_includes(
|
|
474
|
+
name: 'module',
|
|
475
|
+
includes: includes,
|
|
476
|
+
partials: partials
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
expect(result).to match_array([UserInclude.new('header1.h')])
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
it "handles empty partials hash" do
|
|
483
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('header2.h'), UserInclude.new('module.h')]
|
|
484
|
+
partials = {}
|
|
485
|
+
result = @partializer.remap_implementation_header_includes(
|
|
486
|
+
name: 'module',
|
|
487
|
+
includes: includes,
|
|
488
|
+
partials: partials
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
it "handles complex scenario with module header, partials, and duplicates" do
|
|
495
|
+
includes = [
|
|
496
|
+
UserInclude.new('header1.h'),
|
|
497
|
+
UserInclude.new('module.h'),
|
|
498
|
+
UserInclude.new('partial1.h'),
|
|
499
|
+
UserInclude.new('header2.h'),
|
|
500
|
+
UserInclude.new('partial2.h'),
|
|
501
|
+
UserInclude.new('header1.h'),
|
|
502
|
+
UserInclude.new('header3.h')
|
|
503
|
+
]
|
|
504
|
+
partials = {
|
|
505
|
+
'partial1' => nil,
|
|
506
|
+
'partial2' => nil
|
|
507
|
+
}
|
|
508
|
+
result = @partializer.remap_implementation_header_includes(
|
|
509
|
+
name: 'module',
|
|
510
|
+
includes: includes,
|
|
511
|
+
partials: partials
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
expect(result).to match_array(
|
|
515
|
+
[
|
|
516
|
+
UserInclude.new('header1.h'),
|
|
517
|
+
UserInclude.new('header2.h'),
|
|
518
|
+
UserInclude.new('header3.h')
|
|
519
|
+
]
|
|
520
|
+
)
|
|
521
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
522
|
+
expect(result).not_to include(UserInclude.new('partial1.h'))
|
|
523
|
+
expect(result).not_to include(UserInclude.new('partial2.h'))
|
|
524
|
+
end
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
###
|
|
528
|
+
### remap_interface_header_includes()
|
|
529
|
+
###
|
|
530
|
+
|
|
531
|
+
context "#remap_interface_header_includes" do
|
|
532
|
+
it "returns empty array when input is empty and no partials" do
|
|
533
|
+
result = @partializer.remap_interface_header_includes(
|
|
534
|
+
name: 'module',
|
|
535
|
+
includes: [],
|
|
536
|
+
partials: {}
|
|
537
|
+
)
|
|
538
|
+
expect(result).to eq([])
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
it "removes module's own header from includes" do
|
|
542
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('module.h'), UserInclude.new('header2.h')]
|
|
543
|
+
result = @partializer.remap_interface_header_includes(
|
|
544
|
+
name: 'module',
|
|
545
|
+
includes: includes,
|
|
546
|
+
partials: {}
|
|
547
|
+
)
|
|
548
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
549
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
it "removes partialized module headers from includes" do
|
|
553
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('partial_module.h'), UserInclude.new('header2.h')]
|
|
554
|
+
partials = { 'partial_module' => nil }
|
|
555
|
+
result = @partializer.remap_interface_header_includes(
|
|
556
|
+
name: 'module',
|
|
557
|
+
includes: includes,
|
|
558
|
+
partials: partials
|
|
559
|
+
)
|
|
560
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
561
|
+
expect(result).not_to include(UserInclude.new('partial_module.h'))
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
it "removes multiple partialized module headers" do
|
|
565
|
+
includes = [
|
|
566
|
+
UserInclude.new('header1.h'),
|
|
567
|
+
UserInclude.new('partial1.h'),
|
|
568
|
+
UserInclude.new('partial2.h'),
|
|
569
|
+
UserInclude.new('header2.h')
|
|
570
|
+
]
|
|
571
|
+
partials = { 'partial1' => nil, 'partial2' => nil }
|
|
572
|
+
result = @partializer.remap_interface_header_includes(
|
|
573
|
+
name: 'module',
|
|
574
|
+
includes: includes,
|
|
575
|
+
partials: partials
|
|
576
|
+
)
|
|
577
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
578
|
+
expect(result).not_to include(UserInclude.new('partial1.h'))
|
|
579
|
+
expect(result).not_to include(UserInclude.new('partial2.h'))
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
it "preserves includes that are not partialized" do
|
|
583
|
+
includes = [
|
|
584
|
+
UserInclude.new('header1.h'),
|
|
585
|
+
UserInclude.new('partial_module.h'),
|
|
586
|
+
UserInclude.new('header2.h'),
|
|
587
|
+
UserInclude.new('header3.h')
|
|
588
|
+
]
|
|
589
|
+
partials = { 'partial_module' => nil }
|
|
590
|
+
result = @partializer.remap_interface_header_includes(
|
|
591
|
+
name: 'module',
|
|
592
|
+
includes: includes,
|
|
593
|
+
partials: partials
|
|
594
|
+
)
|
|
595
|
+
expect(result).to match_array([
|
|
596
|
+
UserInclude.new('header1.h'),
|
|
597
|
+
UserInclude.new('header2.h'),
|
|
598
|
+
UserInclude.new('header3.h')
|
|
599
|
+
])
|
|
600
|
+
end
|
|
601
|
+
|
|
602
|
+
it "removes duplicates after removing partialized headers" do
|
|
603
|
+
includes = [
|
|
604
|
+
UserInclude.new('header1.h'),
|
|
605
|
+
UserInclude.new('partial_module.h'),
|
|
606
|
+
UserInclude.new('header1.h'),
|
|
607
|
+
UserInclude.new('header2.h')
|
|
608
|
+
]
|
|
609
|
+
partials = { 'partial_module' => nil }
|
|
610
|
+
result = @partializer.remap_interface_header_includes(
|
|
611
|
+
name: 'module',
|
|
612
|
+
includes: includes,
|
|
613
|
+
partials: partials
|
|
614
|
+
)
|
|
615
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
616
|
+
end
|
|
617
|
+
|
|
618
|
+
it "handles case-insensitive module header removal" do
|
|
619
|
+
includes = [
|
|
620
|
+
UserInclude.new('header1.h'),
|
|
621
|
+
UserInclude.new('module.h'),
|
|
622
|
+
UserInclude.new('MODULE.H'),
|
|
623
|
+
UserInclude.new('header2.h')
|
|
624
|
+
]
|
|
625
|
+
result = @partializer.remap_interface_header_includes(
|
|
626
|
+
name: 'module',
|
|
627
|
+
includes: includes,
|
|
628
|
+
partials: {}
|
|
629
|
+
)
|
|
630
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
631
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
632
|
+
expect(result).not_to include(UserInclude.new('MODULE.H'))
|
|
633
|
+
end
|
|
634
|
+
|
|
635
|
+
it "handles partials with different configuration types" do
|
|
636
|
+
includes = [
|
|
637
|
+
UserInclude.new('header1.h'),
|
|
638
|
+
UserInclude.new('partial1.h'),
|
|
639
|
+
UserInclude.new('partial2.h'),
|
|
640
|
+
UserInclude.new('partial3.h')
|
|
641
|
+
]
|
|
642
|
+
partials = { 'partial1' => nil, 'partial2' => nil, 'partial3' => nil }
|
|
643
|
+
result = @partializer.remap_interface_header_includes(
|
|
644
|
+
name: 'module',
|
|
645
|
+
includes: includes,
|
|
646
|
+
partials: partials
|
|
647
|
+
)
|
|
648
|
+
expect(result).to match_array([UserInclude.new('header1.h')])
|
|
649
|
+
end
|
|
650
|
+
|
|
651
|
+
it "handles empty partials hash" do
|
|
652
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('header2.h'), UserInclude.new('module.h')]
|
|
653
|
+
result = @partializer.remap_interface_header_includes(
|
|
654
|
+
name: 'module',
|
|
655
|
+
includes: includes,
|
|
656
|
+
partials: {}
|
|
657
|
+
)
|
|
658
|
+
expect(result).to match_array([UserInclude.new('header1.h'), UserInclude.new('header2.h')])
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
it "handles complex scenario with module header, partials, and duplicates" do
|
|
662
|
+
includes = [
|
|
663
|
+
UserInclude.new('header1.h'),
|
|
664
|
+
UserInclude.new('module.h'),
|
|
665
|
+
UserInclude.new('partial1.h'),
|
|
666
|
+
UserInclude.new('header2.h'),
|
|
667
|
+
UserInclude.new('partial2.h'),
|
|
668
|
+
UserInclude.new('header1.h'),
|
|
669
|
+
UserInclude.new('header3.h')
|
|
670
|
+
]
|
|
671
|
+
partials = { 'partial1' => nil, 'partial2' => nil }
|
|
672
|
+
result = @partializer.remap_interface_header_includes(
|
|
673
|
+
name: 'module',
|
|
674
|
+
includes: includes,
|
|
675
|
+
partials: partials
|
|
676
|
+
)
|
|
677
|
+
expect(result).to match_array([
|
|
678
|
+
UserInclude.new('header1.h'),
|
|
679
|
+
UserInclude.new('header2.h'),
|
|
680
|
+
UserInclude.new('header3.h')
|
|
681
|
+
])
|
|
682
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
683
|
+
expect(result).not_to include(UserInclude.new('partial1.h'))
|
|
684
|
+
expect(result).not_to include(UserInclude.new('partial2.h'))
|
|
685
|
+
end
|
|
686
|
+
end
|
|
687
|
+
|
|
688
|
+
###
|
|
689
|
+
### remap_implementation_source_includes()
|
|
690
|
+
###
|
|
691
|
+
|
|
692
|
+
def make_partial_config(mocks_type: nil, tests_type: nil)
|
|
693
|
+
OpenStruct.new(
|
|
694
|
+
mocks: OpenStruct.new(type: mocks_type),
|
|
695
|
+
tests: OpenStruct.new(type: tests_type)
|
|
696
|
+
)
|
|
697
|
+
end
|
|
698
|
+
|
|
699
|
+
context "#remap_implementation_source_includes" do
|
|
700
|
+
it "returns implementation header when input is empty and no partials" do
|
|
701
|
+
includes = []
|
|
702
|
+
partials = {}
|
|
703
|
+
filename = 'module_impl.h'
|
|
704
|
+
impl_header = UserInclude.new(filename)
|
|
705
|
+
|
|
706
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
707
|
+
.with('module')
|
|
708
|
+
.and_return(filename)
|
|
709
|
+
|
|
710
|
+
result = @partializer.remap_implementation_source_includes(
|
|
711
|
+
name: 'module',
|
|
712
|
+
includes: includes,
|
|
713
|
+
partials: partials
|
|
714
|
+
)
|
|
715
|
+
|
|
716
|
+
expect(result).to eq([impl_header])
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
it "adds implementation header to includes" do
|
|
720
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('header2.h')]
|
|
721
|
+
partials = {}
|
|
722
|
+
filename = 'module_impl.h'
|
|
723
|
+
impl_header = UserInclude.new(filename)
|
|
724
|
+
|
|
725
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
726
|
+
.with('module')
|
|
727
|
+
.and_return(filename)
|
|
728
|
+
|
|
729
|
+
result = @partializer.remap_implementation_source_includes(
|
|
730
|
+
name: 'module',
|
|
731
|
+
includes: includes,
|
|
732
|
+
partials: partials
|
|
733
|
+
)
|
|
734
|
+
|
|
735
|
+
expect(result).to include(impl_header)
|
|
736
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
737
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
738
|
+
end
|
|
739
|
+
|
|
740
|
+
it "removes module's own header from includes" do
|
|
741
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('module.h'), UserInclude.new('header2.h')]
|
|
742
|
+
partials = {}
|
|
743
|
+
filename = 'module_impl.h'
|
|
744
|
+
impl_header = UserInclude.new(filename)
|
|
745
|
+
|
|
746
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
747
|
+
.with('module')
|
|
748
|
+
.and_return(filename)
|
|
749
|
+
|
|
750
|
+
result = @partializer.remap_implementation_source_includes(
|
|
751
|
+
name: 'module',
|
|
752
|
+
includes: includes,
|
|
753
|
+
partials: partials
|
|
754
|
+
)
|
|
755
|
+
|
|
756
|
+
expect(result).to include(impl_header)
|
|
757
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
758
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
759
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
it "remaps mockable public partial to interface header" do
|
|
763
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('partial_module.h'), UserInclude.new('header2.h')]
|
|
764
|
+
partials = {
|
|
765
|
+
'partial_module' => make_partial_config(mocks_type: Partials::PUBLIC)
|
|
766
|
+
}
|
|
767
|
+
impl_filename = 'module_impl.h'
|
|
768
|
+
interface_filename = 'partial_module_interface.h'
|
|
769
|
+
impl_header = UserInclude.new(impl_filename)
|
|
770
|
+
interface_header = UserInclude.new(interface_filename)
|
|
771
|
+
|
|
772
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
773
|
+
.with('module')
|
|
774
|
+
.and_return(impl_filename)
|
|
775
|
+
|
|
776
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
777
|
+
.with('partial_module')
|
|
778
|
+
.and_return(interface_filename)
|
|
779
|
+
|
|
780
|
+
result = @partializer.remap_implementation_source_includes(
|
|
781
|
+
name: 'module',
|
|
782
|
+
includes: includes,
|
|
783
|
+
partials: partials
|
|
784
|
+
)
|
|
785
|
+
|
|
786
|
+
expect(result).to include(impl_header)
|
|
787
|
+
expect(result).to include(interface_header)
|
|
788
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
789
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
790
|
+
expect(result).not_to include(UserInclude.new('partial_module.h'))
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
it "remaps mockable private partial to interface header" do
|
|
794
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('partial_module.h'), UserInclude.new('header2.h')]
|
|
795
|
+
partials = {
|
|
796
|
+
'partial_module' => make_partial_config(mocks_type: Partials::PRIVATE)
|
|
797
|
+
}
|
|
798
|
+
impl_filename = 'module_impl.h'
|
|
799
|
+
interface_filename = 'partial_module_interface.h'
|
|
800
|
+
impl_header = UserInclude.new(impl_filename)
|
|
801
|
+
interface_header = UserInclude.new(interface_filename)
|
|
802
|
+
|
|
803
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
804
|
+
.with('module')
|
|
805
|
+
.and_return(impl_filename)
|
|
806
|
+
|
|
807
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
808
|
+
.with('partial_module')
|
|
809
|
+
.and_return(interface_filename)
|
|
810
|
+
|
|
811
|
+
result = @partializer.remap_implementation_source_includes(
|
|
812
|
+
name: 'module',
|
|
813
|
+
includes: includes,
|
|
814
|
+
partials: partials
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
expect(result).to include(impl_header)
|
|
818
|
+
expect(result).to include(interface_header)
|
|
819
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
820
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
821
|
+
expect(result).not_to include(UserInclude.new('partial_module.h'))
|
|
822
|
+
end
|
|
823
|
+
|
|
824
|
+
it "remaps multiple mockable partials to interface headers" do
|
|
825
|
+
includes = [
|
|
826
|
+
UserInclude.new('header1.h'),
|
|
827
|
+
UserInclude.new('partial1.h'),
|
|
828
|
+
UserInclude.new('partial2.h'),
|
|
829
|
+
UserInclude.new('header2.h')
|
|
830
|
+
]
|
|
831
|
+
partials = {
|
|
832
|
+
'partial1' => make_partial_config(mocks_type: Partials::PUBLIC),
|
|
833
|
+
'partial2' => make_partial_config(mocks_type: Partials::PRIVATE)
|
|
834
|
+
}
|
|
835
|
+
impl_filename = 'module_impl.h'
|
|
836
|
+
interface_filename1 = 'partial1_module_interface.h'
|
|
837
|
+
interface_filename2 = 'partial2_module_interface.h'
|
|
838
|
+
impl_header = UserInclude.new(impl_filename)
|
|
839
|
+
interface_header1 = UserInclude.new(interface_filename1)
|
|
840
|
+
interface_header2 = UserInclude.new(interface_filename2)
|
|
841
|
+
|
|
842
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
843
|
+
.with('module')
|
|
844
|
+
.and_return(impl_filename)
|
|
845
|
+
|
|
846
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
847
|
+
.with('partial1')
|
|
848
|
+
.and_return(interface_filename1)
|
|
849
|
+
|
|
850
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
851
|
+
.with('partial2')
|
|
852
|
+
.and_return(interface_filename2)
|
|
853
|
+
|
|
854
|
+
result = @partializer.remap_implementation_source_includes(
|
|
855
|
+
name: 'module',
|
|
856
|
+
includes: includes,
|
|
857
|
+
partials: partials
|
|
858
|
+
)
|
|
859
|
+
|
|
860
|
+
expect(result).to include(impl_header)
|
|
861
|
+
expect(result).to include(interface_header1)
|
|
862
|
+
expect(result).to include(interface_header2)
|
|
863
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
864
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
865
|
+
expect(result).not_to include(UserInclude.new('partial1.h'))
|
|
866
|
+
expect(result).not_to include(UserInclude.new('partial2.h'))
|
|
867
|
+
end
|
|
868
|
+
|
|
869
|
+
it "remaps testable partial to implementation header" do
|
|
870
|
+
includes = [UserInclude.new('header1.h'), UserInclude.new('partial_module.h'), UserInclude.new('header2.h')]
|
|
871
|
+
partials = {
|
|
872
|
+
'partial_module' => make_partial_config(tests_type: Partials::PUBLIC)
|
|
873
|
+
}
|
|
874
|
+
filename = 'module_impl.h'
|
|
875
|
+
impl_header = UserInclude.new(filename)
|
|
876
|
+
|
|
877
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
878
|
+
.with('module')
|
|
879
|
+
.and_return(filename)
|
|
880
|
+
|
|
881
|
+
result = @partializer.remap_implementation_source_includes(
|
|
882
|
+
name: 'module',
|
|
883
|
+
includes: includes,
|
|
884
|
+
partials: partials
|
|
885
|
+
)
|
|
886
|
+
|
|
887
|
+
expect(result).to include(impl_header)
|
|
888
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
889
|
+
expect(result).to include(UserInclude.new('partial_module.h'))
|
|
890
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
891
|
+
end
|
|
892
|
+
|
|
893
|
+
it "remaps mix of mockable and testable partials" do
|
|
894
|
+
includes = [
|
|
895
|
+
UserInclude.new('header1.h'),
|
|
896
|
+
UserInclude.new('partial1.h'),
|
|
897
|
+
UserInclude.new('partial2.h'),
|
|
898
|
+
UserInclude.new('header2.h')
|
|
899
|
+
]
|
|
900
|
+
partials = {
|
|
901
|
+
'partial1' => make_partial_config(mocks_type: Partials::PUBLIC),
|
|
902
|
+
'partial2' => make_partial_config(tests_type: Partials::PRIVATE)
|
|
903
|
+
}
|
|
904
|
+
impl_filename = 'module_impl.h'
|
|
905
|
+
interface1_filename = 'partial1_module_interface.h'
|
|
906
|
+
impl_header = UserInclude.new(impl_filename)
|
|
907
|
+
interface_header1 = UserInclude.new(interface1_filename)
|
|
908
|
+
|
|
909
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
910
|
+
.with('module')
|
|
911
|
+
.and_return(impl_filename)
|
|
912
|
+
|
|
913
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
914
|
+
.with('partial1')
|
|
915
|
+
.and_return(interface1_filename)
|
|
916
|
+
|
|
917
|
+
result = @partializer.remap_implementation_source_includes(
|
|
918
|
+
name: 'module',
|
|
919
|
+
includes: includes,
|
|
920
|
+
partials: partials
|
|
921
|
+
)
|
|
922
|
+
|
|
923
|
+
expect(result).to include(impl_header)
|
|
924
|
+
expect(result).to include(interface_header1)
|
|
925
|
+
expect(result).to include(UserInclude.new('partial2.h'))
|
|
926
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
927
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
928
|
+
expect(result).not_to include(UserInclude.new('partial1.h'))
|
|
929
|
+
end
|
|
930
|
+
|
|
931
|
+
it "removes duplicates after remapping" do
|
|
932
|
+
includes = [
|
|
933
|
+
UserInclude.new('header1.h'),
|
|
934
|
+
UserInclude.new('partial_module.h'),
|
|
935
|
+
UserInclude.new('header1.h'),
|
|
936
|
+
UserInclude.new('header2.h')
|
|
937
|
+
]
|
|
938
|
+
partials = {
|
|
939
|
+
'partial_module' => make_partial_config(mocks_type: Partials::PUBLIC)
|
|
940
|
+
}
|
|
941
|
+
impl_filename = 'module_impl.h'
|
|
942
|
+
interface_filename = 'partial_module_interface.h'
|
|
943
|
+
impl_header = UserInclude.new(impl_filename)
|
|
944
|
+
interface_header = UserInclude.new(interface_filename)
|
|
945
|
+
|
|
946
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
947
|
+
.with('module')
|
|
948
|
+
.and_return(impl_filename)
|
|
949
|
+
|
|
950
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
951
|
+
.with('partial_module')
|
|
952
|
+
.and_return(interface_filename)
|
|
953
|
+
|
|
954
|
+
result = @partializer.remap_implementation_source_includes(
|
|
955
|
+
name: 'module',
|
|
956
|
+
includes: includes,
|
|
957
|
+
partials: partials
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
expect(result.count(UserInclude.new('header1.h'))).to eq(1)
|
|
961
|
+
expect(result).to include(impl_header)
|
|
962
|
+
expect(result).to include(interface_header)
|
|
963
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
964
|
+
end
|
|
965
|
+
|
|
966
|
+
it "handles case-insensitive module header removal" do
|
|
967
|
+
includes = [
|
|
968
|
+
UserInclude.new('header1.h'),
|
|
969
|
+
UserInclude.new('module.h'),
|
|
970
|
+
UserInclude.new('MODULE.H'),
|
|
971
|
+
UserInclude.new('header2.h')
|
|
972
|
+
]
|
|
973
|
+
partials = {}
|
|
974
|
+
filename ='module_impl.h'
|
|
975
|
+
impl_header = UserInclude.new(filename)
|
|
976
|
+
|
|
977
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
978
|
+
.with('module')
|
|
979
|
+
.and_return(filename)
|
|
980
|
+
|
|
981
|
+
result = @partializer.remap_implementation_source_includes(
|
|
982
|
+
name: 'module',
|
|
983
|
+
includes: includes,
|
|
984
|
+
partials: partials
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
expect(result).to include(impl_header)
|
|
988
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
989
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
990
|
+
expect(result).not_to include(UserInclude.new('module.h'))
|
|
991
|
+
expect(result).not_to include(UserInclude.new('MODULE.H'))
|
|
992
|
+
end
|
|
993
|
+
|
|
994
|
+
it "handles case-insensitive partial module remapping" do
|
|
995
|
+
includes = [
|
|
996
|
+
UserInclude.new('header1.h'),
|
|
997
|
+
UserInclude.new('partial_module.h'),
|
|
998
|
+
UserInclude.new('PARTIAL_MODULE.H'),
|
|
999
|
+
UserInclude.new('header2.h')
|
|
1000
|
+
]
|
|
1001
|
+
partials = {
|
|
1002
|
+
'partial_module' => make_partial_config(mocks_type: Partials::PUBLIC)
|
|
1003
|
+
}
|
|
1004
|
+
impl_filename = 'module_impl.h'
|
|
1005
|
+
interface_filename = 'partial_module_interface.h'
|
|
1006
|
+
impl_header = UserInclude.new(impl_filename)
|
|
1007
|
+
interface_header = UserInclude.new(interface_filename)
|
|
1008
|
+
|
|
1009
|
+
allow(@file_path_utils).to receive(:form_partial_implementation_header_filename)
|
|
1010
|
+
.with('module')
|
|
1011
|
+
.and_return(impl_filename)
|
|
1012
|
+
|
|
1013
|
+
allow(@file_path_utils).to receive(:form_partial_interface_header_filename)
|
|
1014
|
+
.with('partial_module')
|
|
1015
|
+
.and_return(interface_filename)
|
|
1016
|
+
|
|
1017
|
+
result = @partializer.remap_implementation_source_includes(
|
|
1018
|
+
name: 'module',
|
|
1019
|
+
includes: includes,
|
|
1020
|
+
partials: partials
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
expect(result).to include(impl_header)
|
|
1024
|
+
expect(result).to include(interface_header)
|
|
1025
|
+
expect(result).to include(UserInclude.new('header1.h'))
|
|
1026
|
+
expect(result).to include(UserInclude.new('header2.h'))
|
|
1027
|
+
expect(result).not_to include(UserInclude.new('partial_module.h'))
|
|
1028
|
+
expect(result).not_to include(UserInclude.new('PARTIAL_MODULE.H'))
|
|
1029
|
+
end
|
|
1030
|
+
end
|
|
1031
|
+
|
|
1032
|
+
###
|
|
1033
|
+
### extract_module_contents()
|
|
1034
|
+
###
|
|
1035
|
+
|
|
1036
|
+
context "#extract_module_contents" do
|
|
1037
|
+
before(:each) do
|
|
1038
|
+
@name = 'TestModule'
|
|
1039
|
+
|
|
1040
|
+
# associate_function_line_numbers is called for every file processed; stub by default
|
|
1041
|
+
allow(@partializer_helper).to receive(:associate_function_line_numbers)
|
|
1042
|
+
# static var extraction/promotion called for every file processed; stub by default
|
|
1043
|
+
allow(@partializer_helper).to receive(:extract_function_scope_static_vars).and_return([])
|
|
1044
|
+
end
|
|
1045
|
+
|
|
1046
|
+
it "returns empty CModule when both directives_only_filepaths are nil" do
|
|
1047
|
+
config = Partials::Config.new(
|
|
1048
|
+
module: 'module1',
|
|
1049
|
+
header: Partials::ConfigFileInfo.new(filepath: '/path/to/header.h', directives_only_filepath: nil),
|
|
1050
|
+
source: Partials::ConfigFileInfo.new(filepath: '/path/to/source.c', directives_only_filepath: nil)
|
|
1051
|
+
)
|
|
1052
|
+
|
|
1053
|
+
expect(@c_extractor).not_to receive(:from_file)
|
|
1054
|
+
expect(@partializer_helper).not_to receive(:associate_function_line_numbers)
|
|
1055
|
+
expect(@partializer_helper).not_to receive(:extract_function_scope_static_vars)
|
|
1056
|
+
|
|
1057
|
+
result = @partializer.extract_module_contents(@name, config, false)
|
|
1058
|
+
|
|
1059
|
+
expect(result.function_definitions).to eq([])
|
|
1060
|
+
expect(result.variable_declarations).to eq([])
|
|
1061
|
+
end
|
|
1062
|
+
|
|
1063
|
+
it "extracts contents from header preprocessed file only" do
|
|
1064
|
+
header_funcs = [
|
|
1065
|
+
double('func1', name: 'func1', signature: 'void func1(void)'),
|
|
1066
|
+
double('func2', name: 'func2', signature: 'int func2(int x)')
|
|
1067
|
+
]
|
|
1068
|
+
header_contents = CExtractorTypes::CModule.new(function_definitions: header_funcs, variable_declarations: [])
|
|
1069
|
+
|
|
1070
|
+
config = Partials::Config.new(
|
|
1071
|
+
module: 'module1',
|
|
1072
|
+
header: Partials::ConfigFileInfo.new(filepath: '/path/to/header.h', directives_only_filepath: '/build/preproc/header.i'),
|
|
1073
|
+
source: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil)
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
expect(@c_extractor).to receive(:from_file).with('/build/preproc/header.i').and_return(header_contents)
|
|
1077
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1078
|
+
name: @name, funcs: header_funcs, filepath: '/path/to/header.h', fallback: false
|
|
1079
|
+
)
|
|
1080
|
+
|
|
1081
|
+
result = @partializer.extract_module_contents(@name, config, false)
|
|
1082
|
+
|
|
1083
|
+
expect(result.function_definitions).to eq(header_funcs)
|
|
1084
|
+
expect(result.variable_declarations).to eq([])
|
|
1085
|
+
end
|
|
1086
|
+
|
|
1087
|
+
it "extracts contents from source preprocessed file only" do
|
|
1088
|
+
source_funcs = [
|
|
1089
|
+
double('func1', name: 'func1', signature: 'static void func1(void)'),
|
|
1090
|
+
double('func2', name: 'func2', signature: 'static int func2(int x)')
|
|
1091
|
+
]
|
|
1092
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: source_funcs, variable_declarations: [])
|
|
1093
|
+
|
|
1094
|
+
config = Partials::Config.new(
|
|
1095
|
+
module: 'module1',
|
|
1096
|
+
header: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil),
|
|
1097
|
+
source: Partials::ConfigFileInfo.new(filepath: '/path/to/source.c', directives_only_filepath: '/build/preproc/source.i')
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
expect(@c_extractor).to receive(:from_file).with('/build/preproc/source.i').and_return(source_contents)
|
|
1101
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1102
|
+
name: @name, funcs: source_funcs, filepath: '/path/to/source.c', fallback: false
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
result = @partializer.extract_module_contents(@name, config, false)
|
|
1106
|
+
|
|
1107
|
+
expect(result.function_definitions).to eq(source_funcs)
|
|
1108
|
+
expect(result.variable_declarations).to eq([])
|
|
1109
|
+
end
|
|
1110
|
+
|
|
1111
|
+
it "extracts and merges contents from both source and header preprocessed files" do
|
|
1112
|
+
source_funcs = [
|
|
1113
|
+
double('func1', name: 'func1', signature: 'static void func1(void)'),
|
|
1114
|
+
double('func2', name: 'func2', signature: 'static int func2(int x)')
|
|
1115
|
+
]
|
|
1116
|
+
header_funcs = [
|
|
1117
|
+
double('func3', name: 'func3', signature: 'void func3(void)'),
|
|
1118
|
+
double('func4', name: 'func4', signature: 'int func4(int x)')
|
|
1119
|
+
]
|
|
1120
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: source_funcs, variable_declarations: [double('var1')])
|
|
1121
|
+
header_contents = CExtractorTypes::CModule.new(function_definitions: header_funcs, variable_declarations: [double('var2')])
|
|
1122
|
+
|
|
1123
|
+
config = Partials::Config.new(
|
|
1124
|
+
module: 'module1',
|
|
1125
|
+
header: Partials::ConfigFileInfo.new(filepath: '/path/to/header.h', directives_only_filepath: '/build/preproc/header.i'),
|
|
1126
|
+
source: Partials::ConfigFileInfo.new(filepath: '/path/to/source.c', directives_only_filepath: '/build/preproc/source.i')
|
|
1127
|
+
)
|
|
1128
|
+
|
|
1129
|
+
allow(@c_extractor).to receive(:from_file).with('/build/preproc/source.i').and_return(source_contents)
|
|
1130
|
+
allow(@c_extractor).to receive(:from_file).with('/build/preproc/header.i').and_return(header_contents)
|
|
1131
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1132
|
+
name: @name, funcs: source_funcs, filepath: '/path/to/source.c', fallback: false
|
|
1133
|
+
)
|
|
1134
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1135
|
+
name: @name, funcs: header_funcs, filepath: '/path/to/header.h', fallback: false
|
|
1136
|
+
)
|
|
1137
|
+
|
|
1138
|
+
result = @partializer.extract_module_contents(@name, config, false)
|
|
1139
|
+
|
|
1140
|
+
expect(result.function_definitions).to eq(header_funcs + source_funcs)
|
|
1141
|
+
expect(result.variable_declarations).to eq(header_contents.variable_declarations + source_contents.variable_declarations)
|
|
1142
|
+
end
|
|
1143
|
+
|
|
1144
|
+
it "calls associate_function_line_numbers with the preprocessed expansion filepath, not the preprocessed filepath" do
|
|
1145
|
+
source_funcs = [double('func1', name: 'func1')]
|
|
1146
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: source_funcs, variable_declarations: [])
|
|
1147
|
+
|
|
1148
|
+
config = Partials::Config.new(
|
|
1149
|
+
module: 'module1',
|
|
1150
|
+
header: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil),
|
|
1151
|
+
source: Partials::ConfigFileInfo.new(filepath: '/src/module1.c', directives_only_filepath: '/build/preproc/module1.i')
|
|
1152
|
+
)
|
|
1153
|
+
|
|
1154
|
+
allow(@c_extractor).to receive(:from_file).and_return(source_contents)
|
|
1155
|
+
|
|
1156
|
+
# associate_function_line_numbers must receive the original filepath, not the preprocessed one
|
|
1157
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1158
|
+
name: @name, funcs: source_funcs, filepath: '/src/module1.c', fallback: false
|
|
1159
|
+
)
|
|
1160
|
+
|
|
1161
|
+
@partializer.extract_module_contents(@name, config, false)
|
|
1162
|
+
end
|
|
1163
|
+
|
|
1164
|
+
it "passes extraction name through to associate_function_line_numbers" do
|
|
1165
|
+
source_funcs = [double('func1', name: 'func1')]
|
|
1166
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: source_funcs, variable_declarations: [])
|
|
1167
|
+
|
|
1168
|
+
config = Partials::Config.new(
|
|
1169
|
+
module: 'module1',
|
|
1170
|
+
header: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil),
|
|
1171
|
+
source: Partials::ConfigFileInfo.new(filepath: '/src/module1.c', directives_only_filepath: '/build/preproc/module1.i')
|
|
1172
|
+
)
|
|
1173
|
+
|
|
1174
|
+
allow(@c_extractor).to receive(:from_file).and_return(source_contents)
|
|
1175
|
+
|
|
1176
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1177
|
+
name: 'SpecificTestName', funcs: source_funcs, filepath: '/src/module1.c', fallback: false
|
|
1178
|
+
)
|
|
1179
|
+
|
|
1180
|
+
@partializer.extract_module_contents('SpecificTestName', config, false)
|
|
1181
|
+
end
|
|
1182
|
+
|
|
1183
|
+
it "returns empty CModule when a preprocessed file has no contents" do
|
|
1184
|
+
empty_contents = CExtractorTypes::CModule.new(function_definitions: [], variable_declarations: [])
|
|
1185
|
+
|
|
1186
|
+
config = Partials::Config.new(
|
|
1187
|
+
module: 'module1',
|
|
1188
|
+
header: Partials::ConfigFileInfo.new(filepath: '/path/to/header.h', directives_only_filepath: '/build/preproc/header.i'),
|
|
1189
|
+
source: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil)
|
|
1190
|
+
)
|
|
1191
|
+
|
|
1192
|
+
expect(@c_extractor).to receive(:from_file).and_return(empty_contents)
|
|
1193
|
+
expect(@partializer_helper).to receive(:associate_function_line_numbers).with(
|
|
1194
|
+
name: @name, funcs: [], filepath: '/path/to/header.h', fallback: false
|
|
1195
|
+
)
|
|
1196
|
+
|
|
1197
|
+
result = @partializer.extract_module_contents(@name, config, false)
|
|
1198
|
+
|
|
1199
|
+
expect(result.function_definitions).to eq([])
|
|
1200
|
+
expect(result.variable_declarations).to eq([])
|
|
1201
|
+
end
|
|
1202
|
+
|
|
1203
|
+
it "appends promoted function-scope static variables to element_sequence" do
|
|
1204
|
+
promoted_var1 = CExtractorTypes::CVariableDeclaration.new(text: 'static int counter = 0;', type: 'int', name: 'counter')
|
|
1205
|
+
promoted_var2 = CExtractorTypes::CVariableDeclaration.new(text: 'static bool flag = false;', type: 'bool', name: 'flag')
|
|
1206
|
+
|
|
1207
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: [], variable_declarations: [])
|
|
1208
|
+
|
|
1209
|
+
config = Partials::Config.new(
|
|
1210
|
+
module: 'module1',
|
|
1211
|
+
header: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil),
|
|
1212
|
+
source: Partials::ConfigFileInfo.new(filepath: '/src/module1.c', directives_only_filepath: '/build/preproc/module1.i')
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
allow(@c_extractor).to receive(:from_file).and_return(source_contents)
|
|
1216
|
+
allow(@partializer_helper).to receive(:extract_function_scope_static_vars).and_return([promoted_var1, promoted_var2])
|
|
1217
|
+
|
|
1218
|
+
result = @partializer.extract_module_contents(@name, config, false)
|
|
1219
|
+
|
|
1220
|
+
expect(result.element_sequence).to eq([promoted_var1, promoted_var2])
|
|
1221
|
+
expect(result.element_sequence[0]).to equal(promoted_var1)
|
|
1222
|
+
expect(result.element_sequence[1]).to equal(promoted_var2)
|
|
1223
|
+
end
|
|
1224
|
+
|
|
1225
|
+
it "calls update_signatures_from_full_expansion when full_expansion_filepath is set on source" do
|
|
1226
|
+
source_funcs = [double('func1', name: 'func1')]
|
|
1227
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: source_funcs, variable_declarations: [])
|
|
1228
|
+
|
|
1229
|
+
config = Partials::Config.new(
|
|
1230
|
+
module: 'module1',
|
|
1231
|
+
header: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil),
|
|
1232
|
+
source: Partials::ConfigFileInfo.new(
|
|
1233
|
+
filepath: '/src/module1.c',
|
|
1234
|
+
directives_only_filepath: '/build/preproc/module1.i',
|
|
1235
|
+
full_expansion_filepath: '/build/preproc/full_expansion/module1.c'
|
|
1236
|
+
)
|
|
1237
|
+
)
|
|
1238
|
+
|
|
1239
|
+
allow(@c_extractor).to receive(:from_file).with('/build/preproc/module1.i').and_return(source_contents)
|
|
1240
|
+
allow(@partializer_helper).to receive(:associate_function_line_numbers)
|
|
1241
|
+
|
|
1242
|
+
expect(@partializer_helper).to receive(:update_signatures_from_full_expansion).with(
|
|
1243
|
+
funcs: source_funcs,
|
|
1244
|
+
full_expansion_filepath: '/build/preproc/full_expansion/module1.c',
|
|
1245
|
+
name: @name,
|
|
1246
|
+
module_name: 'module1',
|
|
1247
|
+
file_type: 'source'
|
|
1248
|
+
)
|
|
1249
|
+
|
|
1250
|
+
@partializer.extract_module_contents(@name, config, false)
|
|
1251
|
+
end
|
|
1252
|
+
|
|
1253
|
+
it "calls update_signatures_from_full_expansion when full_expansion_filepath is set on header" do
|
|
1254
|
+
header_funcs = [double('func1', name: 'func1')]
|
|
1255
|
+
header_contents = CExtractorTypes::CModule.new(function_definitions: header_funcs, variable_declarations: [])
|
|
1256
|
+
|
|
1257
|
+
config = Partials::Config.new(
|
|
1258
|
+
module: 'module1',
|
|
1259
|
+
header: Partials::ConfigFileInfo.new(
|
|
1260
|
+
filepath: '/path/to/header.h',
|
|
1261
|
+
directives_only_filepath: '/build/preproc/header.h',
|
|
1262
|
+
full_expansion_filepath: '/build/preproc/full_expansion/header.h'
|
|
1263
|
+
),
|
|
1264
|
+
source: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil)
|
|
1265
|
+
)
|
|
1266
|
+
|
|
1267
|
+
allow(@c_extractor).to receive(:from_file).with('/build/preproc/header.h').and_return(header_contents)
|
|
1268
|
+
allow(@partializer_helper).to receive(:associate_function_line_numbers)
|
|
1269
|
+
|
|
1270
|
+
expect(@partializer_helper).to receive(:update_signatures_from_full_expansion).with(
|
|
1271
|
+
funcs: header_funcs,
|
|
1272
|
+
full_expansion_filepath: '/build/preproc/full_expansion/header.h',
|
|
1273
|
+
name: @name,
|
|
1274
|
+
module_name: 'module1',
|
|
1275
|
+
file_type: 'header'
|
|
1276
|
+
)
|
|
1277
|
+
|
|
1278
|
+
@partializer.extract_module_contents(@name, config, false)
|
|
1279
|
+
end
|
|
1280
|
+
|
|
1281
|
+
it "does not call update_signatures_from_full_expansion when full_expansion_filepath is nil" do
|
|
1282
|
+
source_funcs = [double('func1', name: 'func1')]
|
|
1283
|
+
source_contents = CExtractorTypes::CModule.new(function_definitions: source_funcs, variable_declarations: [])
|
|
1284
|
+
|
|
1285
|
+
config = Partials::Config.new(
|
|
1286
|
+
module: 'module1',
|
|
1287
|
+
header: Partials::ConfigFileInfo.new(filepath: nil, directives_only_filepath: nil),
|
|
1288
|
+
source: Partials::ConfigFileInfo.new(
|
|
1289
|
+
filepath: '/src/module1.c',
|
|
1290
|
+
directives_only_filepath: '/build/preproc/module1.i',
|
|
1291
|
+
full_expansion_filepath: nil
|
|
1292
|
+
)
|
|
1293
|
+
)
|
|
1294
|
+
|
|
1295
|
+
allow(@c_extractor).to receive(:from_file).with('/build/preproc/module1.i').and_return(source_contents)
|
|
1296
|
+
allow(@partializer_helper).to receive(:associate_function_line_numbers)
|
|
1297
|
+
|
|
1298
|
+
expect(@partializer_helper).not_to receive(:update_signatures_from_full_expansion)
|
|
1299
|
+
|
|
1300
|
+
@partializer.extract_module_contents(@name, config, false)
|
|
1301
|
+
end
|
|
1302
|
+
end
|
|
1303
|
+
|
|
1304
|
+
###
|
|
1305
|
+
### extract_implementation_functions()
|
|
1306
|
+
###
|
|
1307
|
+
|
|
1308
|
+
def make_pf(type: nil, additions: [], subtractions: [])
|
|
1309
|
+
OpenStruct.new(type: type, additions: additions, subtractions: subtractions)
|
|
1310
|
+
end
|
|
1311
|
+
|
|
1312
|
+
def make_config(tests: make_pf, mocks: make_pf)
|
|
1313
|
+
OpenStruct.new(tests: tests, mocks: mocks)
|
|
1314
|
+
end
|
|
1315
|
+
|
|
1316
|
+
context "#extract_implementation_functions" do
|
|
1317
|
+
it "returns nil when config tests type is nil" do
|
|
1318
|
+
defs = []
|
|
1319
|
+
pf = make_pf
|
|
1320
|
+
|
|
1321
|
+
expect(@partializer_helper).not_to receive(:find_and_transform_func)
|
|
1322
|
+
|
|
1323
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1324
|
+
.with(defs, nil, :impl).and_return([])
|
|
1325
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1326
|
+
.with(funcs: [], names: []).and_return([])
|
|
1327
|
+
|
|
1328
|
+
result = @partializer.extract_implementation_functions(
|
|
1329
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1330
|
+
)
|
|
1331
|
+
expect(result).to be_nil
|
|
1332
|
+
end
|
|
1333
|
+
|
|
1334
|
+
it "delegates initial list to filter_and_transform_funcs for PUBLIC type" do
|
|
1335
|
+
defs = [double('func1', name: 'pub')]
|
|
1336
|
+
filtered = [double('impl_func')]
|
|
1337
|
+
pf = make_pf(type: Partials::PUBLIC)
|
|
1338
|
+
|
|
1339
|
+
expect(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1340
|
+
.with(defs, Partials::PUBLIC, :impl).and_return(filtered)
|
|
1341
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1342
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1343
|
+
|
|
1344
|
+
result = @partializer.extract_implementation_functions(
|
|
1345
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1346
|
+
)
|
|
1347
|
+
expect(result).to eq(filtered)
|
|
1348
|
+
end
|
|
1349
|
+
|
|
1350
|
+
it "delegates initial list to filter_and_transform_funcs for PRIVATE type" do
|
|
1351
|
+
defs = [double('func1', name: 'priv')]
|
|
1352
|
+
filtered = [double('impl_func')]
|
|
1353
|
+
pf = make_pf(type: Partials::PRIVATE)
|
|
1354
|
+
|
|
1355
|
+
expect(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1356
|
+
.with(defs, Partials::PRIVATE, :impl).and_return(filtered)
|
|
1357
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1358
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1359
|
+
|
|
1360
|
+
result = @partializer.extract_implementation_functions(
|
|
1361
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1362
|
+
)
|
|
1363
|
+
expect(result).to eq(filtered)
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
|
+
it "fills list from additions only for ACCUMULATE type" do
|
|
1367
|
+
defs = [double('func1', name: 'named')]
|
|
1368
|
+
found = double('impl_func', name: 'named')
|
|
1369
|
+
pf = make_pf(type: Partials::ACCUMULATE, additions: ['named'])
|
|
1370
|
+
|
|
1371
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1372
|
+
.with(defs, Partials::ACCUMULATE, :impl).and_return([])
|
|
1373
|
+
expect(@partializer_helper).to receive(:find_and_transform_func)
|
|
1374
|
+
.with(name: 'named', primary_funcs: defs, secondary_funcs: [], output_type: :impl)
|
|
1375
|
+
.and_return(found)
|
|
1376
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1377
|
+
.with(funcs: [found], names: []).and_return([found])
|
|
1378
|
+
|
|
1379
|
+
result = @partializer.extract_implementation_functions(
|
|
1380
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1381
|
+
)
|
|
1382
|
+
expect(result).to eq([found])
|
|
1383
|
+
end
|
|
1384
|
+
|
|
1385
|
+
it "adds cross-visibility function from additions to initial list" do
|
|
1386
|
+
pub_func = double('pub', name: 'pub')
|
|
1387
|
+
priv_func = double('priv', name: 'priv')
|
|
1388
|
+
defs = [pub_func, priv_func]
|
|
1389
|
+
filtered = [double('impl_pub', name: 'pub')]
|
|
1390
|
+
added = double('impl_priv', name: 'priv')
|
|
1391
|
+
pf = make_pf(type: Partials::PUBLIC, additions: ['priv'])
|
|
1392
|
+
|
|
1393
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1394
|
+
.with(defs, Partials::PUBLIC, :impl).and_return(filtered)
|
|
1395
|
+
expect(@partializer_helper).to receive(:find_and_transform_func)
|
|
1396
|
+
.with(name: 'priv', primary_funcs: defs, secondary_funcs: [], output_type: :impl)
|
|
1397
|
+
.and_return(added)
|
|
1398
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1399
|
+
.with(funcs: [filtered[0], added], names: []).and_return([filtered[0], added])
|
|
1400
|
+
|
|
1401
|
+
result = @partializer.extract_implementation_functions(
|
|
1402
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1403
|
+
)
|
|
1404
|
+
expect(result).to include(filtered[0], added)
|
|
1405
|
+
end
|
|
1406
|
+
|
|
1407
|
+
it "skips addition when function already in initial list (dedup)" do
|
|
1408
|
+
func = double('impl_pub', name: 'pub')
|
|
1409
|
+
defs = [double('def', name: 'pub')]
|
|
1410
|
+
filtered = [func]
|
|
1411
|
+
pf = make_pf(type: Partials::PUBLIC, additions: ['pub'])
|
|
1412
|
+
|
|
1413
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1414
|
+
.with(defs, Partials::PUBLIC, :impl).and_return(filtered)
|
|
1415
|
+
expect(@partializer_helper).not_to receive(:find_and_transform_func)
|
|
1416
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1417
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1418
|
+
|
|
1419
|
+
result = @partializer.extract_implementation_functions(
|
|
1420
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1421
|
+
)
|
|
1422
|
+
expect(result).to eq(filtered)
|
|
1423
|
+
end
|
|
1424
|
+
|
|
1425
|
+
it "delegates subtractions to subtract_funcs" do
|
|
1426
|
+
defs = [double('func', name: 'pub')]
|
|
1427
|
+
filtered = [double('impl_pub', name: 'pub')]
|
|
1428
|
+
pf = make_pf(type: Partials::PUBLIC, subtractions: ['pub'])
|
|
1429
|
+
|
|
1430
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1431
|
+
.with(defs, Partials::PUBLIC, :impl).and_return(filtered)
|
|
1432
|
+
expect(@partializer_helper).to receive(:subtract_funcs)
|
|
1433
|
+
.with(funcs: filtered, names: ['pub']).and_return([])
|
|
1434
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1435
|
+
.with(funcs: [], names: []).and_return([])
|
|
1436
|
+
|
|
1437
|
+
result = @partializer.extract_implementation_functions(
|
|
1438
|
+
test: 'test_mod', partial: 'mod', definitions: defs, config: make_config(tests: pf)
|
|
1439
|
+
)
|
|
1440
|
+
expect(result).to eq([])
|
|
1441
|
+
end
|
|
1442
|
+
|
|
1443
|
+
it "subtracts mocks.additions from the impl result" do
|
|
1444
|
+
defs = [double('func', name: 'pub')]
|
|
1445
|
+
filtered = [double('impl_pub', name: 'pub')]
|
|
1446
|
+
test_pf = make_pf(type: Partials::PUBLIC)
|
|
1447
|
+
mock_pf = make_pf(additions: ['pub'])
|
|
1448
|
+
|
|
1449
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1450
|
+
.with(defs, Partials::PUBLIC, :impl).and_return(filtered)
|
|
1451
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1452
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1453
|
+
expect(@partializer_helper).to receive(:subtract_funcs)
|
|
1454
|
+
.with(funcs: filtered, names: ['pub']).and_return([])
|
|
1455
|
+
|
|
1456
|
+
result = @partializer.extract_implementation_functions(
|
|
1457
|
+
test: 'test_mod', partial: 'mod', definitions: defs,
|
|
1458
|
+
config: make_config(tests: test_pf, mocks: mock_pf)
|
|
1459
|
+
)
|
|
1460
|
+
expect(result).to eq([])
|
|
1461
|
+
end
|
|
1462
|
+
end
|
|
1463
|
+
|
|
1464
|
+
###
|
|
1465
|
+
### extract_interface_functions()
|
|
1466
|
+
###
|
|
1467
|
+
|
|
1468
|
+
context "#extract_interface_functions" do
|
|
1469
|
+
it "returns nil when config mocks type is nil" do
|
|
1470
|
+
defs = []
|
|
1471
|
+
decls = []
|
|
1472
|
+
pf = make_pf
|
|
1473
|
+
|
|
1474
|
+
expect(@partializer_helper).not_to receive(:find_and_transform_func)
|
|
1475
|
+
|
|
1476
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1477
|
+
.with(defs, nil, :interface).and_return([])
|
|
1478
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1479
|
+
.with(funcs: [], names: []).and_return([])
|
|
1480
|
+
|
|
1481
|
+
result = @partializer.extract_interface_functions(
|
|
1482
|
+
test: 'test_mod', partial: 'mod',
|
|
1483
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1484
|
+
)
|
|
1485
|
+
expect(result).to be_nil
|
|
1486
|
+
end
|
|
1487
|
+
|
|
1488
|
+
it "delegates initial list to filter_and_transform_funcs for PUBLIC type" do
|
|
1489
|
+
defs = [double('func1', name: 'pub')]
|
|
1490
|
+
decls = []
|
|
1491
|
+
filtered = [double('iface_func')]
|
|
1492
|
+
pf = make_pf(type: Partials::PUBLIC)
|
|
1493
|
+
|
|
1494
|
+
expect(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1495
|
+
.with(defs, Partials::PUBLIC, :interface).and_return(filtered)
|
|
1496
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1497
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1498
|
+
|
|
1499
|
+
result = @partializer.extract_interface_functions(
|
|
1500
|
+
test: 'test_mod', partial: 'mod',
|
|
1501
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1502
|
+
)
|
|
1503
|
+
expect(result).to eq(filtered)
|
|
1504
|
+
end
|
|
1505
|
+
|
|
1506
|
+
it "delegates initial list to filter_and_transform_funcs for PRIVATE type" do
|
|
1507
|
+
defs = [double('func1', name: 'priv')]
|
|
1508
|
+
decls = []
|
|
1509
|
+
filtered = [double('iface_func')]
|
|
1510
|
+
pf = make_pf(type: Partials::PRIVATE)
|
|
1511
|
+
|
|
1512
|
+
expect(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1513
|
+
.with(defs, Partials::PRIVATE, :interface).and_return(filtered)
|
|
1514
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1515
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1516
|
+
|
|
1517
|
+
result = @partializer.extract_interface_functions(
|
|
1518
|
+
test: 'test_mod', partial: 'mod',
|
|
1519
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1520
|
+
)
|
|
1521
|
+
expect(result).to eq(filtered)
|
|
1522
|
+
end
|
|
1523
|
+
|
|
1524
|
+
it "fills list from additions only for ACCUMULATE type" do
|
|
1525
|
+
defs = [double('def', name: 'named')]
|
|
1526
|
+
decls = []
|
|
1527
|
+
found = double('iface_func', name: 'named')
|
|
1528
|
+
pf = make_pf(type: Partials::ACCUMULATE, additions: ['named'])
|
|
1529
|
+
|
|
1530
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1531
|
+
.with(defs, Partials::ACCUMULATE, :interface).and_return([])
|
|
1532
|
+
expect(@partializer_helper).to receive(:find_and_transform_func)
|
|
1533
|
+
.with(name: 'named', primary_funcs: defs, secondary_funcs: decls, output_type: :interface)
|
|
1534
|
+
.and_return(found)
|
|
1535
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1536
|
+
.with(funcs: [found], names: []).and_return([found])
|
|
1537
|
+
|
|
1538
|
+
result = @partializer.extract_interface_functions(
|
|
1539
|
+
test: 'test_mod', partial: 'mod',
|
|
1540
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1541
|
+
)
|
|
1542
|
+
expect(result).to eq([found])
|
|
1543
|
+
end
|
|
1544
|
+
|
|
1545
|
+
it "searches definitions then declarations for additions" do
|
|
1546
|
+
defs = []
|
|
1547
|
+
decls = [double('decl', name: 'decl_only')]
|
|
1548
|
+
found = double('iface_func', name: 'decl_only')
|
|
1549
|
+
pf = make_pf(type: Partials::ACCUMULATE, additions: ['decl_only'])
|
|
1550
|
+
|
|
1551
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1552
|
+
.with(defs, Partials::ACCUMULATE, :interface).and_return([])
|
|
1553
|
+
expect(@partializer_helper).to receive(:find_and_transform_func)
|
|
1554
|
+
.with(name: 'decl_only', primary_funcs: defs, secondary_funcs: decls, output_type: :interface)
|
|
1555
|
+
.and_return(found)
|
|
1556
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1557
|
+
.with(funcs: [found], names: []).and_return([found])
|
|
1558
|
+
|
|
1559
|
+
result = @partializer.extract_interface_functions(
|
|
1560
|
+
test: 'test_mod', partial: 'mod',
|
|
1561
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1562
|
+
)
|
|
1563
|
+
expect(result).to include(found)
|
|
1564
|
+
end
|
|
1565
|
+
|
|
1566
|
+
it "skips addition when function already in initial list (dedup)" do
|
|
1567
|
+
func = double('iface_pub', name: 'pub')
|
|
1568
|
+
defs = [double('def', name: 'pub')]
|
|
1569
|
+
decls = []
|
|
1570
|
+
filtered = [func]
|
|
1571
|
+
pf = make_pf(type: Partials::PUBLIC, additions: ['pub'])
|
|
1572
|
+
|
|
1573
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1574
|
+
.with(defs, Partials::PUBLIC, :interface).and_return(filtered)
|
|
1575
|
+
expect(@partializer_helper).not_to receive(:find_and_transform_func)
|
|
1576
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1577
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1578
|
+
|
|
1579
|
+
result = @partializer.extract_interface_functions(
|
|
1580
|
+
test: 'test_mod', partial: 'mod',
|
|
1581
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1582
|
+
)
|
|
1583
|
+
expect(result).to eq(filtered)
|
|
1584
|
+
end
|
|
1585
|
+
|
|
1586
|
+
it "delegates subtractions to subtract_funcs" do
|
|
1587
|
+
defs = [double('func', name: 'pub')]
|
|
1588
|
+
decls = []
|
|
1589
|
+
filtered = [double('iface_pub', name: 'pub')]
|
|
1590
|
+
pf = make_pf(type: Partials::PUBLIC, subtractions: ['pub'])
|
|
1591
|
+
|
|
1592
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1593
|
+
.with(defs, Partials::PUBLIC, :interface).and_return(filtered)
|
|
1594
|
+
expect(@partializer_helper).to receive(:subtract_funcs)
|
|
1595
|
+
.with(funcs: filtered, names: ['pub']).and_return([])
|
|
1596
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1597
|
+
.with(funcs: [], names: []).and_return([])
|
|
1598
|
+
|
|
1599
|
+
result = @partializer.extract_interface_functions(
|
|
1600
|
+
test: 'test_mod', partial: 'mod',
|
|
1601
|
+
definitions: defs, declarations: decls, config: make_config(mocks: pf)
|
|
1602
|
+
)
|
|
1603
|
+
expect(result).to eq([])
|
|
1604
|
+
end
|
|
1605
|
+
|
|
1606
|
+
it "subtracts tests.additions from the interface result" do
|
|
1607
|
+
defs = [double('func', name: 'pub')]
|
|
1608
|
+
decls = []
|
|
1609
|
+
filtered = [double('iface_pub', name: 'pub')]
|
|
1610
|
+
mock_pf = make_pf(type: Partials::PUBLIC)
|
|
1611
|
+
test_pf = make_pf(additions: ['pub'])
|
|
1612
|
+
|
|
1613
|
+
allow(@partializer_helper).to receive(:filter_and_transform_funcs)
|
|
1614
|
+
.with(defs, Partials::PUBLIC, :interface).and_return(filtered)
|
|
1615
|
+
allow(@partializer_helper).to receive(:subtract_funcs)
|
|
1616
|
+
.with(funcs: filtered, names: []).and_return(filtered)
|
|
1617
|
+
expect(@partializer_helper).to receive(:subtract_funcs)
|
|
1618
|
+
.with(funcs: filtered, names: ['pub']).and_return([])
|
|
1619
|
+
|
|
1620
|
+
result = @partializer.extract_interface_functions(
|
|
1621
|
+
test: 'test_mod', partial: 'mod',
|
|
1622
|
+
definitions: defs, declarations: decls,
|
|
1623
|
+
config: make_config(tests: test_pf, mocks: mock_pf)
|
|
1624
|
+
)
|
|
1625
|
+
expect(result).to eq([])
|
|
1626
|
+
end
|
|
1627
|
+
end
|
|
1628
|
+
|
|
1629
|
+
end
|