Skip to content

Commit ab6a884

Browse files
committed
Document -f tap format.
1 parent 8d425f5 commit ab6a884

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

+42
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,48 @@ Running test_one_test_should_stop_after_first_assertion_failure... SUCCESS
114114
Running test_one_test_should_stop_when_assert_fails... SUCCESS
115115
```
116116

117+
bash_unit supports the [Test Anything Protocol](http://testanything.org/) so you can ask for a tap formatted
118+
output with the *-f* option.
119+
120+
```test
121+
./bash_unit -f tap tests/test_bash_unit.sh
122+
```
123+
124+
```output
125+
# Running tests in tests/test_bash_unit.sh
126+
ok - test_assert_equals_fails_when_not_equal
127+
ok - test_assert_equals_succeed_when_equal
128+
ok - test_assert_fail_fails
129+
ok - test_assert_fail_succeeds
130+
ok - test_assert_fails
131+
ok - test_assert_not_equals_fails_when_equal
132+
ok - test_assert_not_equals_succeeds_when_not_equal
133+
ok - test_assert_shows_stderr_on_failure
134+
ok - test_assert_shows_stdout_on_failure
135+
ok - test_assert_status_code_fails
136+
ok - test_assert_status_code_succeeds
137+
ok - test_assert_succeeds
138+
ok - test_bash_unit_changes_cwd_to_current_test_file_directory
139+
ok - test_bash_unit_runs_teardown_even_in_case_of_failure
140+
ok - test_bash_unit_succeed_when_no_failure_even_if_no_teardown
141+
ok - test_display_usage_when_test_file_does_not_exist
142+
ok - test_exit_code_not_0_in_case_of_failure
143+
ok - test_fail_fails
144+
ok - test_fail_prints_failure_message
145+
ok - test_fail_prints_where_is_error
146+
ok - test_fails_when_test_file_does_not_exist
147+
ok - test_fake_actually_fakes_the_command
148+
ok - test_fake_can_fake_inline
149+
ok - test_fake_echo_stdin_when_no_params
150+
ok - test_fake_exports_faked_in_subshells
151+
ok - test_fake_transmits_params_to_fake_code
152+
ok - test_one_test_should_stop_after_first_assertion_failure
153+
ok - test_one_test_should_stop_when_assert_fails
154+
ok - test_run_all_file_parameters
155+
ok - test_run_all_tests_even_in_case_of_failure
156+
ok - test_run_only_tests_that_match_pattern
157+
```
158+
117159
# How to write tests
118160

119161
Write your test functions in a file. The name of a test function has to start with *test*. Only functions starting with *test* will be tested.

0 commit comments

Comments
 (0)