Configuration 
Environment configuration to control bashunit behavior.
It serves to configure the behavior of bashunit in your project. You need to create a .env file in the root directory, but you can give it another name if you pass it as an argument to the command with --env option.
Default path 
BASHUNIT_DEFAULT_PATH=directory|file
Specifies the directory or file containing the tests to be run. empty by default.
If a directory is specified, it will execute tests within files ending in bench.sh. When running benchmarks (--bench), the same path is used to search for files ending in bench.sh.
If you use wildcards, bashunit will run any tests it finds.
# all tests inside the tests directory
BASHUNIT_DEFAULT_PATH=tests
# concrete test by full path
BASHUNIT_DEFAULT_PATH=tests/example_test.sh
# all test matching given wildcard
BASHUNIT_DEFAULT_PATH=tests/**/*_test.shOutput 
BASHUNIT_SIMPLE_OUTPUT=true|false
Enables simplified output to the console. false by default.
Verbose is the default output, but it can be overridden by the environment configuration.
Similar as using -s|--simple | -vvv|--detailed option on the command line.
....BASHUNIT_SIMPLE_OUTPUT=trueRunning tests/functional/logic_test.sh
✓ Passed: Other way of using the exit code
✓ Passed: Should validate a non ok exit code
✓ Passed: Should validate an ok exit code
✓ Passed: Text should be equalBASHUNIT_SIMPLE_OUTPUT=falseParallel 
BASHUNIT_PARALLEL_RUN=true|false
Runs the tests in child processes with randomized execution, which may improve overall testing speed, especially for larger test suites.
WARNING
Parallel execution is supported only on macOS and Ubuntu. On other systems bashunit forces sequential execution to avoid inconsistent results.
Similar as using -p|--parallel option on the command line.
Stop on failure 
BASHUNIT_STOP_ON_FAILURE=true|false
Force to stop the runner right after encountering one failing test. false by default.
Similar as using -S|--stop-on-failure option on the command line.
Show header 
BASHUNIT_SHOW_HEADER=true|false
BASHUNIT_HEADER_ASCII_ART=true|false
Specify if you want to show the bashunit header. true by default.
Additionally, you can use the env-var BASHUNIT_HEADER_ASCII_ART to display bashunit in ASCII. false by default.
✓ Passed: foo barBASHUNIT_SHOW_HEADER=falsebashunit - 0.26.0 // [!code hl]
✓ Passed: foo barBASHUNIT_SHOW_HEADER=true__               _                   _    // [!code hl]
| |__   __ _ ___| |__  __ __ ____ (_) |_  // [!code hl]
| '_ \ / _' / __| '_ \| | | | '_ \| | __| // [!code hl]
| |_) | (_| \__ \ | | | |_| | | | | | |_  // [!code hl]
|_.__/ \__,_|___/_| |_|\___/|_| |_|_|\__| // [!code hl]
0.26.0 // [!code hl]
✓ Passed: foo barBASHUNIT_SHOW_HEADER=true
BASHUNIT_HEADER_ASCII_ART=trueShow execution time 
BASHUNIT_SHOW_EXECUTION_TIME=true|false
Specify if you want to display the execution time after running bashunit. true by default.
✓ Passed: foo bar
Tests:      1 passed, 1 total
Assertions: 3 passed, 3 total
All tests passed
Time taken: 14 ms  // [!code hl]BASHUNIT_SHOW_EXECUTION_TIME=true✓ Passed: foo bar
Tests:      1 passed, 1 total
Assertions: 3 passed, 3 total
All tests passedBASHUNIT_SHOW_EXECUTION_TIME=falseLog JUnit 
BASHUNIT_LOG_JUNIT=file
Create a report XML file that follows the JUnit XML format and contains information about the test results of your bashunit tests.
BASHUNIT_LOG_JUNIT=log-junit.xmlReport HTML 
BASHUNIT_REPORT_HTML=file
Create a report HTML file that contains information about the test results of your bashunit tests.
BASHUNIT_REPORT_HTML=report.htmlBootstrap 
BASHUNIT_BOOTSTRAP=file
Specifies an additional file to be loaded for all tests cases. Useful to set up global variables or functions accessible in all your tests.
Similarly, you can use load an additional file via the command line.
# a simple .env file
BASHUNIT_BOOTSTRAP=".env.tests"
# or a complete script file
BASHUNIT_BOOTSTRAP="tests/globals.sh"
# Default value
BASHUNIT_BOOTSTRAP="tests/bootstrap.sh"Dev log 
BASHUNIT_DEV_LOG=file
See: Globals > log
BASHUNIT_DEV_LOG="dev.log"log "I am tracing something..."
log "error" "an" "error" "message"
log "warning" "different log level messages!"2024-10-03 21:27:23 [INFO]: I am tracing something... #tests/sample.sh:11
2024-10-03 21:27:23 [ERROR]: an error message #tests/sample.sh:27
2024-10-03 21:27:24 [WARNING]: different log level messages! #tests/sample.sh:21When enabled, the selected log file path is printed in the header so you can quickly tail -f it while the tests run.
All internal messages emitted by bashunit are prefixed with
[INTERNAL]. You can toggle internal messages withBASHUNIT_INTERNAL_LOG=true|false.
Verbose 
BASHUNIT_VERBOSE=bool
Display internal details for each test.
Similarly, you can use the command line option for this: command line.
BASHUNIT_VERBOSE=trueNo output 
BASHUNIT_NO_OUTPUT=true|false
Suppress all console output. Defaults to false.
Similar as using --no-output option on the command line.
BASHUNIT_NO_OUTPUT=true