@@ -63,27 +63,27 @@ function bashunit::console_header::print_help() {
6363Usage: bashunit <command> [arguments] [options]
6464
6565Commands:
66- test [path] Run tests (default command)
67- bench [path] Run benchmarks
68- assert <fn> <args> Run standalone assertion
69- doc [filter] Display assertion documentation
70- init [dir] Initialize a new test directory
71- learn Start interactive tutorial
72- upgrade Upgrade bashunit to latest version
66+ test [path] Run tests (default command)
67+ bench [path] Run benchmarks
68+ assert <fn> <args> Run standalone assertion
69+ doc [filter] Display assertion documentation
70+ init [dir] Initialize a new test directory
71+ learn Start interactive tutorial
72+ upgrade Upgrade bashunit to latest version
7373
7474Global Options:
75- -h, --help Show this help message
76- -v, --version Display the current version
75+ -h, --help Show this help message
76+ -v, --version Display the current version
7777
7878Run 'bashunit <command> --help' for command-specific options.
7979
8080Examples:
81- bashunit test tests/ Run all tests in directory
82- bashunit tests/ Run all tests (shorthand)
83- bashunit bench Run all benchmarks
84- bashunit assert equals "foo" "foo" Run standalone assertion
85- bashunit doc contains Show docs for 'contains' assertions
86- bashunit init Initialize test directory
81+ bashunit test tests/ Run all tests in directory
82+ bashunit tests/ Run all tests (shorthand)
83+ bashunit bench Run all benchmarks
84+ bashunit assert equals "foo" "foo" Run standalone assertion
85+ bashunit doc contains Show docs for 'contains' assertions
86+ bashunit init Initialize test directory
8787
8888More info: https://bashunit.typeddevs.com/command-line
8989EOF
9292function bashunit::console_header::print_test_help() {
9393 cat << EOF
9494Usage: bashunit test [path] [options]
95- bashunit [path] [options]
95+ bashunit [path] [options]
9696
9797Run test files. If no path is provided, searches for tests in BASHUNIT_DEFAULT_PATH.
9898
9999Arguments:
100- path File or directory containing tests
101- - Directories: runs all '*test.sh' files
102- - Wildcards: supported to match multiple files
100+ path File or directory containing tests
101+ - Directories: runs all '*test.sh' files
102+ - Wildcards: supported to match multiple files
103103
104104Options:
105- -a, --assert <fn> <args> Run a standalone assert function (deprecated: use 'bashunit assert')
106- -e, --env, --boot <file> Load a custom env/bootstrap file (supports args)
107- -f, --filter <name> Only run tests matching the name
108- --log-junit <file> Write JUnit XML report
109- -p, --parallel Run tests in parallel
110- --no-parallel Run tests sequentially
111- -r, --report-html <file> Write HTML report
112- -s, --simple Simple output (dots)
113- --detailed Detailed output (default)
114- -R, --run-all Run all assertions (don't stop on first failure)
115- -S, --stop-on-failure Stop on first failure
116- -vvv, --verbose Show execution details
117- --debug [file] Enable shell debug mode
118- --no-output Suppress all output
119- --failures-only Only show failures (suppress passed/skipped/incomplete)
120- --no-progress Suppress real-time progress, show only final results
121- --show-output Show test output on failure (default: enabled)
122- --no-output-on-failure Hide test output on failure
123- --strict Enable strict shell mode (set -euo pipefail)
124- --skip-env-file Skip .env loading, use shell environment only
125- -l, --login Run tests in login shell context
126- --no-color Disable colored output (honors NO_COLOR env var)
127- -h, --help Show this help message
105+ -a, --assert <fn> <args> Run a standalone assert function (deprecated: use 'bashunit assert')
106+ -e, --env, --boot <file> Load a custom env/bootstrap file (supports args)
107+ -f, --filter <name> Only run tests matching the name
108+ --log-junit <file> Write JUnit XML report
109+ -p, --parallel Run tests in parallel
110+ --no-parallel Run tests sequentially
111+ -r, --report-html <file> Write HTML report
112+ -s, --simple Simple output (dots)
113+ --detailed Detailed output (default)
114+ -R, --run-all Run all assertions (don't stop on first failure)
115+ -S, --stop-on-failure Stop on first failure
116+ -vvv, --verbose Show execution details
117+ --debug [file] Enable shell debug mode
118+ --no-output Suppress all output
119+ --failures-only Only show failures (suppress passed/skipped/incomplete)
120+ --no-progress Suppress real-time progress, show only final results
121+ --show-output Show test output on failure (default: enabled)
122+ --no-output-on-failure Hide test output on failure
123+ --strict Enable strict shell mode (set -euo pipefail)
124+ --skip-env-file Skip .env loading, use shell environment only
125+ -l, --login Run tests in login shell context
126+ --no-color Disable colored output (honors NO_COLOR env var)
127+ -h, --help Show this help message
128128
129129Coverage:
130- --coverage Enable code coverage tracking
131- --coverage-paths <paths> Source paths to track (default: auto-discover)
132- --coverage-exclude <pats> Patterns to exclude (comma-separated)
133- --coverage-report [file] Output file (default: coverage/lcov.info)
134- --coverage-report-html [dir] HTML report (default: coverage/html)
135- --coverage-min <pct> Fail if coverage below percentage
136- --no-coverage-report Disable file output, console only
130+ --coverage Enable code coverage tracking
131+ --coverage-paths <paths> Source paths to track (default: auto-discover)
132+ --coverage-exclude <pats> Patterns to exclude (comma-separated)
133+ --coverage-report [file] Output file (default: coverage/lcov.info)
134+ --coverage-report-html [dir] HTML report (default: coverage/html)
135+ --coverage-min <pct> Fail if coverage below percentage
136+ --no-coverage-report Disable file output, console only
137137
138138Examples:
139- bashunit test tests/
140- bashunit test tests/unit/ --parallel
141- bashunit test --filter "user" tests/
142- bashunit test -a equals "foo" "foo"
143- bashunit test tests/ --coverage
144- bashunit test tests/ --coverage --coverage-min 80
145- bashunit test tests/ --coverage-report-html
139+ bashunit test tests/
140+ bashunit test tests/unit/ --parallel
141+ bashunit test --filter "user" tests/
142+ bashunit test -a equals "foo" "foo"
143+ bashunit test tests/ --coverage
144+ bashunit test tests/ --coverage --coverage-min 80
145+ bashunit test tests/ --coverage-report-html
146146EOF
147147}
148148
@@ -153,23 +153,23 @@ Usage: bashunit bench [path] [options]
153153Run benchmark files. Searches for '*bench.sh' files.
154154
155155Arguments:
156- path File or directory containing benchmarks
156+ path File or directory containing benchmarks
157157
158158Options:
159- -e, --env, --boot <file> Load a custom env/bootstrap file (supports args)
160- -f, --filter <name> Only run benchmarks matching the name
161- -s, --simple Simple output
162- --detailed Detailed output (default)
163- -vvv, --verbose Show execution details
164- --skip-env-file Skip .env loading, use shell environment only
165- -l, --login Run in login shell context
166- --no-color Disable colored output (honors NO_COLOR env var)
167- -h, --help Show this help message
159+ -e, --env, --boot <file> Load a custom env/bootstrap file (supports args)
160+ -f, --filter <name> Only run benchmarks matching the name
161+ -s, --simple Simple output
162+ --detailed Detailed output (default)
163+ -vvv, --verbose Show execution details
164+ --skip-env-file Skip .env loading, use shell environment only
165+ -l, --login Run in login shell context
166+ --no-color Disable colored output (honors NO_COLOR env var)
167+ -h, --help Show this help message
168168
169169Examples:
170- bashunit bench
171- bashunit bench benchmarks/
172- bashunit bench --filter "parse"
170+ bashunit bench
171+ bashunit bench benchmarks/
172+ bashunit bench --filter "parse"
173173EOF
174174}
175175
@@ -196,15 +196,15 @@ Usage: bashunit init [directory]
196196Initialize a new test directory with sample files.
197197
198198Arguments:
199- directory Target directory (default: tests)
199+ directory Target directory (default: tests)
200200
201201Creates:
202- - bootstrap.sh Setup file for test configuration
203- - example_test.sh Sample test file to get started
202+ - bootstrap.sh Setup file for test configuration
203+ - example_test.sh Sample test file to get started
204204
205205Examples:
206- bashunit init Create tests/ directory
207- bashunit init spec Create spec/ directory
206+ bashunit init Create tests/ directory
207+ bashunit init spec Create spec/ directory
208208EOF
209209}
210210
@@ -215,16 +215,16 @@ Usage: bashunit learn
215215Start the interactive learning tutorial.
216216
217217The tutorial includes 10 progressive lessons:
218- 1. Basics - Your First Test
219- 2. Assertions - Testing Different Conditions
220- 3. Setup & Teardown - Managing Test Lifecycle
221- 4. Testing Functions - Unit Testing Patterns
222- 5. Testing Scripts - Integration Testing
223- 6. Mocking - Test Doubles and Mocks
224- 7. Spies - Verifying Function Calls
225- 8. Data Providers - Parameterized Tests
226- 9. Exit Codes - Testing Success and Failure
227- 10. Complete Challenge - Real World Scenario
218+ 1. Basics - Your First Test
219+ 2. Assertions - Testing Different Conditions
220+ 3. Setup & Teardown - Managing Test Lifecycle
221+ 4. Testing Functions - Unit Testing Patterns
222+ 5. Testing Scripts - Integration Testing
223+ 6. Mocking - Test Doubles and Mocks
224+ 7. Spies - Verifying Function Calls
225+ 8. Data Providers - Parameterized Tests
226+ 9. Exit Codes - Testing Success and Failure
227+ 10. Complete Challenge - Real World Scenario
228228
229229Your progress is saved automatically.
230230EOF
@@ -243,28 +243,28 @@ EOF
243243function bashunit::console_header::print_assert_help() {
244244 cat << EOF
245245Usage: bashunit assert <function> [args...]
246- bashunit assert "<command>" <assertion1> <arg1> [<assertion2> <arg2>...]
246+ bashunit assert "<command>" <assertion1> <arg1> [<assertion2> <arg2>...]
247247
248248Run standalone assertion(s) without creating a test file.
249249
250250Single assertion:
251- bashunit assert equals "foo" "foo"
252- bashunit assert same "1" "1"
253- bashunit assert contains "world" "hello world"
254- bashunit assert exit_code 0 "echo 'success'"
251+ bashunit assert equals "foo" "foo"
252+ bashunit assert same "1" "1"
253+ bashunit assert contains "world" "hello world"
254+ bashunit assert exit_code 0 "echo 'success'"
255255
256256Multiple assertions on command output:
257- bashunit assert "echo 'error' && exit 1" exit_code "1" contains "error"
258- bashunit assert "./my_script.sh" exit_code "0" contains "success" not_contains "error"
257+ bashunit assert "echo 'error' && exit 1" exit_code "1" contains "error"
258+ bashunit assert "./my_script.sh" exit_code "0" contains "success" not_contains "error"
259259
260260Arguments:
261- function Assertion function name (with or without 'assert_' prefix)
262- command Command to execute (for multi-assertion mode)
263- assertion Assertion name (exit_code, contains, equals, etc.)
264- arg Expected value for the assertion
261+ function Assertion function name (with or without 'assert_' prefix)
262+ command Command to execute (for multi-assertion mode)
263+ assertion Assertion name (exit_code, contains, equals, etc.)
264+ arg Expected value for the assertion
265265
266266Note: You can also use 'bashunit test --assert <fn> <args>' (deprecated).
267- The 'bashunit assert' subcommand is the recommended approach.
267+ The 'bashunit assert' subcommand is the recommended approach.
268268
269269More info: https://bashunit.typeddevs.com/standalone
270270EOF
0 commit comments