Skip to content

Conversation

@nlamirault
Copy link

Using a variable "OUTPUT", add a red cross for FAILURE and a green check mark for SUCCESS.

$ ./bash_unit tests/test_bash_unit.sh
Running tests in tests/test_bash_unit.sh
Running test_assert_equals_fails_when_not_equal... SUCCESS
Running test_assert_equals_succeed_when_equal... SUCCESS
Running test_assert_fail_fails... SUCCESS
Running test_assert_fail_shows_stdout_stderr_on_failure... SUCCESS
Running test_assert_fail_succeeds... SUCCESS
Running test_assert_fails... SUCCESS
Running test_assert_not_equals_fails_when_equal... SUCCESS
Running test_assert_not_equals_succeeds_when_not_equal... SUCCESS
Running test_assert_shows_stdout_stderr_on_failure... SUCCESS
Running test_assert_status_code_fails... SUCCESS
Running test_assert_status_code_shows_stdout_stderr_on_failure... SUCCESS
Running test_assert_status_code_succeeds... SUCCESS
Running test_assert_succeeds... SUCCESS
Running test_bash_unit_changes_cwd_to_current_test_file_directory... SUCCESS
Running test_bash_unit_runs_teardown_even_in_case_of_failure... SUCCESS
Running test_bash_unit_succeed_when_no_failure_even_if_no_teardown... SUCCESS
Running test_display_usage_when_test_file_does_not_exist... SUCCESS
Running test_exit_code_not_0_in_case_of_failure... SUCCESS
Running test_fail_fails... SUCCESS
Running test_fail_prints_failure_message... SUCCESS
Running test_fail_prints_where_is_error... SUCCESS
Running test_fails_when_test_file_does_not_exist... SUCCESS
Running test_fake_actually_fakes_the_command... SUCCESS
Running test_fake_can_fake_inline... SUCCESS
Running test_fake_echo_stdin_when_no_params... SUCCESS
Running test_fake_exports_faked_in_subshells... SUCCESS
Running test_fake_transmits_params_to_fake_code... SUCCESS
Running test_one_test_should_stop_after_first_assertion_failure... SUCCESS
Running test_run_all_file_parameters... SUCCESS
Running test_run_all_tests_even_in_case_of_failure... SUCCESS
Running test_run_only_tests_that_match_pattern... SUCCESS

and :

$ ./bash_unit tests/test_bash_unicode_output.sh 
Running tests in tests/test_bash_unicode_output.sh
Running test_can_fail... FAILURE
this test failed on purpose
tests/test_bash_unicode_output.sh:4:test_can_fail()
Running test_code_creates_the_file... SUCCESS
Running test_code_with_code_25... SUCCESS
Running test_is_correct... SUCCESS

$ OUTPUT="UNICODE" ./bash_unit tests/test_bash_unicode_output.sh 
Running tests in tests/test_bash_unicode_output.sh
Running test_can_fail... ✗
this test failed on purpose
tests/test_bash_unicode_output.sh:6:test_can_fail()
Running test_code_creates_the_file... ✓
Running test_code_with_code_25... ✓
Running test_is_correct... ✓

Signed-off-by: Nicolas Lamirault nicolas.lamirault@gmail.com

Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
@@ -0,0 +1,26 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, you added tests/test_bash_unicode_output.sh just to run (manually) it with bash_unit and check if you can see the bullets.

If that is correct, I suggest you just remove this file and relies on the ones already existing in the getting_started directory.

Regards,

@pgrange pgrange closed this in 7876394 Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants