ceedling 0.28.2 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/ceedling +3 -0
- data/assets/ceedling.cmd +1 -0
- data/assets/default_gitignore +5 -0
- data/assets/project_with_guts.yml +1 -0
- data/assets/project_with_guts_gcov.yml +3 -0
- data/assets/test_example_file_verbose.c +12 -0
- data/bin/ceedling +30 -6
- data/docs/CeedlingPacket.md +135 -23
- data/docs/CeedlingPacket.odt +0 -0
- data/examples/blinky/rakefile.rb +2 -1
- data/lib/ceedling/configurator.rb +7 -5
- data/lib/ceedling/configurator_builder.rb +10 -7
- data/lib/ceedling/configurator_plugins.rb +29 -24
- data/lib/ceedling/configurator_setup.rb +0 -1
- data/lib/ceedling/defaults.rb +7 -2
- data/lib/ceedling/dependinator.rb +10 -2
- data/lib/ceedling/file_finder.rb +57 -49
- data/lib/ceedling/file_path_utils.rb +12 -4
- data/lib/ceedling/file_wrapper.rb +4 -0
- data/lib/ceedling/generator.rb +4 -3
- data/lib/ceedling/generator_test_results.rb +15 -13
- data/lib/ceedling/plugin_manager.rb +18 -18
- data/lib/ceedling/plugin_reportinator.rb +3 -2
- data/lib/ceedling/plugin_reportinator_helper.rb +2 -3
- data/lib/ceedling/preprocessinator_extractor.rb +2 -2
- data/lib/ceedling/preprocessinator_includes_handler.rb +5 -0
- data/lib/ceedling/rakefile.rb +1 -0
- data/lib/ceedling/release_invoker_helper.rb +5 -2
- data/lib/ceedling/rules_release.rake +2 -1
- data/lib/ceedling/rules_tests.rake +18 -9
- data/lib/ceedling/rules_tests_deep_dependencies.rake +2 -2
- data/lib/ceedling/task_invoker.rb +15 -3
- data/lib/ceedling/tasks_vendor.rake +3 -3
- data/lib/ceedling/test_invoker.rb +39 -12
- data/lib/ceedling/test_invoker_helper.rb +5 -1
- data/lib/ceedling/tool_executor.rb +8 -4
- data/lib/ceedling/version.rb +1 -1
- data/out.fail +21 -0
- data/plugins/beep/README.md +22 -0
- data/plugins/beep/lib/beep.rb +40 -0
- data/plugins/bullseye/bullseye.rake +43 -36
- data/plugins/bullseye/config/defaults.yml +4 -0
- data/plugins/bullseye/lib/bullseye.rb +27 -5
- data/plugins/command_hooks/lib/command_hooks.rb +3 -0
- data/plugins/gcov/README.md +34 -1
- data/plugins/gcov/config/defaults.yml +3 -3
- data/plugins/gcov/gcov.rake +7 -5
- data/plugins/gcov/lib/gcov.rb +3 -1
- data/plugins/gcov/lib/gcov_constants.rb +2 -0
- data/plugins/junit_tests_report/lib/junit_tests_report.rb +12 -9
- data/plugins/module_generator/lib/module_generator.rb +14 -1
- data/plugins/module_generator/module_generator.rake +21 -4
- data/plugins/raw_output_report/lib/raw_output_report.rb +41 -0
- data/spec/gcov/gcov_deployment_spec.rb +1 -1
- data/spec/gcov/gcov_test_cases_spec.rb +2 -2
- data/spec/generator_test_results_spec.rb +5 -0
- data/spec/preprocessinator_includes_handler_spec.rb +1 -0
- data/spec/spec_system_helper.rb +178 -4
- data/spec/support/test_example.fail +1 -0
- data/spec/support/test_example.pass +1 -0
- data/spec/support/test_example_empty.pass +1 -0
- data/spec/support/test_example_ignore.pass +1 -0
- data/spec/support/test_example_mangled.pass +1 -0
- data/spec/support/test_example_with_time.pass +22 -0
- data/spec/system/deployment_spec.rb +33 -0
- data/vendor/cmock/README.md +4 -3
- data/vendor/cmock/docs/CMock_Summary.md +1 -1
- data/vendor/cmock/lib/cmock_config.rb +4 -0
- data/vendor/cmock/lib/cmock_generator.rb +5 -2
- data/vendor/cmock/lib/cmock_generator_plugin_array.rb +4 -4
- data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +9 -11
- data/vendor/cmock/lib/cmock_generator_plugin_cexception.rb +0 -1
- data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +2 -3
- data/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb +2 -4
- data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +0 -2
- data/vendor/cmock/lib/cmock_generator_utils.rb +16 -3
- data/vendor/cmock/lib/cmock_header_parser.rb +59 -34
- data/vendor/cmock/release/build.info +1 -1
- data/vendor/cmock/release/version.info +1 -1
- data/vendor/cmock/scripts/create_makefile.rb +17 -2
- data/vendor/cmock/src/cmock.c +13 -7
- data/vendor/cmock/test/test_helper.rb +11 -10
- data/vendor/cmock/test/unit/cmock_config_test.rb +4 -2
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +10 -4
- data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +20 -12
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +3 -3
- data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +8 -6
- data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +27 -10
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +108 -20
- data/vendor/cmock/vendor/c_exception/Gemfile +4 -0
- data/vendor/cmock/vendor/c_exception/Gemfile.lock +12 -0
- data/vendor/cmock/vendor/c_exception/LICENSE.txt +30 -0
- data/vendor/cmock/vendor/c_exception/README.md +162 -0
- data/vendor/cmock/vendor/c_exception/Rakefile +42 -0
- data/vendor/cmock/vendor/c_exception/docs/CException.md +292 -0
- data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/c_exception/lib/CException.c +46 -0
- data/vendor/cmock/vendor/c_exception/lib/CException.h +110 -0
- data/vendor/cmock/vendor/c_exception/makefile +24 -0
- data/vendor/cmock/vendor/c_exception/release/build.info +2 -0
- data/vendor/cmock/vendor/c_exception/release/version.info +2 -0
- data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +46 -0
- data/vendor/cmock/vendor/c_exception/test/TestException.c +391 -0
- data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +67 -0
- data/vendor/cmock/vendor/unity/README.md +231 -0
- data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +118 -0
- data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +39 -0
- data/vendor/cmock/vendor/unity/auto/generate_config.yml +36 -0
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +308 -0
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +457 -0
- data/vendor/cmock/vendor/unity/auto/parse_output.rb +323 -0
- data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +252 -0
- data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +25 -0
- data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +6 -0
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +139 -0
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +136 -0
- data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +146 -0
- data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +206 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +779 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +433 -0
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +192 -0
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +260 -0
- data/vendor/cmock/vendor/unity/docs/license.txt +21 -0
- data/vendor/cmock/vendor/unity/examples/example_1/makefile +71 -0
- data/vendor/cmock/vendor/unity/examples/example_1/readme.txt +5 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +24 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +3 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
- data/vendor/cmock/vendor/unity/examples/example_2/makefile +70 -0
- data/vendor/cmock/vendor/unity/examples/example_2/readme.txt +5 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +24 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +3 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
- data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -0
- data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -0
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +43 -0
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +249 -0
- data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +13 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +24 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +3 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -0
- data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +46 -0
- data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -0
- data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -0
- data/vendor/cmock/vendor/unity/examples/unity_config.h +247 -0
- data/vendor/cmock/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +48 -0
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +178 -0
- data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +9 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +436 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +83 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +51 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +47 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +75 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +22 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +543 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +57 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +57 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +17 -0
- data/vendor/cmock/vendor/unity/release/build.info +2 -0
- data/vendor/cmock/vendor/unity/release/version.info +2 -0
- data/vendor/cmock/vendor/unity/src/unity.c +1572 -0
- data/vendor/cmock/vendor/unity/src/unity.h +503 -0
- data/vendor/cmock/vendor/unity/src/unity_internals.h +924 -0
- data/vendor/cmock/vendor/unity/test/Makefile +68 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +61 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +57 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +55 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +15 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +76 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +77 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +67 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +70 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +58 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +67 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +70 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +71 -0
- data/vendor/cmock/vendor/unity/test/rakefile +125 -0
- data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +260 -0
- data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +78 -0
- data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +78 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +49 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +50 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +47 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +47 -0
- data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +101 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +90 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +80 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +95 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -0
- data/vendor/cmock/vendor/unity/test/testdata/CException.h +11 -0
- data/vendor/cmock/vendor/unity/test/testdata/Defs.h +8 -0
- data/vendor/cmock/vendor/unity/test/testdata/cmock.h +14 -0
- data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +13 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +186 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +70 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +195 -0
- data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1252 -0
- data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +113 -0
- data/vendor/cmock/vendor/unity/test/tests/testunity.c +5371 -0
- data/vendor/unity/auto/generate_test_runner.rb +30 -10
- data/vendor/unity/auto/parse_output.rb +212 -109
- data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +9 -10
- data/vendor/unity/docs/UnityAssertionsReference.md +11 -2
- data/vendor/unity/docs/UnityConfigurationGuide.md +90 -55
- data/vendor/unity/docs/UnityGettingStartedGuide.md +6 -5
- data/vendor/unity/docs/UnityHelperScriptsGuide.md +23 -5
- data/vendor/unity/examples/unity_config.h +8 -0
- data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -0
- data/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
- data/vendor/unity/release/build.info +1 -1
- data/vendor/unity/release/version.info +1 -1
- data/vendor/unity/src/unity.c +64 -57
- data/vendor/unity/src/unity.h +111 -7
- data/vendor/unity/src/unity_internals.h +173 -73
- data/vendor/unity/test/Makefile +5 -1
- data/vendor/unity/test/testdata/testRunnerGenerator.c +4 -1
- data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +4 -1
- data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +4 -1
- data/vendor/unity/test/tests/testparameterized.c +5 -2
- data/vendor/unity/test/tests/testunity.c +34 -0
- metadata +150 -2
data/plugins/gcov/gcov.rake
CHANGED
|
@@ -151,26 +151,28 @@ if PROJECT_USE_DEEP_DEPENDENCIES
|
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
namespace UTILS_SYM do
|
|
154
|
-
desc 'Create gcov code coverage html report'
|
|
154
|
+
desc 'Create gcov code coverage html report (must run ceedling gcov first)'
|
|
155
155
|
task GCOV_SYM do
|
|
156
156
|
|
|
157
157
|
if !File.directory? GCOV_ARTIFACTS_PATH
|
|
158
|
-
|
|
158
|
+
FileUtils.mkdir_p GCOV_ARTIFACTS_PATH
|
|
159
159
|
end
|
|
160
160
|
|
|
161
|
+
filter = @ceedling[:configurator].project_config_hash[:gcov_html_report_filter] || GCOV_FILTER_EXPR
|
|
162
|
+
|
|
161
163
|
if @ceedling[:configurator].project_config_hash[:gcov_html_report_type] == 'basic'
|
|
162
164
|
puts "Creating a basic html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
|
|
163
|
-
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [])
|
|
165
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [], filter)
|
|
164
166
|
@ceedling[:tool_executor].exec(command[:line], command[:options])
|
|
165
167
|
elsif @ceedling[:configurator].project_config_hash[:gcov_html_report_type] == 'detailed'
|
|
166
168
|
puts "Creating a detailed html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
|
|
167
|
-
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_ADVANCED, [])
|
|
169
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_ADVANCED, [], filter)
|
|
168
170
|
@ceedling[:tool_executor].exec(command[:line], command[:options])
|
|
169
171
|
else
|
|
170
172
|
puts "In your project.yml, define: \n\n:gcov:\n :html_report_type:\n\n to basic or detailed to refine this feature."
|
|
171
173
|
puts "For now, just creating basic."
|
|
172
174
|
puts "Creating a basic html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
|
|
173
|
-
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [])
|
|
175
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [], filter)
|
|
174
176
|
@ceedling[:tool_executor].exec(command[:line], command[:options])
|
|
175
177
|
end
|
|
176
178
|
puts "Done."
|
data/plugins/gcov/lib/gcov.rb
CHANGED
|
@@ -10,10 +10,12 @@ class Gcov < Plugin
|
|
|
10
10
|
|
|
11
11
|
@config = {
|
|
12
12
|
project_test_build_output_path: GCOV_BUILD_OUTPUT_PATH,
|
|
13
|
+
project_test_build_output_c_path: GCOV_BUILD_OUTPUT_PATH,
|
|
13
14
|
project_test_results_path: GCOV_RESULTS_PATH,
|
|
14
15
|
project_test_dependencies_path: GCOV_DEPENDENCIES_PATH,
|
|
15
16
|
defines_test: DEFINES_TEST + ['CODE_COVERAGE'],
|
|
16
|
-
collection_defines_test_and_vendor: COLLECTION_DEFINES_TEST_AND_VENDOR + ['CODE_COVERAGE']
|
|
17
|
+
collection_defines_test_and_vendor: COLLECTION_DEFINES_TEST_AND_VENDOR + ['CODE_COVERAGE'],
|
|
18
|
+
gcov_html_report_filter: GCOV_FILTER_EXPR
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
@plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
require 'ceedling/plugin'
|
|
2
2
|
require 'ceedling/constants'
|
|
3
|
-
require 'pp'
|
|
4
3
|
|
|
5
4
|
class JunitTestsReport < Plugin
|
|
6
5
|
|
|
7
6
|
def setup
|
|
8
7
|
@results_list = {}
|
|
9
8
|
@test_counter = 0
|
|
9
|
+
@time_result = []
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def post_test_fixture_execute(arg_hash)
|
|
@@ -15,14 +15,15 @@ class JunitTestsReport < Plugin
|
|
|
15
15
|
@results_list[context] = [] if (@results_list[context].nil?)
|
|
16
16
|
|
|
17
17
|
@results_list[context] << arg_hash[:result_file]
|
|
18
|
+
@time_result << arg_hash[:shell_result][:time]
|
|
19
|
+
|
|
18
20
|
end
|
|
19
|
-
|
|
21
|
+
|
|
20
22
|
def post_build
|
|
21
23
|
@results_list.each_key do |context|
|
|
22
24
|
results = @ceedling[:plugin_reportinator].assemble_test_results(@results_list[context])
|
|
23
|
-
|
|
24
25
|
file_path = File.join( PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s, 'report.xml' )
|
|
25
|
-
|
|
26
|
+
|
|
26
27
|
@ceedling[:file_wrapper].open( file_path, 'w' ) do |f|
|
|
27
28
|
@testsuite_counter = 0
|
|
28
29
|
@testcase_counter = 0
|
|
@@ -34,18 +35,19 @@ class JunitTestsReport < Plugin
|
|
|
34
35
|
end
|
|
35
36
|
end
|
|
36
37
|
end
|
|
37
|
-
|
|
38
|
+
|
|
38
39
|
private
|
|
39
40
|
|
|
40
41
|
def write_header( results, stream )
|
|
42
|
+
results[:counts][:time] = @time_result.reduce(0, :+)
|
|
41
43
|
stream.puts '<?xml version="1.0" encoding="utf-8" ?>'
|
|
42
|
-
stream.puts('<testsuites tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d">' % results[:counts])
|
|
44
|
+
stream.puts('<testsuites tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d" time="%<time>f">' % results[:counts])
|
|
43
45
|
end
|
|
44
|
-
|
|
46
|
+
|
|
45
47
|
def write_footer( stream )
|
|
46
48
|
stream.puts '</testsuites>'
|
|
47
49
|
end
|
|
48
|
-
|
|
50
|
+
|
|
49
51
|
def reorganise_results( results )
|
|
50
52
|
# Reorganise the output by test suite instead of by result
|
|
51
53
|
suites = Hash.new{ |h,k| h[k] = {collection: [], total: 0, success: 0, failed: 0, ignored: 0, stdout: []} }
|
|
@@ -79,7 +81,8 @@ class JunitTestsReport < Plugin
|
|
|
79
81
|
end
|
|
80
82
|
|
|
81
83
|
def write_suite( suite, stream )
|
|
82
|
-
|
|
84
|
+
suite[:time] = @time_result.shift
|
|
85
|
+
stream.puts(' <testsuite name="%<name>s" tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d" time="%<time>f">' % suite)
|
|
83
86
|
|
|
84
87
|
suite[:collection].each do |test|
|
|
85
88
|
write_test( test, stream )
|
|
@@ -21,9 +21,14 @@ class ModuleGenerator < Plugin
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
23
|
def divine_options(optz={})
|
|
24
|
+
unity_generator_options =
|
|
24
25
|
{
|
|
25
26
|
:path_src => ((defined? MODULE_GENERATOR_SOURCE_ROOT ) ? MODULE_GENERATOR_SOURCE_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '') : "src" ),
|
|
26
|
-
:path_inc => ((defined?
|
|
27
|
+
:path_inc => ((defined? MODULE_GENERATOR_INC_ROOT ) ?
|
|
28
|
+
MODULE_GENERATOR_INC_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '')
|
|
29
|
+
: (defined? MODULE_GENERATOR_SOURCE_ROOT ) ?
|
|
30
|
+
MODULE_GENERATOR_SOURCE_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '')
|
|
31
|
+
: "src" ),
|
|
27
32
|
:path_tst => ((defined? MODULE_GENERATOR_TEST_ROOT ) ? MODULE_GENERATOR_TEST_ROOT.gsub( '\\', '/').sub(/^\//, '').sub(/\/$/, '') : "test" ),
|
|
28
33
|
:pattern => optz[:pattern],
|
|
29
34
|
:test_prefix => ((defined? PROJECT_TEST_FILE_PREFIX ) ? PROJECT_TEST_FILE_PREFIX : "Test" ),
|
|
@@ -33,6 +38,14 @@ class ModuleGenerator < Plugin
|
|
|
33
38
|
:naming => ((defined? MODULE_GENERATOR_NAMING ) ? MODULE_GENERATOR_NAMING : nil ),
|
|
34
39
|
:update_svn => ((defined? MODULE_GENERATOR_UPDATE_SVN ) ? MODULE_GENERATOR_UPDATE_SVN : false ),
|
|
35
40
|
}
|
|
41
|
+
|
|
42
|
+
unless optz[:module_root_path].to_s.empty?
|
|
43
|
+
unity_generator_options[:path_src] = File.join(optz[:module_root_path], unity_generator_options[:path_src])
|
|
44
|
+
unity_generator_options[:path_inc] = File.join(optz[:module_root_path], unity_generator_options[:path_inc])
|
|
45
|
+
unity_generator_options[:path_tst] = File.join(optz[:module_root_path], unity_generator_options[:path_tst])
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
return unity_generator_options
|
|
36
49
|
end
|
|
37
50
|
|
|
38
51
|
end
|
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
|
|
2
2
|
namespace :module do
|
|
3
|
+
module_root_separator = ":"
|
|
3
4
|
|
|
4
5
|
desc "Generate module (source, header and test files)"
|
|
5
6
|
task :create, :module_path do |t, args|
|
|
6
7
|
files = [args[:module_path]] + (args.extras || [])
|
|
7
|
-
optz = {}
|
|
8
|
+
optz = { :module_root_path => "" }
|
|
8
9
|
["dh", "dih", "mch", "mvp", "src", "test"].each do |pat|
|
|
9
10
|
p = files.delete(pat)
|
|
10
11
|
optz[:pattern] = p unless p.nil?
|
|
11
12
|
end
|
|
12
|
-
files.each {
|
|
13
|
+
files.each {
|
|
14
|
+
|v|
|
|
15
|
+
module_root_path, module_name = v.split(module_root_separator, 2)
|
|
16
|
+
if module_name
|
|
17
|
+
optz[:module_root_path] = module_root_path
|
|
18
|
+
v = module_name
|
|
19
|
+
end
|
|
20
|
+
@ceedling[:module_generator].create(v, optz)
|
|
21
|
+
}
|
|
13
22
|
end
|
|
14
23
|
|
|
15
24
|
desc "Destroy module (source, header and test files)"
|
|
16
25
|
task :destroy, :module_path do |t, args|
|
|
17
26
|
files = [args[:module_path]] + (args.extras || [])
|
|
18
|
-
optz = { :destroy => true }
|
|
27
|
+
optz = { :destroy => true, :module_root_path => "" }
|
|
19
28
|
["dh", "dih", "mch", "mvp", "src", "test"].each do |pat|
|
|
20
29
|
p = files.delete(pat)
|
|
21
30
|
optz[:pattern] = p unless p.nil?
|
|
22
31
|
end
|
|
23
|
-
files.each {
|
|
32
|
+
files.each {
|
|
33
|
+
|v|
|
|
34
|
+
module_root_path, module_name = v.split(module_root_separator, 2)
|
|
35
|
+
if module_name
|
|
36
|
+
optz[:module_root_path] = module_root_path
|
|
37
|
+
v = module_name
|
|
38
|
+
end
|
|
39
|
+
@ceedling[:module_generator].create(v, optz)
|
|
40
|
+
}
|
|
24
41
|
end
|
|
25
42
|
|
|
26
43
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'ceedling/plugin'
|
|
2
|
+
require 'ceedling/constants'
|
|
3
|
+
|
|
4
|
+
class RawOutputReport < Plugin
|
|
5
|
+
def setup
|
|
6
|
+
@log_paths = {}
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def post_test_fixture_execute(arg_hash)
|
|
10
|
+
output = strip_output(arg_hash[:shell_result][:output])
|
|
11
|
+
write_raw_output_log(arg_hash, output)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def strip_output(raw_output)
|
|
17
|
+
output = ""
|
|
18
|
+
raw_output.each_line do |line|
|
|
19
|
+
next if line =~ /^\n$/
|
|
20
|
+
next if line =~ /^.*:\d+:.*:(IGNORE|PASS|FAIL)/
|
|
21
|
+
return output if line =~/^-----------------------\n$/
|
|
22
|
+
output << line
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
def write_raw_output_log(arg_hash, output)
|
|
26
|
+
logging = generate_log_path(arg_hash)
|
|
27
|
+
@ceedling[:file_wrapper].write(logging[:path], output , logging[:flags]) unless logging.nil?
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def generate_log_path(arg_hash)
|
|
31
|
+
f_name = File.basename(arg_hash[:result_file], '.pass')
|
|
32
|
+
base_path = File.join(PROJECT_BUILD_ARTIFACTS_ROOT, arg_hash[:context].to_s)
|
|
33
|
+
file_path = File.join(base_path, f_name + '.log')
|
|
34
|
+
|
|
35
|
+
if @ceedling[:file_wrapper].exist?(base_path)
|
|
36
|
+
return { path: file_path, flags: 'w' }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
nil
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -44,7 +44,7 @@ describe "Ceedling" do
|
|
|
44
44
|
it "should be testable" do
|
|
45
45
|
@c.with_context do
|
|
46
46
|
Dir.chdir "temp_sensor" do
|
|
47
|
-
@output = `bundle exec ruby -S ceedling gcov:all`
|
|
47
|
+
@output = `bundle exec ruby -S ceedling gcov:all 2>&1`
|
|
48
48
|
expect(@output).to match(/TESTED:\s+47/)
|
|
49
49
|
expect(@output).to match(/PASSED:\s+47/)
|
|
50
50
|
|
|
@@ -33,7 +33,7 @@ module GcovTestCases
|
|
|
33
33
|
FileUtils.cp test_asset_path("example_file.c"), 'src/'
|
|
34
34
|
FileUtils.cp test_asset_path("test_example_file.c"), 'test/'
|
|
35
35
|
|
|
36
|
-
output = `bundle exec ruby -S ceedling gcov:all`
|
|
36
|
+
output = `bundle exec ruby -S ceedling gcov:all 2>&1`
|
|
37
37
|
expect($?.exitstatus).to match(1) # Since a test fails, we return error here
|
|
38
38
|
expect(output).to match(/TESTED:\s+\d/)
|
|
39
39
|
expect(output).to match(/PASSED:\s+\d/)
|
|
@@ -51,7 +51,7 @@ module GcovTestCases
|
|
|
51
51
|
FileUtils.cp test_asset_path("example_file.c"), 'src/'
|
|
52
52
|
FileUtils.cp test_asset_path("test_example_file_boom.c"), 'test/'
|
|
53
53
|
|
|
54
|
-
output = `bundle exec ruby -S ceedling test:all`
|
|
54
|
+
output = `bundle exec ruby -S ceedling test:all 2>&1`
|
|
55
55
|
expect($?.exitstatus).to match(1) # Since a test explodes, we return error here
|
|
56
56
|
expect(output).to match(/ERROR: Ceedling Failed/)
|
|
57
57
|
end
|
|
@@ -82,6 +82,11 @@ describe GeneratorTestResults do
|
|
|
82
82
|
expect(IO.read(TEST_OUT_FILE)).to eq(IO.read('spec/support/test_example.pass'))
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
+
it 'handles a normal test output with time' do
|
|
86
|
+
@generate_test_results.process_and_write_results({:output => NORMAL_OUTPUT, :time => 0.01234}, TEST_OUT_FILE, 'some/place/test_example.c')
|
|
87
|
+
expect(IO.read(TEST_OUT_FILE)).to eq(IO.read('spec/support/test_example_with_time.pass'))
|
|
88
|
+
end
|
|
89
|
+
|
|
85
90
|
it 'handles a normal test output with ignores' do
|
|
86
91
|
@generate_test_results.process_and_write_results({:output => IGNORE_OUTPUT}, TEST_OUT_FILE, 'some/place/test_example.c')
|
|
87
92
|
expect(IO.read(TEST_OUT_FILE)).to eq(IO.read('spec/support/test_example_ignore.pass'))
|
|
@@ -42,6 +42,7 @@ describe PreprocessinatorIncludesHandler do
|
|
|
42
42
|
expect(@file_path_utils).to receive(:form_temp_path).with('some_source_file.c','_').and_return('_some_source_file.c')
|
|
43
43
|
contents_double = double('contents-double')
|
|
44
44
|
expect(@file_wrapper).to receive(:read).with('some_source_file.c').and_return(contents_double)
|
|
45
|
+
expect(contents_double).to receive(:valid_encoding?).and_return(true)
|
|
45
46
|
expect(contents_double).to receive(:gsub!).with(/^\s*#include\s+[\"<]\s*(\S+)\s*[\">]/, "#include \"\\1\"\n#include \"@@@@\\1\"")
|
|
46
47
|
expect(contents_double).to receive(:gsub!).with(/^\s*TEST_FILE\(\s*\"\s*(\S+)\s*\"\s*\)/, "#include \"\\1\"\n#include \"@@@@\\1\"")
|
|
47
48
|
expect(@file_wrapper).to receive(:write).with('_some_source_file.c', contents_double)
|
data/spec/spec_system_helper.rb
CHANGED
|
@@ -2,6 +2,12 @@ require 'fileutils'
|
|
|
2
2
|
require 'tmpdir'
|
|
3
3
|
require 'yaml'
|
|
4
4
|
|
|
5
|
+
Modulegenerator = Struct.new(:project_root, :source_root, :inc_root, :test_root) do
|
|
6
|
+
def initialize(project_root: "./", source_root: "src/", inc_root: "src/", test_root: "test/")
|
|
7
|
+
super(project_root, source_root, inc_root, test_root)
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
5
11
|
def test_asset_path(asset_file_name)
|
|
6
12
|
File.join(File.dirname(__FILE__), '..', 'assets', asset_file_name)
|
|
7
13
|
end
|
|
@@ -14,6 +20,55 @@ def convert_slashes(path)
|
|
|
14
20
|
end
|
|
15
21
|
end
|
|
16
22
|
|
|
23
|
+
def _add_path_in_section(project_file_path, path, section)
|
|
24
|
+
project_file_contents = File.readlines(project_file_path)
|
|
25
|
+
paths_index = project_file_contents.index(":paths:\n")
|
|
26
|
+
|
|
27
|
+
if paths_index.nil?
|
|
28
|
+
# Something wrong with project.yml file, no paths?
|
|
29
|
+
return
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
section_index = paths_index + project_file_contents[paths_index..-1].index(" :#{section}:\n")
|
|
33
|
+
|
|
34
|
+
project_file_contents.insert(section_index + 1, " - #{path}\n")
|
|
35
|
+
|
|
36
|
+
File.open(project_file_path, "w+") do |f|
|
|
37
|
+
f.puts(project_file_contents)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def add_source_path(path)
|
|
42
|
+
_add_path_in_section("project.yml", path, "source")
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def add_test_path(path)
|
|
46
|
+
_add_path_in_section("project.yml", path, "test")
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def add_module_generator_section(project_file_path, mod_gen)
|
|
50
|
+
project_file_contents = File.readlines(project_file_path)
|
|
51
|
+
module_gen_index = project_file_contents.index(":module_generator:\n")
|
|
52
|
+
|
|
53
|
+
unless module_gen_index.nil?
|
|
54
|
+
# already a module_generator in project file, delete it
|
|
55
|
+
module_gen_end_index = project_file_contents[module_gen_index..-1].index("\n")
|
|
56
|
+
project_file_contents.slice[module_gen_index..module_gen_end_index]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
project_file_contents.insert(-2, "\n")
|
|
60
|
+
project_file_contents.insert(-2, ":module_generator:\n")
|
|
61
|
+
project_file_contents.insert(-2, " :project_root: #{mod_gen.project_root}\n")
|
|
62
|
+
project_file_contents.insert(-2, " :source_root: #{mod_gen.source_root}\n")
|
|
63
|
+
project_file_contents.insert(-2, " :inc_root: #{mod_gen.inc_root}\n")
|
|
64
|
+
project_file_contents.insert(-2, " :test_root: #{mod_gen.test_root}\n")
|
|
65
|
+
project_file_contents.insert(-2, "\n")
|
|
66
|
+
|
|
67
|
+
File.open(project_file_path, "w+") do |f|
|
|
68
|
+
f.puts(project_file_contents)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
17
72
|
class GemDirLayout
|
|
18
73
|
attr_reader :gem_dir_base_name
|
|
19
74
|
|
|
@@ -131,6 +186,14 @@ module CeedlingTestCases
|
|
|
131
186
|
end
|
|
132
187
|
end
|
|
133
188
|
|
|
189
|
+
def has_an_ignore
|
|
190
|
+
@c.with_context do
|
|
191
|
+
Dir.chdir @proj_name do
|
|
192
|
+
expect(File.exists?(".gitignore")).to eq true
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
134
197
|
def can_upgrade_projects
|
|
135
198
|
@c.with_context do
|
|
136
199
|
output = `bundle exec ruby -S ceedling upgrade #{@proj_name} 2>&1`
|
|
@@ -187,7 +250,7 @@ module CeedlingTestCases
|
|
|
187
250
|
FileUtils.cp test_asset_path("example_file.c"), 'src/'
|
|
188
251
|
FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/'
|
|
189
252
|
|
|
190
|
-
output = `bundle exec ruby -S ceedling test:all`
|
|
253
|
+
output = `bundle exec ruby -S ceedling test:all 2>&1`
|
|
191
254
|
expect($?.exitstatus).to match(0) # Since a test either pass or are ignored, we return success here
|
|
192
255
|
expect(output).to match(/TESTED:\s+\d/)
|
|
193
256
|
expect(output).to match(/PASSED:\s+\d/)
|
|
@@ -204,7 +267,7 @@ module CeedlingTestCases
|
|
|
204
267
|
FileUtils.cp test_asset_path("example_file.c"), 'src/'
|
|
205
268
|
FileUtils.cp test_asset_path("test_example_file.c"), 'test/'
|
|
206
269
|
|
|
207
|
-
output = `bundle exec ruby -S ceedling test:all`
|
|
270
|
+
output = `bundle exec ruby -S ceedling test:all 2>&1`
|
|
208
271
|
expect($?.exitstatus).to match(1) # Since a test fails, we return error here
|
|
209
272
|
expect(output).to match(/TESTED:\s+\d/)
|
|
210
273
|
expect(output).to match(/PASSED:\s+\d/)
|
|
@@ -221,13 +284,31 @@ module CeedlingTestCases
|
|
|
221
284
|
FileUtils.cp test_asset_path("example_file.c"), 'src/'
|
|
222
285
|
FileUtils.cp test_asset_path("test_example_file_boom.c"), 'test/'
|
|
223
286
|
|
|
224
|
-
output = `bundle exec ruby -S ceedling test:all`
|
|
287
|
+
output = `bundle exec ruby -S ceedling test:all 2>&1`
|
|
225
288
|
expect($?.exitstatus).to match(1) # Since a test explodes, we return error here
|
|
226
289
|
expect(output).to match(/ERROR: Ceedling Failed/)
|
|
227
290
|
end
|
|
228
291
|
end
|
|
229
292
|
end
|
|
230
293
|
|
|
294
|
+
def uses_raw_output_report_plugin
|
|
295
|
+
@c.with_context do
|
|
296
|
+
Dir.chdir @proj_name do
|
|
297
|
+
FileUtils.cp test_asset_path("example_file.h"), 'src/'
|
|
298
|
+
FileUtils.cp test_asset_path("example_file.c"), 'src/'
|
|
299
|
+
FileUtils.cp test_asset_path("test_example_file_verbose.c"), 'test/'
|
|
300
|
+
|
|
301
|
+
output = `bundle exec ruby -S ceedling test:all 2>&1`
|
|
302
|
+
expect($?.exitstatus).to match(0) # Since a test either pass or are ignored, we return success here
|
|
303
|
+
expect(output).to match(/TESTED:\s+\d/)
|
|
304
|
+
expect(output).to match(/PASSED:\s+\d/)
|
|
305
|
+
expect(output).to match(/FAILED:\s+\d/)
|
|
306
|
+
expect(output).to match(/IGNORED:\s+\d/)
|
|
307
|
+
expect(File.exists?("build/artifacts/test/test_example_file_verbose.log")).to eq true
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
|
|
231
312
|
|
|
232
313
|
def can_fetch_non_project_help
|
|
233
314
|
@c.with_context do
|
|
@@ -272,10 +353,71 @@ module CeedlingTestCases
|
|
|
272
353
|
output = `bundle exec ruby -S ceedling module:destroy[ponies]`
|
|
273
354
|
expect($?.exitstatus).to match(0)
|
|
274
355
|
expect(output).to match(/Destroy Complete/i)
|
|
356
|
+
|
|
357
|
+
self.can_use_the_module_plugin_path_extension
|
|
358
|
+
self.can_use_the_module_plugin_with_include_path
|
|
275
359
|
end
|
|
276
360
|
end
|
|
277
361
|
end
|
|
278
362
|
|
|
363
|
+
def can_use_the_module_plugin_path_extension
|
|
364
|
+
@c.with_context do
|
|
365
|
+
Dir.chdir @proj_name do
|
|
366
|
+
# Module creation
|
|
367
|
+
output = `bundle exec ruby -S ceedling module:create[myPonies:ponies]`
|
|
368
|
+
expect($?.exitstatus).to match(0)
|
|
369
|
+
expect(output).to match(/Generate Complete/i)
|
|
370
|
+
expect(File.exists?("myPonies/src/ponies.c")).to eq true
|
|
371
|
+
expect(File.exists?("myPonies/src/ponies.h")).to eq true
|
|
372
|
+
expect(File.exists?("myPonies/test/test_ponies.c")).to eq true
|
|
373
|
+
|
|
374
|
+
# add module path to project file
|
|
375
|
+
add_test_path("myPonies/test")
|
|
376
|
+
add_source_path("myPonies/src")
|
|
377
|
+
|
|
378
|
+
# See if ceedling finds the test in the subdir
|
|
379
|
+
output = `bundle exec ruby -S ceedling test:all`
|
|
380
|
+
expect($?.exitstatus).to match(0)
|
|
381
|
+
expect(output).to match(/Need to Implement ponies/)
|
|
382
|
+
|
|
383
|
+
# Module destruction
|
|
384
|
+
output = `bundle exec ruby -S ceedling module:destroy[myPonies:ponies]`
|
|
385
|
+
expect($?.exitstatus).to match(0)
|
|
386
|
+
expect(output).to match(/Destroy Complete/i)
|
|
387
|
+
expect(File.exists?("myPonies/src/ponies.c")).to eq false
|
|
388
|
+
expect(File.exists?("myPonies/src/ponies.h")).to eq false
|
|
389
|
+
expect(File.exists?("myPonies/test/test_ponies.c")).to eq false
|
|
390
|
+
end
|
|
391
|
+
end
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
def can_use_the_module_plugin_with_include_path
|
|
395
|
+
@c.with_context do
|
|
396
|
+
Dir.chdir @proj_name do
|
|
397
|
+
# add include path to module generator
|
|
398
|
+
mod_gen = Modulegenerator.new(inc_root: "inc/")
|
|
399
|
+
add_module_generator_section("project.yml", mod_gen)
|
|
400
|
+
|
|
401
|
+
# module creation
|
|
402
|
+
output = `bundle exec ruby -S ceedling module:create[myPonies:ponies]`
|
|
403
|
+
expect($?.exitstatus).to match(0)
|
|
404
|
+
expect(output).to match(/Generate Complete/i)
|
|
405
|
+
expect(File.exists?("myPonies/src/ponies.c")).to eq true
|
|
406
|
+
expect(File.exists?("myPonies/inc/ponies.h")).to eq true
|
|
407
|
+
expect(File.exists?("myPonies/test/test_ponies.c")).to eq true
|
|
408
|
+
|
|
409
|
+
# Module destruction
|
|
410
|
+
output = `bundle exec ruby -S ceedling module:destroy[myPonies:ponies]`
|
|
411
|
+
expect($?.exitstatus).to match(0)
|
|
412
|
+
expect(output).to match(/Destroy Complete/i)
|
|
413
|
+
expect(File.exists?("myPonies/src/ponies.c")).to eq false
|
|
414
|
+
expect(File.exists?("myPonies/inc/ponies.h")).to eq false
|
|
415
|
+
expect(File.exists?("myPonies/test/test_ponies.c")).to eq false
|
|
416
|
+
end
|
|
417
|
+
end
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
|
|
279
421
|
def handles_creating_the_same_module_twice_using_the_module_plugin
|
|
280
422
|
@c.with_context do
|
|
281
423
|
Dir.chdir @proj_name do
|
|
@@ -283,7 +425,23 @@ module CeedlingTestCases
|
|
|
283
425
|
expect($?.exitstatus).to match(0)
|
|
284
426
|
expect(output).to match(/Generate Complete/i)
|
|
285
427
|
|
|
286
|
-
output = `bundle exec ruby -S ceedling module:create[unicorns]`
|
|
428
|
+
output = `bundle exec ruby -S ceedling module:create[unicorns] 2>&1`
|
|
429
|
+
expect($?.exitstatus).to match(1)
|
|
430
|
+
expect(output).to match(/ERROR: Ceedling Failed/)
|
|
431
|
+
|
|
432
|
+
self.handles_creating_the_same_module_twice_using_the_module_plugin_path_extension
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
def handles_creating_the_same_module_twice_using_the_module_plugin
|
|
438
|
+
@c.with_context do
|
|
439
|
+
Dir.chdir @proj_name do
|
|
440
|
+
output = `bundle exec ruby -S ceedling module:create[myUnicorn:unicorns]`
|
|
441
|
+
expect($?.exitstatus).to match(0)
|
|
442
|
+
expect(output).to match(/Generate Complete/i)
|
|
443
|
+
|
|
444
|
+
output = `bundle exec ruby -S ceedling module:create[myUnicorn:unicorns] 2>&1`
|
|
287
445
|
expect($?.exitstatus).to match(1)
|
|
288
446
|
expect(output).to match(/ERROR: Ceedling Failed/)
|
|
289
447
|
end
|
|
@@ -300,6 +458,22 @@ module CeedlingTestCases
|
|
|
300
458
|
expect(output).to match(/File src\/unknown\.h does not exist so cannot be removed\./)
|
|
301
459
|
expect(output).to match(/File test\/test_unknown\.c does not exist so cannot be removed\./)
|
|
302
460
|
expect(output).to match(/Destroy Complete/)
|
|
461
|
+
|
|
462
|
+
self.handles_destroying_a_module_that_does_not_exist_using_the_module_plugin_path_extension
|
|
463
|
+
end
|
|
464
|
+
end
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
def handles_destroying_a_module_that_does_not_exist_using_the_module_plugin_path_extension
|
|
468
|
+
@c.with_context do
|
|
469
|
+
Dir.chdir @proj_name do
|
|
470
|
+
output = `bundle exec ruby -S ceedling module:destroy[myUnknownModule:unknown]`
|
|
471
|
+
expect($?.exitstatus).to match(0)
|
|
472
|
+
|
|
473
|
+
expect(output).to match(/File myUnknownModule\/src\/unknown\.c does not exist so cannot be removed\./)
|
|
474
|
+
expect(output).to match(/File myUnknownModule\/src\/unknown\.h does not exist so cannot be removed\./)
|
|
475
|
+
expect(output).to match(/File myUnknownModule\/test\/test_unknown\.c does not exist so cannot be removed\./)
|
|
476
|
+
expect(output).to match(/Destroy Complete/)
|
|
303
477
|
end
|
|
304
478
|
end
|
|
305
479
|
end
|