Skip to content

Commit

Permalink
🔥 Removed :cmdline_args references
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mkarlesky committed May 17, 2024
1 parent 78071b4 commit 1f99b50
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 88 deletions.
4 changes: 0 additions & 4 deletions assets/project_with_guts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
4 changes: 0 additions & 4 deletions assets/project_with_guts_gcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
4 changes: 0 additions & 4 deletions examples/temp_sensor/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
4 changes: 0 additions & 4 deletions plugins/dependencies/example/boss/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
4 changes: 0 additions & 4 deletions plugins/dependencies/example/supervisor/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
4 changes: 0 additions & 4 deletions plugins/module_generator/example/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
6 changes: 3 additions & 3 deletions spec/gcov/gcov_deployment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
8 changes: 3 additions & 5 deletions spec/gcov/gcov_test_cases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down Expand Up @@ -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/'
Expand Down Expand Up @@ -264,16 +264,14 @@ 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/'
FileUtils.cp test_asset_path("example_file.c"), 'src/'
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" \
Expand Down
50 changes: 8 additions & 42 deletions spec/spec_system_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`

Expand All @@ -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`

Expand All @@ -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`

Expand All @@ -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`

Expand All @@ -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
Expand All @@ -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`

Expand All @@ -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/'
Expand Down Expand Up @@ -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/'
Expand All @@ -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/'
Expand All @@ -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/'
Expand Down
14 changes: 7 additions & 7 deletions spec/system/deployment_as_gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions spec/system/deployment_as_vendor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f99b50

Please sign in to comment.