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,40 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
|
2
|
+
require 'hardmock/method_cleanout'
|
3
|
+
require 'hardmock/mock_control'
|
4
|
+
require 'hardmock/errors'
|
5
|
+
require 'hardmock/expectation_builder'
|
6
|
+
require 'hardmock/expectation'
|
7
|
+
require 'hardmock/mock'
|
8
|
+
|
9
|
+
class VerifyErrorTest < Test::Unit::TestCase
|
10
|
+
include Hardmock
|
11
|
+
|
12
|
+
#
|
13
|
+
# TESTS
|
14
|
+
#
|
15
|
+
|
16
|
+
def test_formatted_list_of_unmet_expectations
|
17
|
+
mock1 = Mock.new('mock1')
|
18
|
+
mock2 = Mock.new('mock2')
|
19
|
+
exp1 = Expectation.new( :mock => mock1, :method => 'send_parts', :arguments => [1,2,:a] )
|
20
|
+
exp2 = Expectation.new( :mock => mock2, :method => 'grind_it', :arguments => [] )
|
21
|
+
|
22
|
+
exp_list = [ exp1, exp2 ]
|
23
|
+
|
24
|
+
err = VerifyError.new("This is the error", exp_list)
|
25
|
+
assert_equal "This is the error:\n * #{exp1.to_s}\n * #{exp2.to_s}", err.message
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_empty_list_of_expectations
|
29
|
+
# this is not a normal case; not spending a lot of time to make this better
|
30
|
+
exp_list = []
|
31
|
+
err = VerifyError.new("This is the error:\n", exp_list)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_nil_expectation_list
|
35
|
+
# this is not a normal case; not spending a lot of time to make this better
|
36
|
+
exp_list = []
|
37
|
+
err = VerifyError.new("This is the error:\n", exp_list)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# ==========================================
|
2
|
+
# Unity Project - A Test Framework for C
|
3
|
+
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
4
|
+
# [Released under MIT License. Please refer to license.txt for details]
|
5
|
+
# ==========================================
|
6
|
+
|
7
|
+
if RUBY_PLATFORM =~/(win|w)32$/
|
8
|
+
begin
|
9
|
+
require 'Win32API'
|
10
|
+
rescue LoadError
|
11
|
+
puts "ERROR! \"Win32API\" library not found"
|
12
|
+
puts "\"Win32API\" is required for colour on a windows machine"
|
13
|
+
puts " try => \"gem install Win32API\" on the command line"
|
14
|
+
puts
|
15
|
+
end
|
16
|
+
# puts
|
17
|
+
# puts 'Windows Environment Detected...'
|
18
|
+
# puts 'Win32API Library Found.'
|
19
|
+
# puts
|
20
|
+
end
|
21
|
+
|
22
|
+
class ColourCommandLine
|
23
|
+
def initialize
|
24
|
+
if RUBY_PLATFORM =~/(win|w)32$/
|
25
|
+
get_std_handle = Win32API.new("kernel32", "GetStdHandle", ['L'], 'L')
|
26
|
+
@set_console_txt_attrb =
|
27
|
+
Win32API.new("kernel32","SetConsoleTextAttribute",['L','N'], 'I')
|
28
|
+
@hout = get_std_handle.call(-11)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def change_to(new_colour)
|
33
|
+
if RUBY_PLATFORM =~/(win|w)32$/
|
34
|
+
@set_console_txt_attrb.call(@hout,self.win32_colour(new_colour))
|
35
|
+
else
|
36
|
+
"\033[30;#{posix_colour(new_colour)};22m"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def win32_colour(colour)
|
41
|
+
case colour
|
42
|
+
when :black then 0
|
43
|
+
when :dark_blue then 1
|
44
|
+
when :dark_green then 2
|
45
|
+
when :dark_cyan then 3
|
46
|
+
when :dark_red then 4
|
47
|
+
when :dark_purple then 5
|
48
|
+
when :dark_yellow, :narrative then 6
|
49
|
+
when :default_white, :default, :dark_white then 7
|
50
|
+
when :silver then 8
|
51
|
+
when :blue then 9
|
52
|
+
when :green, :success then 10
|
53
|
+
when :cyan, :output then 11
|
54
|
+
when :red, :failure then 12
|
55
|
+
when :purple then 13
|
56
|
+
when :yellow then 14
|
57
|
+
when :white then 15
|
58
|
+
else
|
59
|
+
0
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def posix_colour(colour)
|
64
|
+
case colour
|
65
|
+
when :black then 30
|
66
|
+
when :red, :failure then 31
|
67
|
+
when :green, :success then 32
|
68
|
+
when :yellow then 33
|
69
|
+
when :blue, :narrative then 34
|
70
|
+
when :purple, :magenta then 35
|
71
|
+
when :cyan, :output then 36
|
72
|
+
when :white, :default_white, :default then 37
|
73
|
+
else
|
74
|
+
30
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def out_c(mode, colour, str)
|
79
|
+
case RUBY_PLATFORM
|
80
|
+
when /(win|w)32$/
|
81
|
+
change_to(colour)
|
82
|
+
$stdout.puts str if mode == :puts
|
83
|
+
$stdout.print str if mode == :print
|
84
|
+
change_to(:default_white)
|
85
|
+
else
|
86
|
+
$stdout.puts("#{change_to(colour)}#{str}\033[0m") if mode == :puts
|
87
|
+
$stdout.print("#{change_to(colour)}#{str}\033[0m") if mode == :print
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end # ColourCommandLine
|
91
|
+
|
92
|
+
def colour_puts(role,str) ColourCommandLine.new.out_c(:puts, role, str) end
|
93
|
+
def colour_print(role,str) ColourCommandLine.new.out_c(:print, role, str) end
|
94
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# ==========================================
|
2
|
+
# Unity Project - A Test Framework for C
|
3
|
+
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
4
|
+
# [Released under MIT License. Please refer to license.txt for details]
|
5
|
+
# ==========================================
|
6
|
+
|
7
|
+
require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt"
|
8
|
+
|
9
|
+
$colour_output = true
|
10
|
+
|
11
|
+
def report(message)
|
12
|
+
if not $colour_output
|
13
|
+
$stdout.puts(message)
|
14
|
+
else
|
15
|
+
message = message.join('\n') if (message.class == Array)
|
16
|
+
message.each_line do |line|
|
17
|
+
line.chomp!
|
18
|
+
colour = case(line)
|
19
|
+
when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
|
20
|
+
($1.to_i == 0) ? :green : :red
|
21
|
+
when /PASS/
|
22
|
+
:green
|
23
|
+
when /^OK$/
|
24
|
+
:green
|
25
|
+
when /(?:FAIL|ERROR)/
|
26
|
+
:red
|
27
|
+
when /IGNORE/
|
28
|
+
:yellow
|
29
|
+
when /^(?:Creating|Compiling|Linking)/
|
30
|
+
:white
|
31
|
+
else
|
32
|
+
:silver
|
33
|
+
end
|
34
|
+
colour_puts(colour, line)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
$stdout.flush
|
38
|
+
$stderr.flush
|
39
|
+
end
|
@@ -0,0 +1,202 @@
|
|
1
|
+
# ==========================================
|
2
|
+
# Unity Project - A Test Framework for C
|
3
|
+
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
4
|
+
# [Released under MIT License. Please refer to license.txt for details]
|
5
|
+
# ==========================================
|
6
|
+
|
7
|
+
# This script creates all the files with start code necessary for a new module.
|
8
|
+
# A simple module only requires a source file, header file, and test file.
|
9
|
+
# Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware).
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'fileutils'
|
13
|
+
|
14
|
+
HERE = File.expand_path(File.dirname(__FILE__)) + '/'
|
15
|
+
|
16
|
+
#help text when requested
|
17
|
+
HELP_TEXT = [ "\nGENERATE MODULE\n-------- ------",
|
18
|
+
"\nUsage: ruby generate_module [options] module_name",
|
19
|
+
" -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)",
|
20
|
+
" -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)",
|
21
|
+
" -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)",
|
22
|
+
" -p\"MCH\" sets the output pattern to MCH.",
|
23
|
+
" dh - driver hardware.",
|
24
|
+
" dih - driver interrupt hardware.",
|
25
|
+
" mch - model conductor hardware.",
|
26
|
+
" mvp - model view presenter.",
|
27
|
+
" src - just a single source module. (DEFAULT)",
|
28
|
+
" -d destroy module instead of creating it.",
|
29
|
+
" -u update subversion too (requires subversion command line)",
|
30
|
+
" -y\"my.yml\" selects a different yaml config file for module generation",
|
31
|
+
"" ].join("\n")
|
32
|
+
|
33
|
+
#Built in patterns
|
34
|
+
PATTERNS = { 'src' => {'' => { :inc => [] } },
|
35
|
+
'dh' => {'Driver' => { :inc => ['%1$sHardware.h'] },
|
36
|
+
'Hardware' => { :inc => [] }
|
37
|
+
},
|
38
|
+
'dih' => {'Driver' => { :inc => ['%1$sHardware.h', '%1$sInterrupt.h'] },
|
39
|
+
'Interrupt'=> { :inc => ['%1$sHardware.h'] },
|
40
|
+
'Hardware' => { :inc => [] }
|
41
|
+
},
|
42
|
+
'mch' => {'Model' => { :inc => [] },
|
43
|
+
'Conductor'=> { :inc => ['%1$sModel.h', '%1$sHardware.h'] },
|
44
|
+
'Hardware' => { :inc => [] }
|
45
|
+
},
|
46
|
+
'mvp' => {'Model' => { :inc => [] },
|
47
|
+
'Presenter'=> { :inc => ['%1$sModel.h', '%1$sView.h'] },
|
48
|
+
'View' => { :inc => [] }
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
#TEMPLATE_TST
|
53
|
+
TEMPLATE_TST = %q[#include "unity.h"
|
54
|
+
%2$s#include "%1$s.h"
|
55
|
+
|
56
|
+
void setUp(void)
|
57
|
+
{
|
58
|
+
}
|
59
|
+
|
60
|
+
void tearDown(void)
|
61
|
+
{
|
62
|
+
}
|
63
|
+
|
64
|
+
void test_%1$s_NeedToImplement(void)
|
65
|
+
{
|
66
|
+
TEST_IGNORE();
|
67
|
+
}
|
68
|
+
]
|
69
|
+
|
70
|
+
#TEMPLATE_SRC
|
71
|
+
TEMPLATE_SRC = %q[%2$s#include "%1$s.h"
|
72
|
+
]
|
73
|
+
|
74
|
+
#TEMPLATE_INC
|
75
|
+
TEMPLATE_INC = %q[#ifndef _%3$s_H
|
76
|
+
#define _%3$s_H%2$s
|
77
|
+
|
78
|
+
#endif // _%3$s_H
|
79
|
+
]
|
80
|
+
|
81
|
+
# Parse the command line parameters.
|
82
|
+
ARGV.each do |arg|
|
83
|
+
case(arg)
|
84
|
+
when /^-d/ then @destroy = true
|
85
|
+
when /^-u/ then @update_svn = true
|
86
|
+
when /^-p(\w+)/ then @pattern = $1
|
87
|
+
when /^-s(.+)/ then @path_src = $1
|
88
|
+
when /^-i(.+)/ then @path_inc = $1
|
89
|
+
when /^-t(.+)/ then @path_tst = $1
|
90
|
+
when /^-y(.+)/ then @yaml_config = $1
|
91
|
+
when /^(\w+)/
|
92
|
+
raise "ERROR: You can't have more than one Module name specified!" unless @module_name.nil?
|
93
|
+
@module_name = arg
|
94
|
+
when /^-(h|-help)/
|
95
|
+
puts HELP_TEXT
|
96
|
+
exit
|
97
|
+
else
|
98
|
+
raise "ERROR: Unknown option specified '#{arg}'"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
raise "ERROR: You must have a Module name specified! (use option -h for help)" if @module_name.nil?
|
102
|
+
|
103
|
+
#load yaml file if one was requested
|
104
|
+
if @yaml_config
|
105
|
+
require 'yaml'
|
106
|
+
cfg = YAML.load_file(HERE + @yaml_config)[:generate_module]
|
107
|
+
@path_src = cfg[:defaults][:path_src] if @path_src.nil?
|
108
|
+
@path_inc = cfg[:defaults][:path_inc] if @path_inc.nil?
|
109
|
+
@path_tst = cfg[:defaults][:path_tst] if @path_tst.nil?
|
110
|
+
@update_svn = cfg[:defaults][:update_svn] if @update_svn.nil?
|
111
|
+
@extra_inc = cfg[:includes]
|
112
|
+
@boilerplates = cfg[:boilerplates]
|
113
|
+
else
|
114
|
+
@boilerplates = {}
|
115
|
+
end
|
116
|
+
|
117
|
+
# Create default file paths if none were provided
|
118
|
+
@path_src = HERE + "../src/" if @path_src.nil?
|
119
|
+
@path_inc = @path_src if @path_inc.nil?
|
120
|
+
@path_tst = HERE + "../test/" if @path_tst.nil?
|
121
|
+
@path_src += '/' unless (@path_src[-1] == 47)
|
122
|
+
@path_inc += '/' unless (@path_inc[-1] == 47)
|
123
|
+
@path_tst += '/' unless (@path_tst[-1] == 47)
|
124
|
+
@pattern = 'src' if @pattern.nil?
|
125
|
+
@includes = { :src => [], :inc => [], :tst => [] }
|
126
|
+
@includes.merge!(@extra_inc) unless @extra_inc.nil?
|
127
|
+
|
128
|
+
#create triad definition
|
129
|
+
TRIAD = [ { :ext => '.c', :path => @path_src, :template => TEMPLATE_SRC, :inc => :src, :boilerplate => @boilerplates[:src] },
|
130
|
+
{ :ext => '.h', :path => @path_inc, :template => TEMPLATE_INC, :inc => :inc, :boilerplate => @boilerplates[:inc] },
|
131
|
+
{ :ext => '.c', :path => @path_tst+'Test', :template => TEMPLATE_TST, :inc => :tst, :boilerplate => @boilerplates[:tst] },
|
132
|
+
]
|
133
|
+
|
134
|
+
#prepare the pattern for use
|
135
|
+
@patterns = PATTERNS[@pattern.downcase]
|
136
|
+
raise "ERROR: The design pattern specified isn't one that I recognize!" if @patterns.nil?
|
137
|
+
|
138
|
+
# Assemble the path/names of the files we need to work with.
|
139
|
+
files = []
|
140
|
+
TRIAD.each do |triad|
|
141
|
+
@patterns.each_pair do |pattern_file, pattern_traits|
|
142
|
+
files << {
|
143
|
+
:path => "#{triad[:path]}#{@module_name}#{pattern_file}#{triad[:ext]}",
|
144
|
+
:name => "#{@module_name}#{pattern_file}",
|
145
|
+
:template => triad[:template],
|
146
|
+
:boilerplate => triad[:boilerplate],
|
147
|
+
:includes => case(triad[:inc])
|
148
|
+
when :src then @includes[:src] | pattern_traits[:inc].map{|f| f % [@module_name]}
|
149
|
+
when :inc then @includes[:inc]
|
150
|
+
when :tst then @includes[:tst] | pattern_traits[:inc].map{|f| "Mock#{f}"% [@module_name]}
|
151
|
+
end
|
152
|
+
}
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# destroy files if that was what was requested
|
157
|
+
if @destroy
|
158
|
+
files.each do |filespec|
|
159
|
+
file = filespec[:path]
|
160
|
+
if File.exist?(file)
|
161
|
+
if @update_svn
|
162
|
+
`svn delete \"#{file}\" --force`
|
163
|
+
puts "File #{file} deleted and removed from source control"
|
164
|
+
else
|
165
|
+
FileUtils.remove(file)
|
166
|
+
puts "File #{file} deleted"
|
167
|
+
end
|
168
|
+
else
|
169
|
+
puts "File #{file} does not exist so cannot be removed."
|
170
|
+
end
|
171
|
+
end
|
172
|
+
puts "Destroy Complete"
|
173
|
+
exit
|
174
|
+
end
|
175
|
+
|
176
|
+
#Abort if any module already exists
|
177
|
+
files.each do |file|
|
178
|
+
raise "ERROR: File #{file[:name]} already exists. Exiting." if File.exist?(file[:path])
|
179
|
+
end
|
180
|
+
|
181
|
+
# Create Source Modules
|
182
|
+
files.each_with_index do |file, i|
|
183
|
+
File.open(file[:path], 'w') do |f|
|
184
|
+
f.write(file[:boilerplate] % [file[:name]]) unless file[:boilerplate].nil?
|
185
|
+
f.write(file[:template] % [ file[:name],
|
186
|
+
file[:includes].map{|f| "#include \"#{f}\"\n"}.join,
|
187
|
+
file[:name].upcase ]
|
188
|
+
)
|
189
|
+
end
|
190
|
+
if (@update_svn)
|
191
|
+
`svn add \"#{file[:path]}\"`
|
192
|
+
if $?.exitstatus == 0
|
193
|
+
puts "File #{file[:path]} created and added to source control"
|
194
|
+
else
|
195
|
+
puts "File #{file[:path]} created but FAILED adding to source control!"
|
196
|
+
end
|
197
|
+
else
|
198
|
+
puts "File #{file[:path]} created"
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
puts 'Generate Complete'
|
data/{new_project_template/vendor/ceedling/vendor → vendor}/unity/auto/generate_test_runner.rb
RENAMED
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# ==========================================
|
2
|
+
# Unity Project - A Test Framework for C
|
3
|
+
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
4
|
+
# [Released under MIT License. Please refer to license.txt for details]
|
5
|
+
# ==========================================
|
6
|
+
|
7
|
+
require'yaml'
|
8
|
+
|
9
|
+
module RakefileHelpers
|
10
|
+
class TestFileFilter
|
11
|
+
def initialize(all_files = false)
|
12
|
+
@all_files = all_files
|
13
|
+
if not @all_files == true
|
14
|
+
if File.exist?('test_file_filter.yml')
|
15
|
+
filters = YAML.load_file( 'test_file_filter.yml' )
|
16
|
+
@all_files, @only_files, @exclude_files =
|
17
|
+
filters[:all_files], filters[:only_files], filters[:exclude_files]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
attr_accessor :all_files, :only_files, :exclude_files
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# ==========================================
|
2
|
+
# Unity Project - A Test Framework for C
|
3
|
+
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
4
|
+
# [Released under MIT License. Please refer to license.txt for details]
|
5
|
+
# ==========================================
|
6
|
+
|
7
|
+
#!/usr/bin/ruby
|
8
|
+
#
|
9
|
+
# unity_test_summary.rb
|
10
|
+
#
|
11
|
+
require 'fileutils'
|
12
|
+
require 'set'
|
13
|
+
|
14
|
+
class UnityTestSummary
|
15
|
+
include FileUtils::Verbose
|
16
|
+
|
17
|
+
attr_reader :report, :total_tests, :failures, :ignored
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
@report = ''
|
21
|
+
@total_tests = 0
|
22
|
+
@failures = 0
|
23
|
+
@ignored = 0
|
24
|
+
end
|
25
|
+
|
26
|
+
def run
|
27
|
+
# Clean up result file names
|
28
|
+
results = @targets.map {|target| target.gsub(/\\/,'/')}
|
29
|
+
|
30
|
+
# Dig through each result file, looking for details on pass/fail:
|
31
|
+
failure_output = []
|
32
|
+
ignore_output = []
|
33
|
+
|
34
|
+
results.each do |result_file|
|
35
|
+
lines = File.readlines(result_file).map { |line| line.chomp }
|
36
|
+
if lines.length == 0
|
37
|
+
raise "Empty test result file: #{result_file}"
|
38
|
+
else
|
39
|
+
output = get_details(result_file, lines)
|
40
|
+
failure_output << output[:failures] unless output[:failures].empty?
|
41
|
+
ignore_output << output[:ignores] unless output[:ignores].empty?
|
42
|
+
tests,failures,ignored = parse_test_summary(lines)
|
43
|
+
@total_tests += tests
|
44
|
+
@failures += failures
|
45
|
+
@ignored += ignored
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if @ignored > 0
|
50
|
+
@report += "\n"
|
51
|
+
@report += "--------------------------\n"
|
52
|
+
@report += "UNITY IGNORED TEST SUMMARY\n"
|
53
|
+
@report += "--------------------------\n"
|
54
|
+
@report += ignore_output.flatten.join("\n")
|
55
|
+
end
|
56
|
+
|
57
|
+
if @failures > 0
|
58
|
+
@report += "\n"
|
59
|
+
@report += "--------------------------\n"
|
60
|
+
@report += "UNITY FAILED TEST SUMMARY\n"
|
61
|
+
@report += "--------------------------\n"
|
62
|
+
@report += failure_output.flatten.join("\n")
|
63
|
+
end
|
64
|
+
|
65
|
+
@report += "\n"
|
66
|
+
@report += "--------------------------\n"
|
67
|
+
@report += "OVERALL UNITY TEST SUMMARY\n"
|
68
|
+
@report += "--------------------------\n"
|
69
|
+
@report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n"
|
70
|
+
@report += "\n"
|
71
|
+
end
|
72
|
+
|
73
|
+
def set_targets(target_array)
|
74
|
+
@targets = target_array
|
75
|
+
end
|
76
|
+
|
77
|
+
def set_root_path(path)
|
78
|
+
@root = path
|
79
|
+
end
|
80
|
+
|
81
|
+
def usage(err_msg=nil)
|
82
|
+
puts "\nERROR: "
|
83
|
+
puts err_msg if err_msg
|
84
|
+
puts "\nUsage: unity_test_summary.rb result_file_directoy/ root_path/"
|
85
|
+
puts " result_file_directory - The location of your relults files."
|
86
|
+
puts " Defaults to current directory if not specified."
|
87
|
+
puts " Should end in / if specified."
|
88
|
+
puts " root_path - Helpful for producing more verbose output if using relative paths."
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
protected
|
93
|
+
|
94
|
+
def get_details(result_file, lines)
|
95
|
+
results = { :failures => [], :ignores => [], :successes => [] }
|
96
|
+
lines.each do |line|
|
97
|
+
src_file,src_line,test_name,status,msg = line.split(/:/)
|
98
|
+
line_out = ((@root and (@root != 0)) ? "#{@root}#{line}" : line ).gsub(/\//, "\\")
|
99
|
+
case(status)
|
100
|
+
when 'IGNORE' then results[:ignores] << line_out
|
101
|
+
when 'FAIL' then results[:failures] << line_out
|
102
|
+
when 'PASS' then results[:successes] << line_out
|
103
|
+
end
|
104
|
+
end
|
105
|
+
return results
|
106
|
+
end
|
107
|
+
|
108
|
+
def parse_test_summary(summary)
|
109
|
+
if summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
|
110
|
+
[$1.to_i,$2.to_i,$3.to_i]
|
111
|
+
else
|
112
|
+
raise "Couldn't parse test results: #{summary}"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def here; File.expand_path(File.dirname(__FILE__)); end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
if $0 == __FILE__
|
121
|
+
uts = UnityTestSummary.new
|
122
|
+
begin
|
123
|
+
#look in the specified or current directory for result files
|
124
|
+
ARGV[0] ||= './'
|
125
|
+
targets = "#{ARGV[0].gsub(/\\/, '/')}*.test*"
|
126
|
+
results = Dir[targets]
|
127
|
+
raise "No *.testpass or *.testfail files found in '#{targets}'" if results.empty?
|
128
|
+
uts.set_targets(results)
|
129
|
+
|
130
|
+
#set the root path
|
131
|
+
ARGV[1] ||= File.expand_path(File.dirname(__FILE__)) + '/'
|
132
|
+
uts.set_root_path(ARGV[1])
|
133
|
+
|
134
|
+
#run the summarizer
|
135
|
+
puts uts.run
|
136
|
+
rescue Exception => e
|
137
|
+
uts.usage e.message
|
138
|
+
end
|
139
|
+
end
|