ceedling 0.12.2 → 0.13.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -14
- data/.gitmodules +9 -0
- data/.rspec +1 -0
- data/Gemfile +10 -2
- data/README.md +97 -67
- data/{new_project_template → assets}/project.yml +0 -0
- data/{new_project_template → assets}/rakefile.rb +0 -0
- data/bin/ceedling +77 -44
- data/ceedling.gemspec +18 -5
- data/config/test_environment.rb +12 -0
- data/docs/CeedlingLogo.png +0 -0
- data/docs/CeedlingPacket.md +1934 -0
- data/docs/CeedlingPacket.odt +0 -0
- data/docs/CeedlingPacket.pdf +0 -0
- data/examples/temp_sensor/project.yml +71 -74
- data/examples/temp_sensor/rakefile.rb +3 -5
- data/examples/temp_sensor/src/AdcConductor.h +2 -0
- data/examples/temp_sensor/src/TemperatureCalculator.h +2 -0
- data/examples/temp_sensor/src/Types.h +0 -13
- data/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +2 -0
- data/examples/temp_sensor/src/UsartHardware.c +0 -12
- data/examples/temp_sensor/src/UsartHardware.h +0 -1
- data/examples/temp_sensor/test/{test_AdcConductor.c → TestAdcConductor.c} +0 -0
- data/examples/temp_sensor/test/{test_AdcHardware.c → TestAdcHardware.c} +0 -0
- data/examples/temp_sensor/test/{test_AdcModel.c → TestAdcModel.c} +0 -0
- data/examples/temp_sensor/test/{test_Executor.c → TestExecutor.c} +0 -0
- data/examples/temp_sensor/test/{test_Main.c → TestMain.c} +0 -0
- data/examples/temp_sensor/test/{test_Model.c → TestModel.c} +0 -0
- data/examples/temp_sensor/test/{test_TaskScheduler.c → TestTaskScheduler.c} +0 -0
- data/examples/temp_sensor/test/{test_TemperatureCalculator.c → TestTemperatureCalculator.c} +0 -0
- data/examples/temp_sensor/test/{test_TemperatureFilter.c → TestTemperatureFilter.c} +0 -2
- data/examples/temp_sensor/test/{test_TimerConductor.c → TestTimerConductor.c} +0 -0
- data/examples/temp_sensor/test/{test_TimerHardware.c → TestTimerHardware.c} +0 -0
- data/examples/temp_sensor/test/{test_TimerModel.c → TestTimerModel.c} +0 -0
- data/examples/temp_sensor/test/{test_UsartBaudRateRegisterCalculator.c → TestUsartBaudRateRegisterCalculator.c} +0 -0
- data/examples/temp_sensor/test/{test_UsartConductor.c → TestUsartConductor.c} +0 -0
- data/examples/temp_sensor/test/{test_UsartHardware.c → TestUsartHardware.c} +0 -20
- data/examples/temp_sensor/test/{test_UsartModel.c → TestUsartModel.c} +0 -0
- data/examples/temp_sensor/test/support/UnityHelper.c +7 -5
- data/examples/temp_sensor/test/support/UnityHelper.h +5 -5
- data/{new_project_template/vendor/ceedling/lib → lib}/build_invoker_utils.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/cacheinator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/cacheinator_helper.rb +0 -0
- data/lib/ceedling.rb +16 -4
- data/lib/ceedling/version.rb +4 -4
- data/lib/ceedling/version.rb.erb +1 -1
- data/{new_project_template/vendor/ceedling/lib → lib}/cmock_builder.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/configurator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/configurator_builder.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/configurator_plugins.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/configurator_setup.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/configurator_validator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/constants.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/defaults.rb +2 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/dependinator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/erb_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/file_finder.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/file_finder_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/file_path_utils.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/file_system_utils.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/file_system_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/file_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/flaginator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/generator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/generator_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/generator_test_results.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/generator_test_results_sanity_checker.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/generator_test_runner.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/loginator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/makefile.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/objects.yml +0 -2
- data/lib/par_map.rb +19 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/plugin.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/plugin_builder.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/plugin_manager.rb +20 -8
- data/{new_project_template/vendor/ceedling/lib → lib}/plugin_manager_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/plugin_reportinator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/plugin_reportinator_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/preprocessinator.rb +0 -0
- data/lib/preprocessinator_extractor.rb +30 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/preprocessinator_file_handler.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/preprocessinator_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/preprocessinator_includes_handler.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/project_config_manager.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/project_file_loader.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rake_utils.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rake_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rakefile.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/release_invoker.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/release_invoker_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/reportinator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rules_cmock.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rules_preprocess.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rules_release.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rules_release_deep_dependencies.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rules_tests.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/rules_tests_deep_dependencies.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/setupinator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/stream_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/streaminator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/streaminator_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/system_utils.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/system_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/task_invoker.rb +7 -3
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_base.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_filesystem.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_release.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_release_deep_dependencies.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_tests.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_tests_deep_dependencies.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tasks_vendor.rake +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/test_includes_extractor.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/test_invoker.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/test_invoker_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tool_executor.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/tool_executor_helper.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/verbosinator.rb +0 -0
- data/{new_project_template/vendor/ceedling/lib → lib}/yaml_wrapper.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/bullseye/bullseye.rake +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/bullseye/bullseye.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/bullseye/defaults.yml +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/bullseye/readme.txt +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/bullseye/template.erb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/gcov/defaults.yml +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/gcov/gcov.rake +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/gcov/gcov.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/gcov/readme.txt +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/gcov/template.erb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/module_generator/config/module_generator.yml +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/module_generator/lib/module_generator.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/module_generator/module_generator.rake +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/stdout_ide_tests_report/config/stdout_ide_tests_report.yml +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/stdout_ide_tests_report/lib/stdout_ide_tests_report.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/stdout_pretty_tests_report/assets/template.erb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/stdout_pretty_tests_report/config/stdout_pretty_tests_report.yml +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/stdout_pretty_tests_report/lib/stdout_pretty_tests_report.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/warnings_report/warnings_report.rb +0 -0
- data/{new_project_template/vendor/ceedling/plugins → plugins}/xml_tests_report/xml_tests_report.rb +0 -0
- data/rakefile.rb +14 -0
- data/release/build.info +2 -0
- data/{new_project_template/vendor/ceedling/release → release}/version.info +0 -0
- data/spec/configurator_builder_spec.rb +7 -0
- data/spec/configurator_helper_spec.rb +5 -0
- data/spec/configurator_spec.rb +10 -0
- data/spec/par_map_spec.rb +57 -0
- data/spec/preprocessinator_extractor_spec.rb +46 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/uncatagorized_specs_spec.rb +8 -0
- data/test_graveyard/integration/paths.yml +17 -0
- data/test_graveyard/integration/paths_test.rb +80 -0
- data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +75 -0
- data/test_graveyard/integration/rake_rules_cmock_test.rb +74 -0
- data/test_graveyard/integration/rake_rules_preprocess_test.rb +178 -0
- data/test_graveyard/integration/rake_rules_test.rb +268 -0
- data/test_graveyard/integration/rake_tasks_test.rb +103 -0
- data/test_graveyard/integration_test_helper.rb +34 -0
- data/test_graveyard/rakefile_rules.rb +10 -0
- data/test_graveyard/rakefile_rules_aux_dependencies.rb +10 -0
- data/test_graveyard/rakefile_rules_cmock.rb +10 -0
- data/test_graveyard/rakefile_rules_preprocess.rb +10 -0
- data/test_graveyard/rakefile_tasks.rb +10 -0
- data/test_graveyard/system/file_system_dependencies.yml +20 -0
- data/test_graveyard/system/file_system_kitchen_sink.yml +20 -0
- data/test_graveyard/system/file_system_mocks.yml +20 -0
- data/test_graveyard/system/file_system_preprocess.yml +20 -0
- data/test_graveyard/system/file_system_simple.yml +20 -0
- data/test_graveyard/system/file_system_test.rb +78 -0
- data/test_graveyard/system/mocks/include/a_file.h +2 -0
- data/test_graveyard/system/mocks/include/other_stuff.h +2 -0
- data/test_graveyard/system/mocks/include/stuff.h +3 -0
- data/test_graveyard/system/mocks/source/a_file.c +9 -0
- data/test_graveyard/system/mocks/test/test_a_file.c +41 -0
- data/test_graveyard/system/mocks/test/test_no_file.c +14 -0
- data/test_graveyard/system/project_mocks.yml +43 -0
- data/test_graveyard/system/project_mocks_test.rb +38 -0
- data/test_graveyard/system/project_simple.yml +36 -0
- data/test_graveyard/system/project_simple_test.rb +39 -0
- data/test_graveyard/system/rule_mocks_test.rb +44 -0
- data/test_graveyard/system/rule_runners_test.rb +44 -0
- data/test_graveyard/system/simple/include/other_stuff.h +2 -0
- data/test_graveyard/system/simple/include/stuff.h +3 -0
- data/test_graveyard/system/simple/source/other_stuff.c +6 -0
- data/test_graveyard/system/simple/source/stuff.c +7 -0
- data/test_graveyard/system/simple/test/test_other_stuff.c +30 -0
- data/test_graveyard/system/simple/test/test_stuff.c +51 -0
- data/test_graveyard/system_test_helper.rb +73 -0
- data/test_graveyard/test_helper.rb +93 -0
- data/test_graveyard/unit/busted/configurator_builder_test.rb +571 -0
- data/test_graveyard/unit/busted/configurator_helper_test.rb +234 -0
- data/test_graveyard/unit/busted/configurator_test.rb +232 -0
- data/test_graveyard/unit/busted/configurator_validator_test.rb +169 -0
- data/test_graveyard/unit/busted/deep_merge_fix_test.rb +55 -0
- data/test_graveyard/unit/busted/dependinator_test.rb +129 -0
- data/test_graveyard/unit/busted/file_finder_helper_test.rb +45 -0
- data/test_graveyard/unit/busted/file_finder_test.rb +114 -0
- data/test_graveyard/unit/busted/file_path_utils_test.rb +97 -0
- data/test_graveyard/unit/busted/file_system_utils_test.rb +21 -0
- data/test_graveyard/unit/busted/generator_test.rb +187 -0
- data/test_graveyard/unit/busted/generator_test_results_test.rb +129 -0
- data/test_graveyard/unit/busted/generator_test_runner_test.rb +478 -0
- data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +38 -0
- data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +156 -0
- data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +93 -0
- data/test_graveyard/unit/busted/preprocessinator_test.rb +57 -0
- data/test_graveyard/unit/busted/project_file_loader_test.rb +142 -0
- data/test_graveyard/unit/busted/setupinator_test.rb +45 -0
- data/test_graveyard/unit/busted/streaminator_test.rb +49 -0
- data/test_graveyard/unit/busted/task_invoker_test.rb +69 -0
- data/test_graveyard/unit/busted/test_includes_extractor_test.rb +111 -0
- data/test_graveyard/unit/busted/test_invoker_helper_test.rb +62 -0
- data/test_graveyard/unit/busted/test_invoker_test.rb +47 -0
- data/test_graveyard/unit/busted/tool_executor_helper_test.rb +100 -0
- data/test_graveyard/unit/busted/tool_executor_test.rb +351 -0
- data/test_graveyard/unit/busted/verbosinator_test.rb +65 -0
- data/test_graveyard/unit/preprocessinator_extractor_test.rb +731 -0
- data/test_graveyard/unit_test_helper.rb +16 -0
- data/vendor/behaviors/Manifest.txt +9 -0
- data/vendor/behaviors/Rakefile +19 -0
- data/vendor/behaviors/lib/behaviors.rb +76 -0
- data/vendor/behaviors/lib/behaviors/reporttask.rb +158 -0
- data/vendor/behaviors/test/behaviors_tasks_test.rb +73 -0
- data/vendor/behaviors/test/behaviors_test.rb +50 -0
- data/vendor/behaviors/test/tasks_test/Rakefile +19 -0
- data/vendor/behaviors/test/tasks_test/lib/user.rb +2 -0
- data/vendor/behaviors/test/tasks_test/test/user_test.rb +17 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/c_exception/lib/CException.c +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/c_exception/lib/CException.h +1 -1
- data/vendor/c_exception/release/build.info +2 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/c_exception/release/version.info +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/config/production_environment.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/config/test_environment.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_config.rb +3 -3
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_file_writer.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator_plugin_array.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator_plugin_callback.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator_plugin_cexception.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator_plugin_expect.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator_plugin_ignore.rb +14 -4
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_generator_utils.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_header_parser.rb +9 -5
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_plugin_manager.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/lib/cmock_unityhelper_parser.rb +75 -74
- data/vendor/cmock/release/build.info +2 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/release/version.info +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/src/cmock.c +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/cmock/src/cmock.h +0 -0
- data/vendor/constructor/History.rdoc +19 -0
- data/vendor/constructor/README.rdoc +72 -0
- data/vendor/constructor/Rakefile +33 -0
- data/vendor/constructor/homepage/Notes.txt +27 -0
- data/vendor/constructor/homepage/Rakefile +15 -0
- data/vendor/constructor/homepage/index.erb +27 -0
- data/vendor/constructor/homepage/index.html +36 -0
- data/vendor/constructor/homepage/page_header.graffle +0 -0
- data/vendor/constructor/homepage/page_header.html +9 -0
- data/vendor/constructor/homepage/page_header.png +0 -0
- data/vendor/constructor/homepage/sample_code.png +0 -0
- data/vendor/constructor/homepage/sample_code.rb +12 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/constructor/lib/constructor.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/constructor/lib/constructor_struct.rb +0 -0
- data/vendor/constructor/specs/constructor_spec.rb +407 -0
- data/vendor/constructor/specs/constructor_struct_spec.rb +84 -0
- data/vendor/deep_merge/MIT-LICENSE +20 -0
- data/vendor/deep_merge/README +94 -0
- data/vendor/deep_merge/Rakefile +28 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/deep_merge/lib/deep_merge.rb +0 -0
- data/vendor/deep_merge/pkg/deep_merge-0.1.0.gem +0 -0
- data/vendor/deep_merge/test/test_deep_merge.rb +553 -0
- data/vendor/diy/History.txt +28 -0
- data/vendor/diy/README.rdoc +233 -0
- data/vendor/diy/Rakefile +33 -0
- data/vendor/diy/TODO.txt +9 -0
- data/vendor/diy/diy.gemspec +131 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/diy/lib/diy.rb +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/diy/lib/diy/factory.rb +0 -0
- data/vendor/diy/sample_code/car.rb +7 -0
- data/vendor/diy/sample_code/chassis.rb +5 -0
- data/vendor/diy/sample_code/diy_example.rb +26 -0
- data/vendor/diy/sample_code/engine.rb +5 -0
- data/vendor/diy/sample_code/objects.yml +10 -0
- data/vendor/diy/test/constructor.rb +119 -0
- data/vendor/diy/test/diy_test.rb +608 -0
- data/vendor/diy/test/factory_test.rb +79 -0
- data/vendor/diy/test/files/broken_construction.yml +7 -0
- data/vendor/diy/test/files/cat/cat.rb +3 -0
- data/vendor/diy/test/files/cat/extra_conflict.yml +5 -0
- data/vendor/diy/test/files/cat/heritage.rb +2 -0
- data/vendor/diy/test/files/cat/needs_input.yml +3 -0
- data/vendor/diy/test/files/cat/the_cat_lineage.rb +1 -0
- data/vendor/diy/test/files/dog/dog_model.rb +3 -0
- data/vendor/diy/test/files/dog/dog_presenter.rb +3 -0
- data/vendor/diy/test/files/dog/dog_view.rb +2 -0
- data/vendor/diy/test/files/dog/file_resolver.rb +2 -0
- data/vendor/diy/test/files/dog/other_thing.rb +2 -0
- data/vendor/diy/test/files/dog/simple.yml +11 -0
- data/vendor/diy/test/files/donkey/foo.rb +8 -0
- data/vendor/diy/test/files/donkey/foo/bar/qux.rb +7 -0
- data/vendor/diy/test/files/factory/beef.rb +5 -0
- data/vendor/diy/test/files/factory/dog.rb +6 -0
- data/vendor/diy/test/files/factory/factory.yml +19 -0
- data/vendor/diy/test/files/factory/farm/llama.rb +7 -0
- data/vendor/diy/test/files/factory/farm/pork.rb +7 -0
- data/vendor/diy/test/files/factory/kitten.rb +13 -0
- data/vendor/diy/test/files/fud/objects.yml +13 -0
- data/vendor/diy/test/files/fud/toy.rb +14 -0
- data/vendor/diy/test/files/functions/attached_things_builder.rb +2 -0
- data/vendor/diy/test/files/functions/invalid_method.yml +5 -0
- data/vendor/diy/test/files/functions/method_extractor.rb +3 -0
- data/vendor/diy/test/files/functions/nonsingleton_objects.yml +6 -0
- data/vendor/diy/test/files/functions/objects.yml +22 -0
- data/vendor/diy/test/files/functions/thing.rb +3 -0
- data/vendor/diy/test/files/functions/thing_builder.rb +25 -0
- data/vendor/diy/test/files/functions/things_builder.rb +3 -0
- data/vendor/diy/test/files/gnu/objects.yml +14 -0
- data/vendor/diy/test/files/gnu/thinger.rb +7 -0
- data/vendor/diy/test/files/goat/base.rb +8 -0
- data/vendor/diy/test/files/goat/can.rb +6 -0
- data/vendor/diy/test/files/goat/goat.rb +6 -0
- data/vendor/diy/test/files/goat/objects.yml +12 -0
- data/vendor/diy/test/files/goat/paper.rb +6 -0
- data/vendor/diy/test/files/goat/plane.rb +7 -0
- data/vendor/diy/test/files/goat/shirt.rb +6 -0
- data/vendor/diy/test/files/goat/wings.rb +8 -0
- data/vendor/diy/test/files/horse/holder_thing.rb +3 -0
- data/vendor/diy/test/files/horse/objects.yml +7 -0
- data/vendor/diy/test/files/namespace/animal/bird.rb +5 -0
- data/vendor/diy/test/files/namespace/animal/cat.rb +5 -0
- data/vendor/diy/test/files/namespace/animal/reptile/hardshell/turtle.rb +8 -0
- data/vendor/diy/test/files/namespace/animal/reptile/lizard.rb +7 -0
- data/vendor/diy/test/files/namespace/bad_module_specified.yml +8 -0
- data/vendor/diy/test/files/namespace/class_name_combine.yml +8 -0
- data/vendor/diy/test/files/namespace/hello.txt +1 -0
- data/vendor/diy/test/files/namespace/no_module_specified.yml +8 -0
- data/vendor/diy/test/files/namespace/objects.yml +21 -0
- data/vendor/diy/test/files/namespace/road.rb +2 -0
- data/vendor/diy/test/files/namespace/sky.rb +2 -0
- data/vendor/diy/test/files/namespace/subcontext.yml +22 -0
- data/vendor/diy/test/files/non_singleton/air.rb +2 -0
- data/vendor/diy/test/files/non_singleton/fat_cat.rb +3 -0
- data/vendor/diy/test/files/non_singleton/objects.yml +19 -0
- data/vendor/diy/test/files/non_singleton/pig.rb +3 -0
- data/vendor/diy/test/files/non_singleton/thread_spinner.rb +3 -0
- data/vendor/diy/test/files/non_singleton/tick.rb +3 -0
- data/vendor/diy/test/files/non_singleton/yard.rb +2 -0
- data/vendor/diy/test/files/yak/core_model.rb +3 -0
- data/vendor/diy/test/files/yak/core_presenter.rb +3 -0
- data/vendor/diy/test/files/yak/core_view.rb +1 -0
- data/vendor/diy/test/files/yak/data_source.rb +1 -0
- data/vendor/diy/test/files/yak/fringe_model.rb +3 -0
- data/vendor/diy/test/files/yak/fringe_presenter.rb +3 -0
- data/vendor/diy/test/files/yak/fringe_view.rb +1 -0
- data/vendor/diy/test/files/yak/giant_squid.rb +3 -0
- data/vendor/diy/test/files/yak/krill.rb +2 -0
- data/vendor/diy/test/files/yak/my_objects.yml +21 -0
- data/vendor/diy/test/files/yak/sub_sub_context_test.yml +27 -0
- data/vendor/diy/test/test_helper.rb +55 -0
- data/vendor/hardmock/CHANGES +78 -0
- data/vendor/hardmock/LICENSE +7 -0
- data/vendor/hardmock/README +70 -0
- data/vendor/hardmock/Rakefile +8 -0
- data/vendor/hardmock/config/environment.rb +12 -0
- data/vendor/hardmock/lib/assert_error.rb +23 -0
- data/vendor/hardmock/lib/extend_test_unit.rb +14 -0
- data/vendor/hardmock/lib/hardmock.rb +86 -0
- data/vendor/hardmock/lib/hardmock/errors.rb +22 -0
- data/vendor/hardmock/lib/hardmock/expectation.rb +229 -0
- data/vendor/hardmock/lib/hardmock/expectation_builder.rb +9 -0
- data/vendor/hardmock/lib/hardmock/expector.rb +26 -0
- data/vendor/hardmock/lib/hardmock/method_cleanout.rb +33 -0
- data/vendor/hardmock/lib/hardmock/mock.rb +180 -0
- data/vendor/hardmock/lib/hardmock/mock_control.rb +53 -0
- data/vendor/hardmock/lib/hardmock/stubbing.rb +210 -0
- data/vendor/hardmock/lib/hardmock/trapper.rb +31 -0
- data/vendor/hardmock/lib/hardmock/utils.rb +9 -0
- data/vendor/hardmock/lib/test_unit_before_after.rb +169 -0
- data/vendor/hardmock/rake_tasks/rdoc.rake +19 -0
- data/vendor/hardmock/rake_tasks/rdoc_options.rb +4 -0
- data/vendor/hardmock/rake_tasks/test.rake +22 -0
- data/vendor/hardmock/test/functional/assert_error_test.rb +52 -0
- data/vendor/hardmock/test/functional/auto_verify_test.rb +178 -0
- data/vendor/hardmock/test/functional/direct_mock_usage_test.rb +396 -0
- data/vendor/hardmock/test/functional/hardmock_test.rb +434 -0
- data/vendor/hardmock/test/functional/stubbing_test.rb +479 -0
- data/vendor/hardmock/test/test_helper.rb +43 -0
- data/vendor/hardmock/test/unit/expectation_builder_test.rb +19 -0
- data/vendor/hardmock/test/unit/expectation_test.rb +372 -0
- data/vendor/hardmock/test/unit/expector_test.rb +57 -0
- data/vendor/hardmock/test/unit/method_cleanout_test.rb +36 -0
- data/vendor/hardmock/test/unit/mock_control_test.rb +175 -0
- data/vendor/hardmock/test/unit/mock_test.rb +279 -0
- data/vendor/hardmock/test/unit/test_unit_before_after_test.rb +452 -0
- data/vendor/hardmock/test/unit/trapper_test.rb +62 -0
- data/vendor/hardmock/test/unit/verify_error_test.rb +40 -0
- data/vendor/unity/auto/colour_prompt.rb +94 -0
- data/vendor/unity/auto/colour_reporter.rb +39 -0
- data/vendor/unity/auto/generate_module.rb +202 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/unity/auto/generate_test_runner.rb +0 -0
- data/vendor/unity/auto/test_file_filter.rb +23 -0
- data/vendor/unity/auto/unity_test_summary.rb +139 -0
- data/vendor/unity/release/build.info +2 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/unity/release/version.info +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/unity/src/unity.c +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/unity/src/unity.h +0 -0
- data/{new_project_template/vendor/ceedling/vendor → vendor}/unity/src/unity_internals.h +94 -6
- metadata +443 -237
- data/.vim +0 -1
- data/.yardopts +0 -1
- data/LICENSE +0 -19
- data/Rakefile +0 -118
- data/ceedling-gem.sublime-project +0 -8
- data/examples/blinky/.DS_Store +0 -0
- data/examples/temp_sensor/src/AT91SAM7X256.h +0 -2556
- data/examples/temp_sensor/src/UsartGetChar.c +0 -6
- data/examples/temp_sensor/src/UsartGetChar.h +0 -8
- data/examples/temp_sensor/test/test_AdcHardwareConfigurator.c +0 -43
- data/examples/temp_sensor/test/test_AdcTemperatureSensor.c +0 -47
- data/examples/temp_sensor/test/test_TimerConfigurator.c +0 -112
- data/examples/temp_sensor/test/test_TimerInterruptConfigurator.c +0 -78
- data/examples/temp_sensor/test/test_TimerInterruptHandler.c +0 -66
- data/examples/temp_sensor/test/test_UsartConfigurator.c +0 -77
- data/examples/temp_sensor/test/test_UsartGetChar.c +0 -17
- data/examples/temp_sensor/test/test_UsartPutChar.c +0 -43
- data/examples/temp_sensor/test/test_UsartTransmitBufferStatus.c +0 -22
- data/new_project_template/build/.gitkeep +0 -0
- data/new_project_template/src/.gitkeep +0 -0
- data/new_project_template/test/.gitkeep +0 -0
- data/new_project_template/test/support/.gitkeep +0 -0
- data/new_project_template/vendor/ceedling/docs/CExceptionSummary.pdf +0 -0
- data/new_project_template/vendor/ceedling/docs/CMock Summary.pdf +0 -0
- data/new_project_template/vendor/ceedling/docs/Ceedling Packet.pdf +0 -0
- data/new_project_template/vendor/ceedling/docs/Unity Summary.pdf +0 -0
- data/new_project_template/vendor/ceedling/lib/preprocessinator_extractor.rb +0 -36
- data/new_project_template/vendor/ceedling/release/build.info +0 -1
- data/new_project_template/vendor/ceedling/vendor/c_exception/release/build.info +0 -1
- data/new_project_template/vendor/ceedling/vendor/cmock/release/build.info +0 -1
- data/new_project_template/vendor/ceedling/vendor/unity/release/build.info +0 -1
@@ -0,0 +1,234 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../unit_test_helper'
|
2
|
+
require 'configurator_helper'
|
3
|
+
|
4
|
+
|
5
|
+
class ConfiguratorHelperTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
objects = create_mocks(:configurator_validator, :system_wrapper)
|
9
|
+
@helper = ConfiguratorHelper.new(objects)
|
10
|
+
|
11
|
+
@test_config = {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def teardown
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
should "do nothing if no 'environment' entry in the yaml config" do
|
19
|
+
@helper.set_environment_variables(@test_config)
|
20
|
+
end
|
21
|
+
|
22
|
+
should "set environment variables from yaml config" do
|
23
|
+
@test_config[:environment] = {
|
24
|
+
:cov_file => 'project/artifacts/test.cov',
|
25
|
+
:TEST_NUMBER => 101,
|
26
|
+
:environment_var => -2
|
27
|
+
}
|
28
|
+
|
29
|
+
@system_wrapper.expects.env_set('TEST_NUMBER', '101')
|
30
|
+
@system_wrapper.expects.env_set('COV_FILE', 'project/artifacts/test.cov')
|
31
|
+
@system_wrapper.expects.env_set('ENVIRONMENT_VAR', '-2')
|
32
|
+
|
33
|
+
@helper.set_environment_variables(@test_config)
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
should "return true when all top-level configuration entries are present" do
|
38
|
+
@configurator_validator.expects.exists?(@test_config, :project).returns(true)
|
39
|
+
@configurator_validator.expects.exists?(@test_config, :paths).returns(true)
|
40
|
+
@configurator_validator.expects.exists?(@test_config, :tools).returns(true)
|
41
|
+
|
42
|
+
assert(@helper.validate_required_sections(@test_config))
|
43
|
+
end
|
44
|
+
|
45
|
+
should "fail if any top-level configuration entries are missing" do
|
46
|
+
|
47
|
+
@configurator_validator.expects.exists?(@test_config, :project).returns(false)
|
48
|
+
@configurator_validator.expects.exists?(@test_config, :paths).returns(true)
|
49
|
+
@configurator_validator.expects.exists?(@test_config, :tools).returns(true)
|
50
|
+
|
51
|
+
assert_equal(false, @helper.validate_required_sections(@test_config))
|
52
|
+
|
53
|
+
@configurator_validator.expects.exists?(@test_config, :project).returns(true)
|
54
|
+
@configurator_validator.expects.exists?(@test_config, :paths).returns(false)
|
55
|
+
@configurator_validator.expects.exists?(@test_config, :tools).returns(true)
|
56
|
+
|
57
|
+
assert_equal(false, @helper.validate_required_sections(@test_config))
|
58
|
+
|
59
|
+
@configurator_validator.expects.exists?(@test_config, :project).returns(true)
|
60
|
+
@configurator_validator.expects.exists?(@test_config, :paths).returns(true)
|
61
|
+
@configurator_validator.expects.exists?(@test_config, :tools).returns(false)
|
62
|
+
|
63
|
+
assert_equal(false, @helper.validate_required_sections(@test_config))
|
64
|
+
|
65
|
+
@configurator_validator.expects.exists?(@test_config, :project).returns(false)
|
66
|
+
@configurator_validator.expects.exists?(@test_config, :paths).returns(true)
|
67
|
+
@configurator_validator.expects.exists?(@test_config, :tools).returns(false)
|
68
|
+
|
69
|
+
assert_equal(false, @helper.validate_required_sections(@test_config))
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
should "return true when all required section values are present" do
|
74
|
+
@configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(true)
|
75
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :test).returns(true)
|
76
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :source).returns(true)
|
77
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
|
78
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(true)
|
79
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(true)
|
80
|
+
|
81
|
+
assert(@helper.validate_required_section_values(@test_config))
|
82
|
+
end
|
83
|
+
|
84
|
+
should "fail when any required section value is missing" do
|
85
|
+
@configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(true)
|
86
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :test).returns(false)
|
87
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :source).returns(true)
|
88
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
|
89
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(true)
|
90
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(true)
|
91
|
+
|
92
|
+
assert_equal(false, @helper.validate_required_section_values(@test_config))
|
93
|
+
|
94
|
+
@configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(false)
|
95
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :test).returns(true)
|
96
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :source).returns(true)
|
97
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
|
98
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(true)
|
99
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(true)
|
100
|
+
|
101
|
+
assert_equal(false, @helper.validate_required_section_values(@test_config))
|
102
|
+
|
103
|
+
@configurator_validator.expects.exists?(@test_config, :project, :build_root).returns(true)
|
104
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :test).returns(true)
|
105
|
+
@configurator_validator.expects.exists?(@test_config, :paths, :source).returns(false)
|
106
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_compiler).returns(true)
|
107
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_linker).returns(false)
|
108
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :test_fixture).returns(false)
|
109
|
+
|
110
|
+
assert_equal(false, @helper.validate_required_section_values(@test_config))
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
should "fail if any paths in the configuration fail validation" do
|
115
|
+
# note: source iterates through hash keys in string class's <=> order
|
116
|
+
@test_config[:paths] = {:paths1 => [], :paths2 => [], :paths3 => []}
|
117
|
+
@test_config[:plugins] = {:base_path => 'plugins', :enabled => ['boo', 'berry']}
|
118
|
+
|
119
|
+
@configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
|
120
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
|
121
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(false)
|
122
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
|
123
|
+
@configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
|
124
|
+
@configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
|
125
|
+
@configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
|
126
|
+
|
127
|
+
assert_equal(false, @helper.validate_path_list(@test_config))
|
128
|
+
|
129
|
+
@configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(false)
|
130
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
|
131
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
|
132
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
|
133
|
+
@configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
|
134
|
+
@configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
|
135
|
+
@configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
|
136
|
+
|
137
|
+
assert_equal(false, @helper.validate_path_list(@test_config))
|
138
|
+
|
139
|
+
@configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
|
140
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(false)
|
141
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
|
142
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(false)
|
143
|
+
@configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
|
144
|
+
@configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
|
145
|
+
@configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
|
146
|
+
|
147
|
+
assert_equal(false, @helper.validate_path_list(@test_config))
|
148
|
+
|
149
|
+
@configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
|
150
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
|
151
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
|
152
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
|
153
|
+
@configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(false)
|
154
|
+
@configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
|
155
|
+
@configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
|
156
|
+
|
157
|
+
assert_equal(false, @helper.validate_path_list(@test_config))
|
158
|
+
|
159
|
+
@configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
|
160
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
|
161
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
|
162
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
|
163
|
+
@configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
|
164
|
+
@configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
|
165
|
+
@configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(false)
|
166
|
+
|
167
|
+
assert_equal(false, @helper.validate_path_list(@test_config))
|
168
|
+
end
|
169
|
+
|
170
|
+
should "successfully validate all paths in the configuration" do
|
171
|
+
# note: source iterates through hash keys in string class's <=> order
|
172
|
+
@test_config[:paths] = {:paths1 => [], :paths2 => [], :paths3 => []}
|
173
|
+
@test_config[:plugins] = {:base_path => 'plugins', :enabled => ['boo', 'berry']}
|
174
|
+
|
175
|
+
@configurator_validator.expects.validate_path_list(@test_config, :project, :build_root).returns(true)
|
176
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths1).returns(true)
|
177
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths2).returns(true)
|
178
|
+
@configurator_validator.expects.validate_path_list(@test_config, :paths, :paths3).returns(true)
|
179
|
+
|
180
|
+
@configurator_validator.expects.validate_path('plugins', :plugins, :base_path).returns(true)
|
181
|
+
@configurator_validator.expects.validate_path('plugins/berry', :plugins, :enabled, :berry).returns(true)
|
182
|
+
@configurator_validator.expects.validate_path('plugins/boo', :plugins, :enabled, :boo).returns(true)
|
183
|
+
|
184
|
+
assert(@helper.validate_path_list(@test_config))
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
should "fail if any tools in the configuration fail validation" do
|
189
|
+
# note: source iterates through hash keys in string class's <=> order
|
190
|
+
@test_config[:tools] = {:circular_saw => {}, :compiler => {}, :report_generator => {}}
|
191
|
+
|
192
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(true)
|
193
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(true)
|
194
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(true)
|
195
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(false)
|
196
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(true)
|
197
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(true)
|
198
|
+
|
199
|
+
assert_equal(false, @helper.validate_tools(@test_config))
|
200
|
+
|
201
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(false)
|
202
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(true)
|
203
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(false)
|
204
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(true)
|
205
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(true)
|
206
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(true)
|
207
|
+
|
208
|
+
assert_equal(false, @helper.validate_tools(@test_config))
|
209
|
+
|
210
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(false)
|
211
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(false)
|
212
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(true)
|
213
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(true)
|
214
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(false)
|
215
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(false)
|
216
|
+
|
217
|
+
assert_equal(false, @helper.validate_tools(@test_config))
|
218
|
+
end
|
219
|
+
|
220
|
+
should "successfully validate tools in the configuration=" do
|
221
|
+
# note: source iterates through hash keys in string class's <=> order
|
222
|
+
@test_config[:tools] = {:circular_saw => {}, :compiler => {}, :report_generator => {}}
|
223
|
+
|
224
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :circular_saw, :executable).returns(true)
|
225
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :circular_saw, :executable).returns(true)
|
226
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :compiler, :executable).returns(true)
|
227
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :compiler, :executable).returns(true)
|
228
|
+
@configurator_validator.expects.exists?(@test_config, :tools, :report_generator, :executable).returns(true)
|
229
|
+
@configurator_validator.expects.validate_filepath(@test_config, :tools, :report_generator, :executable).returns(true)
|
230
|
+
|
231
|
+
assert(@helper.validate_tools(@test_config))
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -0,0 +1,232 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../unit_test_helper'
|
2
|
+
require 'configurator'
|
3
|
+
|
4
|
+
|
5
|
+
class ConfiguratorTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
objects = create_mocks(:configurator_helper, :configurator_builder, :configurator_plugins, :yaml_wrapper)
|
9
|
+
create_mocks(:test_hash)
|
10
|
+
@configurator = Configurator.new(objects)
|
11
|
+
|
12
|
+
@test_config = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def teardown
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
############# verbosity ##############
|
20
|
+
|
21
|
+
should "set project config and cmock config verbosity levels" do
|
22
|
+
assert_nil(@configurator.project_config_hash[:project_verbosity])
|
23
|
+
assert_nil(@configurator.cmock_config_hash[:verbosity])
|
24
|
+
|
25
|
+
@configurator.set_verbosity(5)
|
26
|
+
|
27
|
+
assert_equal(5, @configurator.project_config_hash[:project_verbosity])
|
28
|
+
assert_equal(5, @configurator.cmock_config_hash[:verbosity])
|
29
|
+
end
|
30
|
+
|
31
|
+
############# standardize paths #############
|
32
|
+
|
33
|
+
should "standardize all paths" do
|
34
|
+
in_hash = {
|
35
|
+
:project => {:build_root => "files\\dir\\dir/"},
|
36
|
+
:paths => {
|
37
|
+
:yellow_brick => ["root\\subdir\\dir\\", "files/modules/tests", "source\\modules"],
|
38
|
+
:destruction => ["stuff/"]
|
39
|
+
},
|
40
|
+
:tools => {
|
41
|
+
:hammer => {:executable => "gcc"},
|
42
|
+
:ratchet => {:executable => "\\bin\\cpp"}
|
43
|
+
},
|
44
|
+
:plugins => {:base_path => "project\\plugins"}
|
45
|
+
}
|
46
|
+
|
47
|
+
@configurator.standardize_paths(in_hash)
|
48
|
+
|
49
|
+
assert_equal('files/dir/dir', in_hash[:project][:build_root])
|
50
|
+
|
51
|
+
assert_equal(["root/subdir/dir", "files/modules/tests", "source/modules"], in_hash[:paths][:yellow_brick])
|
52
|
+
assert_equal(["stuff"], in_hash[:paths][:destruction])
|
53
|
+
|
54
|
+
assert_equal('gcc', in_hash[:tools][:hammer][:executable])
|
55
|
+
assert_equal('/bin/cpp', in_hash[:tools][:ratchet][:executable])
|
56
|
+
|
57
|
+
assert_equal('project/plugins', in_hash[:plugins][:base_path])
|
58
|
+
end
|
59
|
+
|
60
|
+
############# validate ##############
|
61
|
+
|
62
|
+
should "successfully validate configuration" do
|
63
|
+
@configurator_helper.expects.validate_required_sections(@test_config).returns(true)
|
64
|
+
@configurator_helper.expects.validate_required_section_values(@test_config).returns(true)
|
65
|
+
@configurator_helper.expects.validate_paths(@test_config).returns(true)
|
66
|
+
@configurator_helper.expects.validate_tools(@test_config).returns(true)
|
67
|
+
|
68
|
+
@configurator.validate(@test_config)
|
69
|
+
end
|
70
|
+
|
71
|
+
should "immediately raise if top-level configuration entries are missing" do
|
72
|
+
@configurator_helper.expects.validate_required_sections(@test_config).returns(false)
|
73
|
+
assert_raise(RuntimeError) { @configurator.validate(@test_config) }
|
74
|
+
end
|
75
|
+
|
76
|
+
should "validate everything and complain about section values" do
|
77
|
+
@configurator_helper.expects.validate_required_sections(@test_config).returns(true)
|
78
|
+
@configurator_helper.expects.validate_required_section_values(@test_config).returns(false)
|
79
|
+
@configurator_helper.expects.validate_paths(@test_config).returns(true)
|
80
|
+
@configurator_helper.expects.validate_tools(@test_config).returns(true)
|
81
|
+
|
82
|
+
assert_raise(RuntimeError) { @configurator.validate(@test_config) }
|
83
|
+
end
|
84
|
+
|
85
|
+
should "validate everything and complain about paths" do
|
86
|
+
@configurator_helper.expects.validate_required_sections(@test_config).returns(true)
|
87
|
+
@configurator_helper.expects.validate_required_section_values(@test_config).returns(true)
|
88
|
+
@configurator_helper.expects.validate_paths(@test_config).returns(false)
|
89
|
+
@configurator_helper.expects.validate_tools(@test_config).returns(true)
|
90
|
+
|
91
|
+
assert_raise(RuntimeError) { @configurator.validate(@test_config) }
|
92
|
+
end
|
93
|
+
|
94
|
+
should "validate everything and complain about tools" do
|
95
|
+
@configurator_helper.expects.validate_required_sections(@test_config).returns(true)
|
96
|
+
@configurator_helper.expects.validate_required_section_values(@test_config).returns(true)
|
97
|
+
@configurator_helper.expects.validate_paths(@test_config).returns(true)
|
98
|
+
@configurator_helper.expects.validate_tools(@test_config).returns(false)
|
99
|
+
|
100
|
+
assert_raise(RuntimeError) { @configurator.validate(@test_config) }
|
101
|
+
end
|
102
|
+
|
103
|
+
############# insert cmock defaults ##############
|
104
|
+
|
105
|
+
should "insert into provided config hash necessary default cmock settings" do
|
106
|
+
config = { # no :cmock parent
|
107
|
+
:project => {
|
108
|
+
:build_root => 'project/build',
|
109
|
+
:verbosity => 10
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
expected = {
|
114
|
+
:project => {
|
115
|
+
:build_root => 'project/build',
|
116
|
+
:verbosity => 10
|
117
|
+
},
|
118
|
+
:cmock => {
|
119
|
+
:mock_prefix => 'Mock',
|
120
|
+
:mock_path => 'project/build/tests/mocks',
|
121
|
+
:enforce_strict_ordering => true,
|
122
|
+
:verbosity => 10,
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
@configurator.populate_cmock_defaults(config)
|
127
|
+
|
128
|
+
assert_equal(expected, config)
|
129
|
+
end
|
130
|
+
|
131
|
+
should "not override cmock settings already in configuration hash" do
|
132
|
+
config = {
|
133
|
+
:project => {
|
134
|
+
:verbosity => 0
|
135
|
+
},
|
136
|
+
:cmock => {
|
137
|
+
:mock_prefix => 'mock_',
|
138
|
+
:mock_path => 'foo/bar/mocks',
|
139
|
+
:enforce_strict_ordering => false,
|
140
|
+
:verbosity => 3,
|
141
|
+
}
|
142
|
+
}
|
143
|
+
|
144
|
+
expected = config.clone
|
145
|
+
|
146
|
+
@configurator.populate_cmock_defaults(config)
|
147
|
+
|
148
|
+
assert_equal(expected, config)
|
149
|
+
end
|
150
|
+
|
151
|
+
|
152
|
+
############# build configuration ##############
|
153
|
+
|
154
|
+
should "build up configuration and constantize and create accessor methods from it" do
|
155
|
+
# prep before hashification
|
156
|
+
@configurator_builder.expects.populate_tool_names(@test_config)
|
157
|
+
|
158
|
+
# set environment variables
|
159
|
+
@configurator_helper.expects.set_environment_variables(@test_config)
|
160
|
+
|
161
|
+
# flattenify the config object
|
162
|
+
@configurator_builder.expects.flattenify(@test_config).returns(@test_hash)
|
163
|
+
|
164
|
+
# insert info into configuration
|
165
|
+
@configurator_builder.expects.populate_defaults(@test_hash).returns(@test_hash)
|
166
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
167
|
+
|
168
|
+
# do some housekeeping
|
169
|
+
@configurator_builder.expects.clean(@test_hash)
|
170
|
+
|
171
|
+
# build up configuration
|
172
|
+
@configurator_builder.expects.set_build_paths(@test_hash).returns(@test_hash)
|
173
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
174
|
+
|
175
|
+
# build up configuration
|
176
|
+
@configurator_builder.expects.set_rakefile_components(@test_hash).returns(@test_hash)
|
177
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
178
|
+
|
179
|
+
# build up configuration
|
180
|
+
@configurator_builder.expects.collect_test_and_source_include_paths(@test_hash).returns(@test_hash)
|
181
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
182
|
+
|
183
|
+
# build up configuration
|
184
|
+
@configurator_builder.expects.collect_test_and_source_paths(@test_hash).returns(@test_hash)
|
185
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
186
|
+
|
187
|
+
# build up configuration
|
188
|
+
@configurator_builder.expects.collect_tests(@test_hash).returns(@test_hash)
|
189
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
190
|
+
|
191
|
+
# build up configuration
|
192
|
+
@configurator_builder.expects.collect_source(@test_hash).returns(@test_hash)
|
193
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
194
|
+
|
195
|
+
# build up configuration
|
196
|
+
@configurator_builder.expects.collect_headers(@test_hash).returns(@test_hash)
|
197
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
198
|
+
|
199
|
+
# build up configuration
|
200
|
+
@configurator_builder.expects.collect_all_compilation_input(@test_hash).returns(@test_hash)
|
201
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
202
|
+
|
203
|
+
# build up configuration
|
204
|
+
@configurator_builder.expects.collect_test_defines(@test_hash).returns(@test_hash)
|
205
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
206
|
+
|
207
|
+
# build up configuration
|
208
|
+
@configurator_builder.expects.collect_code_generation_dependencies.returns(@test_hash)
|
209
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
210
|
+
|
211
|
+
# expand paths
|
212
|
+
@configurator_builder.expects.expand_all_path_globs(@test_hash).returns(@test_hash)
|
213
|
+
@test_hash.expects.merge!(@test_hash).returns(@test_hash)
|
214
|
+
|
215
|
+
# provide mock hash with some keys and values to constantize & add accessor methods to configurator
|
216
|
+
@test_hash.expects.each_pair.yields([:test_key_1, 'test_val1'], [:test_key_2, ['foo', 'bar']])
|
217
|
+
@test_hash.expects(:[], :test_key_1).returns('test_val1')
|
218
|
+
@test_hash.expects(:[], :test_key_2).returns(['foo', 'bar'])
|
219
|
+
|
220
|
+
assert_nil(defined?(TEST_KEY_1))
|
221
|
+
assert_nil(defined?(TEST_KEY_2))
|
222
|
+
|
223
|
+
@configurator.build(@test_config)
|
224
|
+
|
225
|
+
assert_equal('test_val1', TEST_KEY_1)
|
226
|
+
assert_equal('test_val1', @configurator.test_key_1)
|
227
|
+
|
228
|
+
assert_equal(['foo', 'bar'], TEST_KEY_2)
|
229
|
+
assert_equal(['foo', 'bar'], @configurator.test_key_2)
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|