File tree Expand file tree Collapse file tree 5 files changed +29
-2
lines changed Expand file tree Collapse file tree 5 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ while [[ $# -gt 0 ]]; do
6464 fi
6565 set -x
6666 ;;
67+ -pb|--progress-bar)
68+ export BASHUNIT_PROGRESS=true
69+ ;;
6770 -b|--bench)
6871 _BENCH_MODE=true
6972 export BASHUNIT_BENCH_MODE=true
Original file line number Diff line number Diff line change @@ -340,6 +340,18 @@ Duration: 48 ms
340340```
341341:::
342342
343+ ## Progress bar
344+
345+ > ` bashunit -pb|--progress-bar `
346+
347+ Enable the progress bar during test execution. By default, the progress bar is disabled.
348+
349+ ::: code-group
350+ ``` bash [Example]
351+ ./bashunit --progress-bar
352+ ```
353+ :::
354+
343355## Version
344356
345357> ` bashunit --version `
Original file line number Diff line number Diff line change @@ -247,6 +247,18 @@ BASHUNIT_VERBOSE=true
247247```
248248:::
249249
250+ ## Progress bar
251+
252+ > ` BASHUNIT_PROGRESS=true|false `
253+
254+ Controls whether the progress bar is rendered. ` false ` by default.
255+
256+ ::: code-group
257+ ``` bash [Example]
258+ BASHUNIT_PROGRESS=true
259+ ```
260+ :::
261+
250262<script setup >
251263import pkg from ' ../package.json'
252264</script >
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ _DEFAULT_STOP_ON_FAILURE="false"
2828_DEFAULT_SHOW_EXECUTION_TIME=" true"
2929_DEFAULT_VERBOSE=" false"
3030_DEFAULT_BENCH_MODE=" false"
31- _DEFAULT_PROGRESS=" true "
31+ _DEFAULT_PROGRESS=" false "
3232
3333# Controls if the progress bar should render during execution
3434_PROGRESS_ENABLED=true
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ function progress::finish() {
7777# Re-render the last progress bar if progress display is enabled
7878function progress::refresh() {
7979 if [[ " $_PROGRESS_ENABLED " == true ]]; then
80- progress::render " $PROGRESS_CURRENT " " $PROGRESS_TOTAL "
80+ progress::render " ${ PROGRESS_CURRENT:- } " " ${ PROGRESS_TOTAL:- } "
8181 fi
8282}
8383
You can’t perform that action at this time.
0 commit comments