#2877 Issue closed: Add a test option '-t' to run specific scripts with 'set -eu -o pipefail'

Labels: enhancement, no-issue-activity

jsmeix opened issue at 2022-10-06 07:31:

The section "Try hard to care about possible errors" in
https://github.com/rear/rear/wiki/Coding-Style
reads (excerpts)

Preferably during development of new scripts
or when scripts are much overhauled
and while testing new code use 'set -ue'
to die from unset variables and unhandled errors
and use 'set -o pipefail' to better notice
failures in a pipeline.
...
Using 'set -eu -o pipefail' also in general
during runtime on the user's system
is currently not recommended because
it is a double-edged sword which can
cause more problems in practice
(i.e. problems for ReaR users)
than it intends to solve in theory.

BUT
there is no easy to use way how to do that in practice
i.e. how to run scripts with 'set -eu -o pipefail'
only when testing them during development
but not in general.

Therefore I am thinking about to add a test option '-t'
for example like rear -t <script_file_patterns>
to run matching scripts with hardcoded set -eu -o pipefail
perhaps also rear -t <script_file_patterns> -T <set_options>
to run matching scripts with specified set <set_options>
by the Source() function in lib/framework-functions.sh
in the same way as it is currently implemented there
for the DEBUGSCRIPTS mode setting.

github-actions commented at 2022-12-06 02:32:

Stale issue message

github-actions commented at 2023-02-05 02:40:

Stale issue message

github-actions commented at 2023-04-08 02:08:

Stale issue message


[Export of Github issue for rear/rear.]