Skip to content

Commit

Permalink
Merge pull request #290 from TypedDevs/feat/debug-option
Browse files Browse the repository at this point in the history
Debug option
  • Loading branch information
Chemaclass authored Jul 13, 2024
2 parents 6706f98 + e144d1a commit 8a76271
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
- Generate checksum on build
- Enable display execution time on macOS with `SHOW_EXECUTION_TIME`
- Support for displaying the clock without `perl` (for non-macOS)
- Enable strictmode
- Add `-l|--log-junit <log.xml>` option
- Add `-r|--report-html <report.html>` option
- Enable strictmode
- Added dump/dd functions for local debugging
- Add `--debug` option
- Add `dump` and `dd` functions for local debugging

## [0.13.0](https://github.com/TypedDevs/bashunit/compare/0.12.0...0.13.0) - 2024-06-23

Expand Down
4 changes: 4 additions & 0 deletions bashunit
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ while [[ $# -gt 0 ]]; do
export SIMPLE_OUTPUT=false
shift
;;
--debug)
set -x
shift
;;
-S|--stop-on-failure)
export STOP_ON_FAILURE=true
shift
Expand Down
18 changes: 15 additions & 3 deletions docs/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,23 @@ Run a core assert function standalone without a test context. Read more: [Standa
```
:::

## Debug

> `bashunit --debug`
Enables a shell mode in which all executed commands are printed to the terminal. Printing every command as executed may help you visualize the script's control flow if it is not working as expected.

::: code-group
```bash [Example]
./bashunit --debug
```
:::

## Environment

> `bashunit -e|--env "file path"`
Load a custom env file overriding the `.env` environment variables.
Loads a custom env file overriding the `.env` environment variables.

::: code-group
```bash [Example]
Expand All @@ -74,7 +86,7 @@ Filters the tests to be run based on the `test name`.

> `bashunit -l|--log-junit <out.xml>`
Create a report XML file that follows the JUnit XML format and contains information about the test results of your bashunit tests.
Creates a report XML file that follows the JUnit XML format and contains information about the test results of your bashunit tests.

::: code-group
```bash [Example]
Expand All @@ -86,7 +98,7 @@ Create a report XML file that follows the JUnit XML format and contains informat

> `bashunit -r|--report-html <out.html>`
Create a report HTML file that contains information about the test results of your bashunit tests.
Creates a report HTML file that contains information about the test results of your bashunit tests.

::: code-group
```bash [Example]
Expand Down
3 changes: 3 additions & 0 deletions src/console_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Options:
-a|--assert <function ...args>
Run a core assert function standalone without a test context.
--debug
Print all executed shell commands to the terminal.
-e|--env <file-path>
Load a custom env file overriding the .env environment variables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Options:
-a|--assert <function ...args>
Run a core assert function standalone without a test context.

--debug
Print all executed shell commands to the terminal.

-e|--env <file-path>
Load a custom env file overriding the .env environment variables.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Options:
-a|--assert <function ...args>
Run a core assert function standalone without a test context.

--debug
Print all executed shell commands to the terminal.

-e|--env <file-path>
Load a custom env file overriding the .env environment variables.

Expand Down

0 comments on commit 8a76271

Please sign in to comment.