From 1f99b5023492e1a30c1a24af4f1d15de5d48e4dc Mon Sep 17 00:00:00 2001 From: Mike Karlesky Date: Fri, 17 May 2024 16:50:47 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Removed=20:cmdline=5Fargs=20refe?= =?UTF-8?q?rences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option is now automatically set by test case filter CLI handling and by the backtrace feature. It does not need to be called out separately in most cases. --- assets/project_with_guts.yml | 4 -- assets/project_with_guts_gcov.yml | 4 -- examples/temp_sensor/project.yml | 4 -- plugins/dependencies/example/boss/project.yml | 4 -- .../example/supervisor/project.yml | 4 -- plugins/module_generator/example/project.yml | 4 -- spec/gcov/gcov_deployment_spec.rb | 6 +-- spec/gcov/gcov_test_cases_spec.rb | 8 ++- spec/spec_system_helper.rb | 50 +++---------------- spec/system/deployment_as_gem_spec.rb | 14 +++--- spec/system/deployment_as_vendor_spec.rb | 14 +++--- 11 files changed, 28 insertions(+), 88 deletions(-) diff --git a/assets/project_with_guts.yml b/assets/project_with_guts.yml index 102bc2c4..5f051ffc 100644 --- a/assets/project_with_guts.yml +++ b/assets/project_with_guts.yml @@ -202,10 +202,6 @@ :defines: - UNITY_EXCLUDE_FLOAT -# Configuration options specify to Unity's test runner generator -:test_runner: - :cmdline_args: FALSE - # You can optionally have ceedling create environment variables for you before # performing the rest of its tasks. :environment: [] diff --git a/assets/project_with_guts_gcov.yml b/assets/project_with_guts_gcov.yml index 445b4207..03512cfd 100644 --- a/assets/project_with_guts_gcov.yml +++ b/assets/project_with_guts_gcov.yml @@ -202,10 +202,6 @@ :defines: - UNITY_EXCLUDE_FLOAT -# Configuration options specify to Unity's test runner generator -:test_runner: - :cmdline_args: FALSE - # You can optionally have ceedling create environment variables for you before # performing the rest of its tasks. :environment: [] diff --git a/examples/temp_sensor/project.yml b/examples/temp_sensor/project.yml index e99209a5..8854affb 100644 --- a/examples/temp_sensor/project.yml +++ b/examples/temp_sensor/project.yml @@ -148,10 +148,6 @@ int8: INT8 bool: UINT8 -# Configuration options specific to Unity's test runner generator -:test_runner: - :cmdline_args: TRUE - # You can optionally have ceedling create environment variables for you before # performing the rest of its tasks. :environment: [] diff --git a/plugins/dependencies/example/boss/project.yml b/plugins/dependencies/example/boss/project.yml index 710036d9..e54470cc 100644 --- a/plugins/dependencies/example/boss/project.yml +++ b/plugins/dependencies/example/boss/project.yml @@ -198,10 +198,6 @@ :defines: - UNITY_EXCLUDE_FLOAT -# Configuration options specify to Unity's test runner generator -:test_runner: - :cmdline_args: FALSE - # You can optionally have ceedling create environment variables for you before # performing the rest of its tasks. :environment: [] diff --git a/plugins/dependencies/example/supervisor/project.yml b/plugins/dependencies/example/supervisor/project.yml index dd489084..eff487ef 100644 --- a/plugins/dependencies/example/supervisor/project.yml +++ b/plugins/dependencies/example/supervisor/project.yml @@ -139,10 +139,6 @@ :defines: - UNITY_EXCLUDE_FLOAT -# Configuration options specify to Unity's test runner generator -:test_runner: - :cmdline_args: FALSE - # You can optionally have ceedling create environment variables for you before # performing the rest of its tasks. :environment: [] diff --git a/plugins/module_generator/example/project.yml b/plugins/module_generator/example/project.yml index ff67b808..753de2e7 100644 --- a/plugins/module_generator/example/project.yml +++ b/plugins/module_generator/example/project.yml @@ -145,10 +145,6 @@ :defines: - UNITY_EXCLUDE_FLOAT -# Configuration options specific to Unity's test runner generator -:test_runner: - :cmdline_args: FALSE - # You can optionally have ceedling create environment variables for you before # performing the rest of its tasks. :environment: [] diff --git a/spec/gcov/gcov_deployment_spec.rb b/spec/gcov/gcov_deployment_spec.rb index 6155b5c9..29187be2 100644 --- a/spec/gcov/gcov_deployment_spec.rb +++ b/spec/gcov/gcov_deployment_spec.rb @@ -40,9 +40,9 @@ it { can_test_projects_with_gcov_with_compile_error } it { can_fetch_project_help_for_gcov } it { can_create_html_report } - it { can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_and_cmd_args_set_to_true_for_test_cases_not_causing_crash } - it { can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_and_cmd_args_set_to_true_with_zero_coverage } - it { can_create_gcov_html_report_from_test_runner_with_enabled_debug_and_cmd_args_set_to_true_with_100_coverage_when_excluding_crashing_test_case } + it { can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_for_test_cases_not_causing_crash } + it { can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_with_zero_coverage } + it { can_create_gcov_html_report_from_test_runner_with_enabled_debug_with_100_coverage_when_excluding_crashing_test_case } end diff --git a/spec/gcov/gcov_test_cases_spec.rb b/spec/gcov/gcov_test_cases_spec.rb index 4c325955..d143c593 100644 --- a/spec/gcov/gcov_test_cases_spec.rb +++ b/spec/gcov/gcov_test_cases_spec.rb @@ -203,7 +203,7 @@ def can_create_html_report end end - def can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_and_cmd_args_set_to_true_for_test_cases_not_causing_crash + def can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_for_test_cases_not_causing_crash @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' @@ -233,7 +233,7 @@ def can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_and end end - def can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_and_cmd_args_set_to_true_with_zero_coverage + def can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_with_zero_coverage @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' @@ -264,7 +264,7 @@ def can_create_gcov_html_report_from_crashing_test_runner_with_enabled_debug_and end end - def can_create_gcov_html_report_from_test_runner_with_enabled_debug_and_cmd_args_set_to_true_with_100_coverage_when_excluding_crashing_test_case + def can_create_gcov_html_report_from_test_runner_with_enabled_debug_with_100_coverage_when_excluding_crashing_test_case @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' @@ -272,8 +272,6 @@ def can_create_gcov_html_report_from_test_runner_with_enabled_debug_and_cmd_args FileUtils.cp test_asset_path("test_example_file_crash.c"), 'test/' FileUtils.cp test_asset_path("project_with_guts_gcov.yml"), 'project.yml' - @c.merge_project_yml_for_test({:test_runner => { :cmdline_args => true }}) - add_test_case = "\nvoid test_difference_between_two_numbers(void)\n"\ "{\n" \ " TEST_ASSERT_EQUAL_INT(0, difference_between_numbers(1,1));\n" \ diff --git a/spec/spec_system_helper.rb b/spec/spec_system_helper.rb index 7c041025..b5641a6b 100644 --- a/spec/spec_system_helper.rb +++ b/spec/spec_system_helper.rb @@ -390,24 +390,6 @@ def can_test_projects_with_test_and_vendor_defines_with_success end end - def can_test_projects_with_enabled_auto_link_deep_deependency_with_success - @c.with_context do - Dir.chdir @proj_name do - FileUtils.copy_entry test_asset_path("auto_link_deep_dependencies/src/"), 'src/' - FileUtils.cp_r test_asset_path("auto_link_deep_dependencies/test/."), 'test/' - settings = { :project => { :auto_link_deep_dependencies => true } } - @c.merge_project_yml_for_test(settings) - - output = `bundle exec ruby -S ceedling 2>&1` - expect($?.exitstatus).to match(0) # Since a test either pass or are ignored, we return success here - expect(output).to match(/TESTED:\s+\d/) - expect(output).to match(/PASSED:\s+\d/) - expect(output).to match(/FAILED:\s+\d/) - expect(output).to match(/IGNORED:\s+\d/) - end - end - end - def can_test_projects_with_test_name_replaced_defines_with_success @c.with_context do Dir.chdir @proj_name do @@ -558,21 +540,17 @@ def can_fetch_project_help expect(output).to match(/ceedling summary/i) expect(output).to match(/ceedling test:\*/i) expect(output).to match(/ceedling test:all/i) - #expect(output).to match(/ceedling test:delta/i) #feature temporarily removed expect(output).to match(/ceedling version/i) end end end - def can_run_single_test_with_full_test_case_name_from_test_file_with_success_cmdline_args_are_enabled + def can_run_single_test_with_full_test_case_name_from_test_file_with_success @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' FileUtils.cp test_asset_path("example_file.c"), 'src/' FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/' - enable_unity_extra_args = "\n:test_runner:\n"\ - " :cmdline_args: true\n" - @c.append_project_yml_for_test(enable_unity_extra_args) output = `bundle exec ruby -S ceedling test:test_example_file_success --test_case=test_add_numbers_adds_numbers 2>&1` @@ -585,15 +563,12 @@ def can_run_single_test_with_full_test_case_name_from_test_file_with_success_cmd end end - def can_run_single_test_with_partiall_test_case_name_from_test_file_with_enabled_cmdline_args_success + def can_run_single_test_with_partial_test_case_name_from_test_file_with_success @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' FileUtils.cp test_asset_path("example_file.c"), 'src/' FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/' - enable_unity_extra_args = "\n:test_runner:\n"\ - " :cmdline_args: true\n" - @c.append_project_yml_for_test(enable_unity_extra_args) output = `bundle exec ruby -S ceedling test:test_example_file_success --test_case=_adds_numbers 2>&1` @@ -606,15 +581,12 @@ def can_run_single_test_with_partiall_test_case_name_from_test_file_with_enabled end end - def none_of_test_is_executed_if_test_case_name_passed_does_not_fit_defined_in_test_file_and_cmdline_args_are_enabled + def none_of_test_is_executed_if_test_case_name_passed_does_not_fit_defined_in_test_file @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' FileUtils.cp test_asset_path("example_file.c"), 'src/' FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/' - enable_unity_extra_args = "\n:test_runner:\n"\ - " :cmdline_args: true\n" - @c.append_project_yml_for_test(enable_unity_extra_args) output = `bundle exec ruby -S ceedling test:test_example_file_success --test_case=zumzum 2>&1` @@ -630,9 +602,6 @@ def none_of_test_is_executed_if_test_case_name_and_exclude_test_case_name_is_the FileUtils.cp test_asset_path("example_file.h"), 'src/' FileUtils.cp test_asset_path("example_file.c"), 'src/' FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/' - enable_unity_extra_args = "\n:test_runner:\n"\ - " :cmdline_args: true\n" - @c.append_project_yml_for_test(enable_unity_extra_args) output = `bundle exec ruby -S ceedling test:test_example_file_success --test_case=_adds_numbers --exclude_test_case=_adds_numbers 2>&1` @@ -656,7 +625,7 @@ def confirm_if_notification_for_cmdline_args_not_enabled_is_disabled expect(output).to match(/PASSED:\s+1/) expect(output).to match(/FAILED:\s+0/) expect(output).to match(/IGNORED:\s+1/) - expect(output).not_to match(/please add `:cmdline_args` under :test_runner option/) + expect(output).not_to match(/:cmdline_args/) end end end @@ -667,9 +636,6 @@ def exclude_test_case_name_filter_works_and_only_one_test_case_is_executed FileUtils.cp test_asset_path("example_file.h"), 'src/' FileUtils.cp test_asset_path("example_file.c"), 'src/' FileUtils.cp test_asset_path("test_example_file_success.c"), 'test/' - enable_unity_extra_args = "\n:test_runner:\n"\ - " :cmdline_args: true\n" - @c.append_project_yml_for_test(enable_unity_extra_args) output = `bundle exec ruby -S ceedling test:all --exclude_test_case=test_add_numbers_adds_numbers 2>&1` @@ -682,7 +648,7 @@ def exclude_test_case_name_filter_works_and_only_one_test_case_is_executed end end - def run_all_test_when_test_case_name_is_passed_it_will_autoset_cmdline_args + def run_one_testcase_from_one_test_file_when_test_case_name_is_passed @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' @@ -737,7 +703,7 @@ def test_run_of_projects_fail_because_of_crash_with_report end end - def execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with_failue_when_cmd_args_set_to_true + def execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with_failue @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' @@ -761,7 +727,7 @@ def execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with end end - def execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_argument_with_enabled_debug_and_cmd_args_set_to_true + def execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_argument_with_enabled_debug @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' @@ -785,7 +751,7 @@ def execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_ end end - def execute_and_collect_debug_logs_from_crashing_test_case_defined_by_exclude_test_case_argument_with_enabled_debug_and_cmd_args_set_to_true + def execute_and_collect_debug_logs_from_crashing_test_case_defined_by_exclude_test_case_argument_with_enabled_debug @c.with_context do Dir.chdir @proj_name do FileUtils.cp test_asset_path("example_file.h"), 'src/' diff --git a/spec/system/deployment_as_gem_spec.rb b/spec/system/deployment_as_gem_spec.rb index 6313f8ce..1188dc37 100644 --- a/spec/system/deployment_as_gem_spec.rb +++ b/spec/system/deployment_as_gem_spec.rb @@ -50,16 +50,16 @@ it { uses_report_tests_raw_output_log_plugin } it { test_run_of_projects_fail_because_of_crash_without_report } it { test_run_of_projects_fail_because_of_crash_with_report } - it { execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with_failue_when_cmd_args_set_to_true } - it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_argument_with_enabled_debug_and_cmd_args_set_to_true } - it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_exclude_test_case_argument_with_enabled_debug_and_cmd_args_set_to_true } + it { execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with_failue } + it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_argument } + it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_exclude_test_case_argument } it { confirm_if_notification_for_cmdline_args_not_enabled_is_disabled } - it { can_run_single_test_with_full_test_case_name_from_test_file_with_success_cmdline_args_are_enabled } - it { can_run_single_test_with_partiall_test_case_name_from_test_file_with_enabled_cmdline_args_success } + it { can_run_single_test_with_full_test_case_name_from_test_file_with_success } + it { can_run_single_test_with_partial_test_case_name_from_test_file_with_success } it { exclude_test_case_name_filter_works_and_only_one_test_case_is_executed } - it { none_of_test_is_executed_if_test_case_name_passed_does_not_fit_defined_in_test_file_and_cmdline_args_are_enabled } + it { none_of_test_is_executed_if_test_case_name_passed_does_not_fit_defined_in_test_file } it { none_of_test_is_executed_if_test_case_name_and_exclude_test_case_name_is_the_same } - it { run_all_test_when_test_case_name_is_passed_it_will_autoset_cmdline_args } + it { run_one_testcase_from_one_test_file_when_test_case_name_is_passed } end end diff --git a/spec/system/deployment_as_vendor_spec.rb b/spec/system/deployment_as_vendor_spec.rb index ef8415f5..f3117adc 100644 --- a/spec/system/deployment_as_vendor_spec.rb +++ b/spec/system/deployment_as_vendor_spec.rb @@ -51,16 +51,16 @@ it { uses_report_tests_raw_output_log_plugin } it { test_run_of_projects_fail_because_of_crash_without_report } it { test_run_of_projects_fail_because_of_crash_with_report } - it { execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with_failue_when_cmd_args_set_to_true } - it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_argument_with_enabled_debug_and_cmd_args_set_to_true } - it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_exclude_test_case_argument_with_enabled_debug_and_cmd_args_set_to_true } + it { execute_all_test_cases_from_crashing_test_runner_and_return_test_report_with_failue } + it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_test_case_argument_with_enabled_debug } + it { execute_and_collect_debug_logs_from_crashing_test_case_defined_by_exclude_test_case_argument_with_enabled_debug } it { confirm_if_notification_for_cmdline_args_not_enabled_is_disabled } - it { can_run_single_test_with_full_test_case_name_from_test_file_with_success_cmdline_args_are_enabled } - it { can_run_single_test_with_partiall_test_case_name_from_test_file_with_enabled_cmdline_args_success } + it { can_run_single_test_with_full_test_case_name_from_test_file_with_success } + it { can_run_single_test_with_partial_test_case_name_from_test_file_with_success } it { exclude_test_case_name_filter_works_and_only_one_test_case_is_executed } - it { none_of_test_is_executed_if_test_case_name_passed_does_not_fit_defined_in_test_file_and_cmdline_args_are_enabled } + it { none_of_test_is_executed_if_test_case_name_passed_does_not_fit_defined_in_test_file } it { none_of_test_is_executed_if_test_case_name_and_exclude_test_case_name_is_the_same } - it { run_all_test_when_test_case_name_is_passed_it_will_autoset_cmdline_args } + it { run_one_testcase_from_one_test_file_when_test_case_name_is_passed } end describe "deployed in a project's `vendor` directory with git support." do