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,44 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../system_test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
class MocksRuleTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@header_file = "a_file.h"
|
8
|
+
@mock_file = "mock_a_file.c"
|
9
|
+
@header_filepath = "#{SYSTEM_TEST_ROOT}/mocks/include/#{@header_file}"
|
10
|
+
@mock_filepath = "#{SYSTEM_TEST_ROOT}/mocks/build/tests/mocks/#{@mock_file}"
|
11
|
+
|
12
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'] = File.join(SYSTEM_TEST_ROOT, 'project_mocks.yml')
|
13
|
+
|
14
|
+
ceedling_execute('directories', 'clobber')
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
should "generate a mock from a source header file and regenerate when its dependent source changes" do
|
22
|
+
rake_exec_matcher = /^\*\* Execute.+#{Regexp.escape(@mock_file)}$/
|
23
|
+
|
24
|
+
# verify clobber did its job
|
25
|
+
assert_equal(false, File.exists?(@mock_filepath))
|
26
|
+
|
27
|
+
# give rake a task to generate a mock file & verify its presence
|
28
|
+
ceedling_execute(@mock_filepath)
|
29
|
+
assert_equal(true, File.exists?(@mock_filepath), 'mock file not created')
|
30
|
+
|
31
|
+
# verify executing rule again will not regenerate mock
|
32
|
+
output = ceedling_execute_dry_run(@mock_filepath)
|
33
|
+
assert_no_match(rake_exec_matcher, output, 'mock file should not be slated for generation')
|
34
|
+
|
35
|
+
# wait a spell to update file timestamp, ensuring time change is recognizable
|
36
|
+
sleep(1)
|
37
|
+
FileUtils.touch(@header_filepath)
|
38
|
+
|
39
|
+
# verify executing rule again will regenerate mock
|
40
|
+
output = ceedling_execute_dry_run(@mock_filepath)
|
41
|
+
assert_match(rake_exec_matcher, output, 'mock file should be slated for generation')
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../system_test_helper'
|
2
|
+
|
3
|
+
|
4
|
+
class RunnersRuleTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@test_file = 'test_stuff.c'
|
8
|
+
@runner_file = 'test_stuff_runner.c'
|
9
|
+
@test_filepath = "#{SYSTEM_TEST_ROOT}/simple/test/#{@test_file}"
|
10
|
+
@runner_filepath = "#{SYSTEM_TEST_ROOT}/simple/build/tests/runners/#{@runner_file}"
|
11
|
+
|
12
|
+
ENV['CEEDLING_MAIN_PROJECT_FILE'] = File.join(SYSTEM_TEST_ROOT, 'project_simple.yml')
|
13
|
+
|
14
|
+
ceedling_execute('directories', 'clobber')
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
should "generate a test runner from a test source header file and regenerate when its dependent source changes" do
|
22
|
+
rake_exec_matcher = /^\*\* Execute.+#{Regexp.escape(@runner_file)}$/
|
23
|
+
|
24
|
+
# verify clobber did its job
|
25
|
+
assert_equal(false, File.exists?(@runner_filepath))
|
26
|
+
|
27
|
+
# give rake a task to generate a test runner file & verify its presence
|
28
|
+
ceedling_execute(@runner_filepath)
|
29
|
+
assert_equal(true, File.exists?(@runner_filepath), 'test runner file not created')
|
30
|
+
|
31
|
+
# verify executing rule again will not regenerate runner
|
32
|
+
output = ceedling_execute_dry_run(@runner_filepath)
|
33
|
+
assert_no_match(rake_exec_matcher, output, 'test runner file should not be slated for generation')
|
34
|
+
|
35
|
+
# wait a spell to update file timestamp, ensuring time change is recognizable
|
36
|
+
sleep(1)
|
37
|
+
FileUtils.touch(@test_filepath)
|
38
|
+
|
39
|
+
# verify executing rule again will regenerate runner
|
40
|
+
output = ceedling_execute_dry_run(@runner_filepath)
|
41
|
+
assert_match(rake_exec_matcher, output, 'test runner file should be slated for generation')
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#include "unity.h"
|
2
|
+
#include "other_stuff.h"
|
3
|
+
|
4
|
+
|
5
|
+
void setUp(void) {}
|
6
|
+
void tearDown(void) {}
|
7
|
+
|
8
|
+
// test successes
|
9
|
+
|
10
|
+
void test_add_should_succeed_1(void)
|
11
|
+
{
|
12
|
+
TEST_ASSERT_EQUAL(100, add(30, 70));
|
13
|
+
}
|
14
|
+
|
15
|
+
void test_add_should_succeed_2(void)
|
16
|
+
{
|
17
|
+
TEST_ASSERT_EQUAL(0, add(-5, 5));
|
18
|
+
}
|
19
|
+
|
20
|
+
// test failures
|
21
|
+
|
22
|
+
void test_fail()
|
23
|
+
{
|
24
|
+
TEST_FAIL("Boom.");
|
25
|
+
}
|
26
|
+
|
27
|
+
void test_add_should_fail(void)
|
28
|
+
{
|
29
|
+
TEST_ASSERT_EQUAL(0, add(2, 2));
|
30
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#include "unity.h"
|
2
|
+
#include "stuff.h"
|
3
|
+
|
4
|
+
|
5
|
+
void setUp(void) {}
|
6
|
+
void tearDown(void) {}
|
7
|
+
|
8
|
+
|
9
|
+
// test ignores & variations on test declarations
|
10
|
+
|
11
|
+
void test_a_single_thing(void)
|
12
|
+
{
|
13
|
+
TEST_IGNORE_MESSAGE("pay no attention to the test behind the curtain");
|
14
|
+
}
|
15
|
+
|
16
|
+
void test_another_thing ( void )
|
17
|
+
{
|
18
|
+
TEST_IGNORE_MESSAGE("pay no attention to the test behind the curtain");
|
19
|
+
}
|
20
|
+
|
21
|
+
void test_some_non_void_param_stuff()
|
22
|
+
{
|
23
|
+
TEST_IGNORE_MESSAGE("pay no attention to the test behind the curtain");
|
24
|
+
}
|
25
|
+
|
26
|
+
void
|
27
|
+
test_some_multiline_test_case_action
|
28
|
+
(void)
|
29
|
+
{
|
30
|
+
TEST_IGNORE_MESSAGE("pay no attention to the test behind the curtain");
|
31
|
+
}
|
32
|
+
|
33
|
+
// test successes
|
34
|
+
|
35
|
+
void test_subtract_should_succeed_1(void)
|
36
|
+
{
|
37
|
+
TEST_ASSERT_EQUAL(10, subtract(31, 21));
|
38
|
+
}
|
39
|
+
|
40
|
+
void test_subtract_should_succeed_2(void)
|
41
|
+
{
|
42
|
+
TEST_ASSERT_EQUAL(0, subtract(12, 12));
|
43
|
+
}
|
44
|
+
|
45
|
+
// test failures
|
46
|
+
|
47
|
+
void test_subtract_should_fail(void)
|
48
|
+
{
|
49
|
+
TEST_ASSERT_EQUAL(100, subtract(210, 109));
|
50
|
+
}
|
51
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__)) + "/../config/test_environment"
|
2
|
+
require 'test_helper'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
|
7
|
+
class Test::Unit::TestCase
|
8
|
+
extend Behaviors
|
9
|
+
|
10
|
+
def ceedling_execute(*args_and_tasks)
|
11
|
+
return execute('rake', ["-f #{File.join(LIB_ROOT, 'rakefile.rb')}"] + args_and_tasks)
|
12
|
+
end
|
13
|
+
|
14
|
+
# do not raise if rake execution of ceedling bombs & do not display any output
|
15
|
+
def ceedling_execute_no_boom(*args_and_tasks)
|
16
|
+
return execute('rake', ["-f #{File.join(LIB_ROOT, 'rakefile.rb')}"] + args_and_tasks, false, false, false)
|
17
|
+
end
|
18
|
+
|
19
|
+
# execute rake in dry run mode -- checking dependencies and invoke states but not actually taking action
|
20
|
+
def ceedling_execute_dry_run(*args_and_tasks)
|
21
|
+
return ceedling_execute(['-n'] + args_and_tasks)
|
22
|
+
end
|
23
|
+
|
24
|
+
def fetch_test_results(results_path, test_name)
|
25
|
+
filepath = ''
|
26
|
+
|
27
|
+
pass_path = File.join(results_path, "#{test_name}.pass")
|
28
|
+
fail_path = File.join(results_path, "#{test_name}.fail")
|
29
|
+
|
30
|
+
if (File.exists?(pass_path))
|
31
|
+
filepath = pass_path
|
32
|
+
elsif (File.exists?(fail_path))
|
33
|
+
filepath = fail_path
|
34
|
+
else
|
35
|
+
raise "Could not find test results for '#{test_name}' in #{results_path}"
|
36
|
+
end
|
37
|
+
|
38
|
+
return YAML.load(File.read(filepath))
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def report(message)
|
44
|
+
puts message
|
45
|
+
$stdout.flush
|
46
|
+
end
|
47
|
+
|
48
|
+
def report_err(message)
|
49
|
+
$stderr.puts(message)
|
50
|
+
$stderr.flush
|
51
|
+
end
|
52
|
+
|
53
|
+
def execute(cmd, args=[], verbose_cmd=false, verbose_error=true, should_raise=true)
|
54
|
+
cmd_str = "#{cmd} #{args.join(' ')}"
|
55
|
+
|
56
|
+
# execute command and redirect stderr to stdout;
|
57
|
+
# the redirect grabs all response output centrally &
|
58
|
+
# lets us gobble up errors if we need to parse them for test execution
|
59
|
+
response = `#{cmd_str} 2>&1`
|
60
|
+
|
61
|
+
report(cmd_str) if verbose_cmd
|
62
|
+
report(response) if verbose_cmd
|
63
|
+
report('') if verbose_cmd
|
64
|
+
|
65
|
+
if ($?.exitstatus != 0)
|
66
|
+
report_err(response) if verbose_error
|
67
|
+
report_err('') if verbose_error
|
68
|
+
raise "Command '#{cmd_str}' failed. (Returned #{$?.exitstatus})" if should_raise
|
69
|
+
end
|
70
|
+
return response
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
@@ -0,0 +1,93 @@
|
|
1
|
+
|
2
|
+
#gem install test-unit -v 1.2.3
|
3
|
+
ruby_version = RUBY_VERSION.split('.')
|
4
|
+
if (ruby_version[1].to_i == 9) and (ruby_version[2].to_i > 1)
|
5
|
+
require 'gems'
|
6
|
+
gem 'test-unit'
|
7
|
+
end
|
8
|
+
require 'test/unit'
|
9
|
+
require 'behaviors'
|
10
|
+
|
11
|
+
|
12
|
+
TESTS_ROOT = File.expand_path(File.dirname(__FILE__))
|
13
|
+
SYSTEM_TEST_ROOT = TESTS_ROOT + '/system'
|
14
|
+
INTEGRATION_TEST_ROOT = TESTS_ROOT + '/integration'
|
15
|
+
LIB_ROOT = File.expand_path(File.dirname(__FILE__) + '/../lib')
|
16
|
+
CEEDLING_ROOT = 'test_ceedling_root/'
|
17
|
+
CEEDLING_LIB = 'test_ceedling_lib/'
|
18
|
+
CEEDLING_VENDOR = 'test_ceedling_vendor/'
|
19
|
+
CEEDLING_RELEASE = 'test_ceedling_release/'
|
20
|
+
|
21
|
+
$config_options = {
|
22
|
+
:project_build_root => 'project/build',
|
23
|
+
:project_test_build_output_path => 'project/build/tests/output',
|
24
|
+
:project_test_results_path => 'project/build/tests/results',
|
25
|
+
:project_source_include_dirs => [],
|
26
|
+
:project_test_file_prefix => 'test_',
|
27
|
+
:project_test_preprocess_files_path => 'project/build/tests/preprocess/files',
|
28
|
+
:project_test_preprocess_includes_path => 'project/build/tests/preprocess/includes',
|
29
|
+
:project_test_dependencies_path => 'project/build/tests/dependencies',
|
30
|
+
:test_runner_file_suffix => '_runner',
|
31
|
+
:cmock_mock_prefix => 'mock_',
|
32
|
+
:extension_source => '.c',
|
33
|
+
:extension_header => '.h',
|
34
|
+
:extension_object => '.o',
|
35
|
+
:extension_executable => '.out',
|
36
|
+
:extension_testpass => '.pass',
|
37
|
+
:extension_dependencies => '.d',
|
38
|
+
:collection_all_tests => [],
|
39
|
+
:collection_all_include_paths => [],
|
40
|
+
:defines_test => [],
|
41
|
+
}
|
42
|
+
|
43
|
+
PROJECT_BUILD_ROOT = $config_options[:project_build_root]
|
44
|
+
PROJECT_TEST_BUILD_OUTPUT_PATH = $config_options[:project_test_build_output_path]
|
45
|
+
PROJECT_TEST_RESULTS_PATH = $config_options[:project_test_results_path]
|
46
|
+
PROJECT_SOURCE_INCLUDE_PATHS = $config_options[:project_source_include_dirs]
|
47
|
+
PROJECT_TEST_FILE_PREFIX = $config_options[:project_test_file_prefix]
|
48
|
+
PROJECT_TEST_PREPROCESS_FILES_PATH = $config_options[:project_test_preprocess_files_path]
|
49
|
+
PROJECT_TEST_PREPROCESS_INCLUDES_PATH = $config_options[:project_test_preprocess_includes_path]
|
50
|
+
PROJECT_TEST_DEPENDENCIES_PATH = $config_options[:project_test_dependencies_path]
|
51
|
+
TEST_RUNNER_FILE_SUFFIX = $config_options[:test_runner_file_suffix]
|
52
|
+
CMOCK_MOCK_PREFIX = $config_options[:cmock_mock_prefix]
|
53
|
+
EXTENSION_SOURCE = $config_options[:extension_source]
|
54
|
+
EXTENSION_HEADER = $config_options[:extension_header]
|
55
|
+
EXTENSION_OBJECT = $config_options[:extension_object]
|
56
|
+
EXTENSION_EXECUTABLE = $config_options[:extension_executable]
|
57
|
+
EXTENSION_TESTPASS = $config_options[:extension_testpass]
|
58
|
+
EXTENSION_DEPENDENCIES = $config_options[:extension_dependencies]
|
59
|
+
COLLECTION_ALL_TESTS = $config_options[:collection_all_tests]
|
60
|
+
COLLECTION_ALL_INCLUDE_PATHS = $config_options[:collection_all_include_paths]
|
61
|
+
DEFINES_TEST = $config_options[:defines_test]
|
62
|
+
|
63
|
+
|
64
|
+
class String
|
65
|
+
def left_margin(margin=0)
|
66
|
+
non_whitespace_column = 0
|
67
|
+
new_lines = []
|
68
|
+
|
69
|
+
# find first line with non-whitespace and count left columns of whitespace
|
70
|
+
self.each_line do |line|
|
71
|
+
if (line =~ /^\s*\S/)
|
72
|
+
non_whitespace_column = $&.length - 1
|
73
|
+
break
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# iterate through each line, chopping off leftmost whitespace columns and add back the desired whitespace margin
|
78
|
+
self.each_line do |line|
|
79
|
+
columns = []
|
80
|
+
margin.times{columns << ' '}
|
81
|
+
# handle special case of line being narrower than width to be lopped off
|
82
|
+
if (non_whitespace_column < line.length)
|
83
|
+
new_lines << "#{columns.join}#{line[non_whitespace_column..-1]}"
|
84
|
+
else
|
85
|
+
new_lines << "\n"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
return new_lines.join
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
|
@@ -0,0 +1,571 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../unit_test_helper'
|
2
|
+
require 'configurator_builder'
|
3
|
+
require 'yaml'
|
4
|
+
require 'constants' # for Verbosity constants class
|
5
|
+
|
6
|
+
|
7
|
+
class ConfiguratorBuilderTest < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def setup
|
10
|
+
objects = create_mocks(:project_config_manager, :file_system_utils, :file_wrapper)
|
11
|
+
create_mocks(:file_list)
|
12
|
+
@builder = ConfiguratorBuilder.new(objects)
|
13
|
+
end
|
14
|
+
|
15
|
+
def teardown
|
16
|
+
end
|
17
|
+
|
18
|
+
############# insert tool names #############
|
19
|
+
|
20
|
+
should "insert tool names into tools config from their config hash key names" do
|
21
|
+
in_hash = {
|
22
|
+
:tools => {
|
23
|
+
:thinger => {:executable => '/bin/thinger', :arguments => ['-E']},
|
24
|
+
:zinger => {:executable => 'zinger', :arguments => ['-option', '-flag']}
|
25
|
+
}}
|
26
|
+
|
27
|
+
@builder.populate_tool_names(in_hash)
|
28
|
+
|
29
|
+
assert_equal('thinger', in_hash[:tools][:thinger][:name])
|
30
|
+
assert_equal('/bin/thinger', in_hash[:tools][:thinger][:executable])
|
31
|
+
assert_equal(['-E'], in_hash[:tools][:thinger][:arguments])
|
32
|
+
|
33
|
+
assert_equal('zinger', in_hash[:tools][:zinger][:name])
|
34
|
+
assert_equal('zinger', in_hash[:tools][:zinger][:executable])
|
35
|
+
assert_equal(['-option', '-flag'], in_hash[:tools][:zinger][:arguments])
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
############# flattenify #############
|
40
|
+
|
41
|
+
should "flattenify keys and values contained in yaml and not blow up on empty top-level entries" do
|
42
|
+
|
43
|
+
config = %Q{
|
44
|
+
---
|
45
|
+
:project:
|
46
|
+
:name: App
|
47
|
+
:dirs:
|
48
|
+
- .
|
49
|
+
- gui
|
50
|
+
- ../common/modules/
|
51
|
+
|
52
|
+
:extension:
|
53
|
+
:obj: .o
|
54
|
+
:bin: .out
|
55
|
+
:dep: .d
|
56
|
+
|
57
|
+
:cmock:
|
58
|
+
:mock_path: build/tests/mocks/
|
59
|
+
:plugins:
|
60
|
+
- cexception
|
61
|
+
- ignore
|
62
|
+
|
63
|
+
:empty:
|
64
|
+
|
65
|
+
...
|
66
|
+
}.left_margin
|
67
|
+
hash = @builder.flattenify( YAML.load(config) )
|
68
|
+
|
69
|
+
assert_equal(hash[:project_name], 'App')
|
70
|
+
assert_equal(hash[:project_dirs], ['.', 'gui', '../common/modules/'])
|
71
|
+
|
72
|
+
assert_equal(hash[:extension_obj], '.o')
|
73
|
+
assert_equal(hash[:extension_bin], '.out')
|
74
|
+
assert_equal(hash[:extension_dep], '.d')
|
75
|
+
|
76
|
+
assert_equal(hash[:cmock_mock_path], 'build/tests/mocks/')
|
77
|
+
assert_equal(hash[:cmock_plugins], ['cexception', 'ignore'])
|
78
|
+
end
|
79
|
+
|
80
|
+
############# defaults #############
|
81
|
+
|
82
|
+
should "populate all defaults for unspecified entries in config hash" do
|
83
|
+
# pass in blank configuration and ensure all defaults populated
|
84
|
+
assert_equal(DEFAULT_CEEDLING_CONFIG, @builder.populate_defaults({}))
|
85
|
+
end
|
86
|
+
|
87
|
+
should "not default any entry in input config hash that's already been set to something" do
|
88
|
+
in_hash = {
|
89
|
+
# all set to something other than defaults in source
|
90
|
+
:project_use_exceptions => false,
|
91
|
+
:project_use_mocks => false,
|
92
|
+
:project_use_preprocessor => true,
|
93
|
+
:project_use_deep_dependencies => true,
|
94
|
+
:project_test_file_prefix => 'yeehaw_',
|
95
|
+
:project_verbosity => Verbosity::OBNOXIOUS,
|
96
|
+
|
97
|
+
:paths_support => ['path/support'],
|
98
|
+
:paths_include => ['path/include'],
|
99
|
+
|
100
|
+
:defines_test => ['TEST_DEFINE'],
|
101
|
+
:defines_source => ['SOURCE_DEFINE'],
|
102
|
+
|
103
|
+
:extension_header => '.H',
|
104
|
+
:extension_source => '.C',
|
105
|
+
:extension_object => '.O',
|
106
|
+
:extension_executable => '.exe',
|
107
|
+
:extension_testpass => '.p',
|
108
|
+
:extension_testfail => '.f',
|
109
|
+
:extension_dependencies => '.dep',
|
110
|
+
|
111
|
+
:unity_int_width => 16,
|
112
|
+
:unity_exclude_float => true,
|
113
|
+
:unity_float_type => 'double',
|
114
|
+
:unity_float_precision => '0.0000001f',
|
115
|
+
|
116
|
+
:test_runner_includes => ['Common.h'],
|
117
|
+
:test_runner_file_suffix => '_walker',
|
118
|
+
|
119
|
+
:tools_includes_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
|
120
|
+
:tools_file_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
|
121
|
+
:tools_dependencies_generator => {:name => 'doohicky', :executable => 'exe', :arguments => []},
|
122
|
+
}
|
123
|
+
|
124
|
+
assert_equal(in_hash, @builder.populate_defaults(in_hash))
|
125
|
+
end
|
126
|
+
|
127
|
+
should "merge complex/nested values within default values" do
|
128
|
+
in_hash = {
|
129
|
+
:tools_file_preprocessor => {:executable => '/bin/app'},
|
130
|
+
:tools_dependencies_generator => {:arguments => ['-option', '-flag']}
|
131
|
+
}
|
132
|
+
|
133
|
+
out_hash = @builder.populate_defaults(in_hash)
|
134
|
+
|
135
|
+
# default executable has been overwritten but default arguments remain
|
136
|
+
assert_equal('/bin/app', out_hash[:tools_file_preprocessor][:executable])
|
137
|
+
assert_equal(DEFAULT_FILE_PREPROCESSOR_TOOL[:arguments], out_hash[:tools_file_preprocessor][:arguments])
|
138
|
+
|
139
|
+
# default arguments have been overwritten but default executable remains
|
140
|
+
assert_equal(DEFAULT_DEPENDENCIES_GENERATOR_TOOL[:executable], out_hash[:tools_dependencies_generator][:executable])
|
141
|
+
assert_equal(['-option', '-flag'], out_hash[:tools_dependencies_generator][:arguments])
|
142
|
+
end
|
143
|
+
|
144
|
+
should "preserve in defaulted configuration anything in input that's not a handled default" do
|
145
|
+
in_hash = {
|
146
|
+
:yo => 'mama',
|
147
|
+
:be => 'all you can be'
|
148
|
+
}
|
149
|
+
|
150
|
+
assert_equal(DEFAULT_CEEDLING_CONFIG.merge(in_hash), @builder.populate_defaults(in_hash))
|
151
|
+
end
|
152
|
+
|
153
|
+
############# clean #############
|
154
|
+
|
155
|
+
should "tidy up configuration values" do
|
156
|
+
in_hash = {
|
157
|
+
:test_runner_includes => ['common', 'types.h', 'thing.H'],
|
158
|
+
:extension_header => '.h',
|
159
|
+
}
|
160
|
+
|
161
|
+
@builder.clean(in_hash)
|
162
|
+
|
163
|
+
assert_equal(['common.h', 'types.h', 'thing.h'], in_hash[:test_runner_includes])
|
164
|
+
end
|
165
|
+
|
166
|
+
############# build paths #############
|
167
|
+
|
168
|
+
should "construct and collect simple build paths" do
|
169
|
+
in_hash = {
|
170
|
+
:project_build_root => 'files/build'}
|
171
|
+
expected_build_paths = [
|
172
|
+
'files/build/tests/runners',
|
173
|
+
'files/build/tests/results',
|
174
|
+
'files/build/tests/out',
|
175
|
+
'files/build/tests/artifacts',
|
176
|
+
'files/build/release/out',
|
177
|
+
'files/build/release/artifacts',]
|
178
|
+
|
179
|
+
out_hash = @builder.set_build_paths(in_hash)
|
180
|
+
|
181
|
+
assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
|
182
|
+
|
183
|
+
assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
|
184
|
+
assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
|
185
|
+
assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
|
186
|
+
assert_equal(expected_build_paths[3], out_hash[:project_test_artifacts_path])
|
187
|
+
assert_equal(expected_build_paths[4], out_hash[:project_release_build_output_path])
|
188
|
+
assert_equal(expected_build_paths[5], out_hash[:project_release_artifacts_path])
|
189
|
+
end
|
190
|
+
|
191
|
+
should "construct and collect build paths including mocks path" do
|
192
|
+
in_hash = {
|
193
|
+
:project_build_root => 'files/build',
|
194
|
+
:project_use_mocks => true,
|
195
|
+
:cmock_mock_path => 'files/build/tests/mocks'}
|
196
|
+
expected_build_paths = [
|
197
|
+
'files/build/tests/runners',
|
198
|
+
'files/build/tests/results',
|
199
|
+
'files/build/tests/out',
|
200
|
+
'files/build/tests/mocks',
|
201
|
+
'files/build/tests/artifacts',
|
202
|
+
'files/build/release/out',
|
203
|
+
'files/build/release/artifacts',]
|
204
|
+
|
205
|
+
out_hash = @builder.set_build_paths(in_hash)
|
206
|
+
|
207
|
+
assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
|
208
|
+
|
209
|
+
assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
|
210
|
+
assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
|
211
|
+
assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
|
212
|
+
assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
|
213
|
+
assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
|
214
|
+
assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
|
215
|
+
end
|
216
|
+
|
217
|
+
should "construct and collect build paths including preprocessing paths" do
|
218
|
+
in_hash = {
|
219
|
+
:project_build_root => 'files/build',
|
220
|
+
:project_use_preprocessor => true}
|
221
|
+
expected_build_paths = [
|
222
|
+
'files/build/tests/runners',
|
223
|
+
'files/build/tests/results',
|
224
|
+
'files/build/tests/out',
|
225
|
+
'files/build/tests/preprocess/includes',
|
226
|
+
'files/build/tests/preprocess/files',
|
227
|
+
'files/build/temp',
|
228
|
+
'files/build/tests/artifacts',
|
229
|
+
'files/build/release/out',
|
230
|
+
'files/build/release/artifacts',]
|
231
|
+
|
232
|
+
out_hash = @builder.set_build_paths(in_hash)
|
233
|
+
|
234
|
+
assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
|
235
|
+
|
236
|
+
assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
|
237
|
+
assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
|
238
|
+
assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
|
239
|
+
assert_equal(expected_build_paths[3], out_hash[:project_test_preprocess_includes_path])
|
240
|
+
assert_equal(expected_build_paths[4], out_hash[:project_test_preprocess_files_path])
|
241
|
+
assert_equal(expected_build_paths[5], out_hash[:project_temp_path])
|
242
|
+
assert_equal(expected_build_paths[6], out_hash[:project_test_artifacts_path])
|
243
|
+
assert_equal(expected_build_paths[7], out_hash[:project_release_build_output_path])
|
244
|
+
assert_equal(expected_build_paths[8], out_hash[:project_release_artifacts_path])
|
245
|
+
end
|
246
|
+
|
247
|
+
should "construct and collect build paths including dependencies paths" do
|
248
|
+
in_hash = {
|
249
|
+
:project_build_root => 'files/build',
|
250
|
+
:project_use_deep_dependencies => true}
|
251
|
+
expected_build_paths = [
|
252
|
+
'files/build/tests/runners',
|
253
|
+
'files/build/tests/results',
|
254
|
+
'files/build/tests/out',
|
255
|
+
'files/build/tests/dependencies',
|
256
|
+
'files/build/tests/artifacts',
|
257
|
+
'files/build/release/out',
|
258
|
+
'files/build/release/artifacts',]
|
259
|
+
|
260
|
+
out_hash = @builder.set_build_paths(in_hash)
|
261
|
+
|
262
|
+
assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
|
263
|
+
|
264
|
+
assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
|
265
|
+
assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
|
266
|
+
assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
|
267
|
+
assert_equal(expected_build_paths[3], out_hash[:project_test_dependencies_path])
|
268
|
+
assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
|
269
|
+
assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
|
270
|
+
assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
|
271
|
+
end
|
272
|
+
|
273
|
+
############# rakefile components #############
|
274
|
+
|
275
|
+
should "set rakefile components needed to load the project" do
|
276
|
+
in_hash = {}
|
277
|
+
out_hash = @builder.set_rakefile_components(in_hash)
|
278
|
+
assert_equal(
|
279
|
+
["#{CEEDLING_LIB}rules.rake",
|
280
|
+
"#{CEEDLING_LIB}tasks.rake",
|
281
|
+
"#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
|
282
|
+
out_hash[:project_rakefile_component_files].sort)
|
283
|
+
|
284
|
+
in_hash = {:project_use_mocks => true}
|
285
|
+
out_hash = @builder.set_rakefile_components(in_hash)
|
286
|
+
assert_equal(
|
287
|
+
["#{CEEDLING_LIB}rules.rake",
|
288
|
+
"#{CEEDLING_LIB}tasks.rake",
|
289
|
+
"#{CEEDLING_LIB}rules_cmock.rake",
|
290
|
+
"#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
|
291
|
+
out_hash[:project_rakefile_component_files].sort)
|
292
|
+
|
293
|
+
in_hash = {:project_use_preprocessor => true}
|
294
|
+
out_hash = @builder.set_rakefile_components(in_hash)
|
295
|
+
assert_equal(
|
296
|
+
["#{CEEDLING_LIB}rules.rake",
|
297
|
+
"#{CEEDLING_LIB}tasks.rake",
|
298
|
+
"#{CEEDLING_LIB}rules_preprocess.rake",
|
299
|
+
"#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
|
300
|
+
out_hash[:project_rakefile_component_files].sort)
|
301
|
+
|
302
|
+
in_hash = {:project_use_deep_dependencies => true}
|
303
|
+
out_hash = @builder.set_rakefile_components(in_hash)
|
304
|
+
assert_equal(
|
305
|
+
["#{CEEDLING_LIB}rules.rake",
|
306
|
+
"#{CEEDLING_LIB}tasks.rake",
|
307
|
+
"#{CEEDLING_LIB}rules_deep_dependencies.rake",
|
308
|
+
"#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
|
309
|
+
out_hash[:project_rakefile_component_files].sort)
|
310
|
+
|
311
|
+
in_hash = {:project_use_mocks => true, :project_use_preprocessor => true, :project_use_deep_dependencies => true}
|
312
|
+
out_hash = @builder.set_rakefile_components(in_hash)
|
313
|
+
assert_equal(
|
314
|
+
["#{CEEDLING_LIB}rules.rake",
|
315
|
+
"#{CEEDLING_LIB}tasks.rake",
|
316
|
+
"#{CEEDLING_LIB}rules_cmock.rake",
|
317
|
+
"#{CEEDLING_LIB}rules_preprocess.rake",
|
318
|
+
"#{CEEDLING_LIB}rules_deep_dependencies.rake",
|
319
|
+
"#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
|
320
|
+
out_hash[:project_rakefile_component_files].sort)
|
321
|
+
end
|
322
|
+
|
323
|
+
############# source and test include paths #############
|
324
|
+
|
325
|
+
should "collect all source and test include paths without optional mocks and exception paths" do
|
326
|
+
in_hash = {
|
327
|
+
:project_use_exceptions => false,
|
328
|
+
:project_use_mocks => false,
|
329
|
+
:paths_test => ['files/tests'],
|
330
|
+
:paths_support => ['files/tests/support'],
|
331
|
+
:paths_source => ['files/source'],
|
332
|
+
:paths_include => ['files/source/include'],
|
333
|
+
}
|
334
|
+
|
335
|
+
expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src"]
|
336
|
+
|
337
|
+
out_hash = @builder.collect_test_and_source_include_paths(in_hash)
|
338
|
+
|
339
|
+
assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
|
340
|
+
end
|
341
|
+
|
342
|
+
should "collect all source and test include paths without optional mocks paths but with exception path" do
|
343
|
+
in_hash = {
|
344
|
+
:project_use_exceptions => true,
|
345
|
+
:project_use_mocks => false,
|
346
|
+
:paths_test => ['files/tests'],
|
347
|
+
:paths_support => ['files/tests/support'],
|
348
|
+
:paths_source => ['files/source'],
|
349
|
+
:paths_include => ['files/source/include'],
|
350
|
+
}
|
351
|
+
|
352
|
+
expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib"]
|
353
|
+
|
354
|
+
out_hash = @builder.collect_test_and_source_include_paths(in_hash)
|
355
|
+
|
356
|
+
assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
|
357
|
+
end
|
358
|
+
|
359
|
+
should "collect all source and test include paths with optional mocks paths but without exception path" do
|
360
|
+
in_hash = {
|
361
|
+
:project_use_exceptions => false,
|
362
|
+
:project_use_mocks => true,
|
363
|
+
:cmock_mock_path => 'files/build/mocks',
|
364
|
+
:paths_test => ['files/tests'],
|
365
|
+
:paths_support => ['files/tests/support'],
|
366
|
+
:paths_source => ['files/source'],
|
367
|
+
:paths_include => ['files/source/include'],
|
368
|
+
}
|
369
|
+
|
370
|
+
expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", 'files/build/mocks']
|
371
|
+
|
372
|
+
out_hash = @builder.collect_test_and_source_include_paths(in_hash)
|
373
|
+
|
374
|
+
assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
|
375
|
+
end
|
376
|
+
|
377
|
+
should "collect all source and test include paths with both optional mocks paths and exception path" do
|
378
|
+
in_hash = {
|
379
|
+
:project_use_exceptions => true,
|
380
|
+
:project_use_mocks => true,
|
381
|
+
:cmock_mock_path => 'files/build/mocks',
|
382
|
+
:paths_test => ['files/tests'],
|
383
|
+
:paths_support => ['files/tests/support'],
|
384
|
+
:paths_source => ['files/source'],
|
385
|
+
:paths_include => ['files/source/include'],
|
386
|
+
}
|
387
|
+
|
388
|
+
expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib", 'files/build/mocks']
|
389
|
+
|
390
|
+
out_hash = @builder.collect_test_and_source_include_paths(in_hash)
|
391
|
+
|
392
|
+
assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
|
393
|
+
end
|
394
|
+
|
395
|
+
############# source and test paths #############
|
396
|
+
|
397
|
+
should "collect all source and test paths without optional mocks and exception paths" do
|
398
|
+
in_hash = {
|
399
|
+
:project_use_exceptions => false,
|
400
|
+
:project_use_mocks => false,
|
401
|
+
:paths_test => ['files/tests'],
|
402
|
+
:paths_support => ['files/tests/support'],
|
403
|
+
:paths_source => ['files/source'],
|
404
|
+
:project_test_runners_path => 'files/build/runners',
|
405
|
+
}
|
406
|
+
|
407
|
+
expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}unity/src"]
|
408
|
+
|
409
|
+
out_hash = @builder.collect_test_and_source_paths(in_hash)
|
410
|
+
|
411
|
+
assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
|
412
|
+
end
|
413
|
+
|
414
|
+
should "collect all source and test paths with optional mocks path but without exception path" do
|
415
|
+
in_hash = {
|
416
|
+
:project_use_exceptions => false,
|
417
|
+
:project_use_mocks => true,
|
418
|
+
:paths_test => ['files/tests'],
|
419
|
+
:paths_support => ['files/tests/support'],
|
420
|
+
:paths_source => ['files/source'],
|
421
|
+
:project_test_runners_path => 'files/build/runners',
|
422
|
+
:cmock_mock_path => 'files/build/mocks',
|
423
|
+
}
|
424
|
+
|
425
|
+
expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}unity/src"]
|
426
|
+
|
427
|
+
out_hash = @builder.collect_test_and_source_paths(in_hash)
|
428
|
+
|
429
|
+
assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
|
430
|
+
end
|
431
|
+
|
432
|
+
should "collect all source and test paths without optional mocks path but with exception path" do
|
433
|
+
in_hash = {
|
434
|
+
:project_use_exceptions => true,
|
435
|
+
:project_use_mocks => false,
|
436
|
+
:paths_test => ['files/tests'],
|
437
|
+
:paths_support => ['files/tests/support'],
|
438
|
+
:paths_source => ['files/source'],
|
439
|
+
:project_test_runners_path => 'files/build/runners',
|
440
|
+
}
|
441
|
+
|
442
|
+
expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
|
443
|
+
|
444
|
+
out_hash = @builder.collect_test_and_source_paths(in_hash)
|
445
|
+
|
446
|
+
assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
|
447
|
+
end
|
448
|
+
|
449
|
+
should "collect all source and test paths with both optional mocks path and exception path" do
|
450
|
+
in_hash = {
|
451
|
+
:project_use_exceptions => true,
|
452
|
+
:project_use_mocks => true,
|
453
|
+
:paths_test => ['files/tests'],
|
454
|
+
:paths_support => ['files/tests/support'],
|
455
|
+
:paths_source => ['files/source'],
|
456
|
+
:project_test_runners_path => 'files/build/runners',
|
457
|
+
:cmock_mock_path => 'files/build/mocks',
|
458
|
+
}
|
459
|
+
|
460
|
+
expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
|
461
|
+
|
462
|
+
out_hash = @builder.collect_test_and_source_paths(in_hash)
|
463
|
+
|
464
|
+
assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
|
465
|
+
end
|
466
|
+
|
467
|
+
############# all tests #############
|
468
|
+
|
469
|
+
should "collect all tests" do
|
470
|
+
in_hash = {
|
471
|
+
:paths_test => ['tests/main', 'tests/other/**'],
|
472
|
+
:project_test_file_prefix => 'Test',
|
473
|
+
:extension_source => '.c'}
|
474
|
+
|
475
|
+
@file_wrapper.expects.instantiate_file_list.returns(@file_list)
|
476
|
+
|
477
|
+
@file_list.expects.include('tests/main/Test*.c')
|
478
|
+
@file_list.expects.include('tests/other/**/Test*.c')
|
479
|
+
|
480
|
+
assert_equal({:collection_all_tests => @file_list}, @builder.collect_tests(in_hash))
|
481
|
+
end
|
482
|
+
|
483
|
+
############# all source #############
|
484
|
+
|
485
|
+
should "collect all source" do
|
486
|
+
in_hash = {
|
487
|
+
:paths_source => ['files/source', 'files/modules/**'],
|
488
|
+
:extension_source => '.c'}
|
489
|
+
|
490
|
+
@file_wrapper.expects.instantiate_file_list.returns(@file_list)
|
491
|
+
|
492
|
+
@file_list.expects.include('files/source/*.c')
|
493
|
+
@file_list.expects.include('files/modules/**/*.c')
|
494
|
+
|
495
|
+
assert_equal({:collection_all_source => @file_list}, @builder.collect_source(in_hash))
|
496
|
+
end
|
497
|
+
|
498
|
+
############# all headers #############
|
499
|
+
|
500
|
+
should "collect all headers" do
|
501
|
+
in_hash = {
|
502
|
+
:paths_support => ['files/test/support/**'],
|
503
|
+
:paths_include => ['files/source/include'],
|
504
|
+
:paths_source => ['files/source', 'files/modules/**'],
|
505
|
+
:extension_header => '.h'}
|
506
|
+
|
507
|
+
@file_wrapper.expects.instantiate_file_list.returns(@file_list)
|
508
|
+
|
509
|
+
@file_list.expects.include('files/test/support/**/*.h')
|
510
|
+
@file_list.expects.include('files/source/*.h')
|
511
|
+
@file_list.expects.include('files/modules/**/*.h')
|
512
|
+
@file_list.expects.include('files/source/include/*.h')
|
513
|
+
|
514
|
+
assert_equal({:collection_all_headers => @file_list}, @builder.collect_headers(in_hash))
|
515
|
+
end
|
516
|
+
|
517
|
+
############# collect environment files #############
|
518
|
+
|
519
|
+
should "collect environment source files plus project file but no user project file" do
|
520
|
+
@project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
|
521
|
+
@project_config_manager.expects.user_project_filepath.returns('')
|
522
|
+
|
523
|
+
out_hash = @builder.collect_code_generation_dependencies
|
524
|
+
|
525
|
+
assert_equal(
|
526
|
+
["#{CEEDLING_RELEASE}build.info",
|
527
|
+
"#{CEEDLING_VENDOR}cmock/release/build.info",
|
528
|
+
'/home/project/config/project.yaml'].sort,
|
529
|
+
out_hash[:collection_code_generation_dependencies].sort)
|
530
|
+
end
|
531
|
+
|
532
|
+
should "collect environment source files plus project file and user project file" do
|
533
|
+
@project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
|
534
|
+
@project_config_manager.expects.user_project_filepath.returns('/home/project/config/user.yaml')
|
535
|
+
|
536
|
+
out_hash = @builder.collect_code_generation_dependencies
|
537
|
+
|
538
|
+
assert_equal(
|
539
|
+
["#{CEEDLING_RELEASE}build.info",
|
540
|
+
"#{CEEDLING_VENDOR}cmock/release/build.info",
|
541
|
+
'/home/project/config/project.yaml',
|
542
|
+
'/home/project/config/user.yaml'].sort,
|
543
|
+
out_hash[:collection_code_generation_dependencies].sort)
|
544
|
+
end
|
545
|
+
|
546
|
+
############# expand path globs #############
|
547
|
+
|
548
|
+
should "inspect each element of paths in config hash and expand any and all globs into a collection" do
|
549
|
+
|
550
|
+
create_mocks(:paths_collection1, :paths_collection2, :paths_collection3)
|
551
|
+
in_hash = {
|
552
|
+
:path_dummy => [],
|
553
|
+
:paths_custom => ['oh', 'yeah'],
|
554
|
+
:paths_source => ['files/source', 'files/modules/**'],
|
555
|
+
:paths_to_destruction => ['paths/sin', 'paths/avarice'],
|
556
|
+
:whatever => 'blah blah blah',
|
557
|
+
}
|
558
|
+
|
559
|
+
@file_system_utils.expects.collect_paths(['oh', 'yeah']).returns(@paths_collection1)
|
560
|
+
@file_system_utils.expects.collect_paths(['files/source', 'files/modules/**']).returns(@paths_collection2)
|
561
|
+
@file_system_utils.expects.collect_paths(['paths/sin', 'paths/avarice']).returns(@paths_collection3)
|
562
|
+
|
563
|
+
out_hash = @builder.expand_all_path_globs(in_hash)
|
564
|
+
|
565
|
+
assert_equal(@paths_collection1, out_hash[:collection_paths_custom])
|
566
|
+
assert_equal(@paths_collection2, out_hash[:collection_paths_source])
|
567
|
+
assert_equal(@paths_collection3, out_hash[:collection_paths_to_destruction])
|
568
|
+
end
|
569
|
+
|
570
|
+
end
|
571
|
+
|