Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers
Hi Ævar,
Just a quick drive-by comment:
On Tue, Feb 09, 2021 at 10:41:59PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> diff --git a/t/test-lib-functions/debug.sh b/t/test-lib-functions/debug.sh
> new file mode 100644
> index 00000000000..4393bf82f02
> --- /dev/null
> +++ b/t/test-lib-functions/debug.sh
Is this supposed to be text.sh?
Show 5 quoted lines
> @@ -0,0 +1,99 @@
> +# Included by test-lib.sh via test-lib-functions.sh
> +#
> +# Text munging functions, e.g. wrappers for perl, tr, sed
> +# etc. one-liners.
Show 5 quoted lines
> diff --git a/t/test-lib-functions/text.sh b/t/test-lib-functions/text.sh
> new file mode 100644
> index 00000000000..e5f438ffd31
> --- /dev/null
> +++ b/t/test-lib-functions/text.sh
And is this one supposed to be debug.sh?
Show 37 quoted lines
> @@ -0,0 +1,33 @@
> +# Included by test-lib.sh via test-lib-functions.sh
> +#
> +# Debugging functions, not intended to be present in submitted
> +# patches. Be sure to remove their use before submitting.
> +
> +# Stop execution and start a shell.
> +test_pause () {
> + "$SHELL_PATH" <&6 >&5 2>&7
> +}
> +
> +# Wrap git with a debugger. Adding this to a command can make it easier
> +# to understand what is going on in a failing test.
> +#
> +# Examples:
> +# debug git checkout master
> +# debug --debugger=nemiver git $ARGS
> +# debug -d "valgrind --tool=memcheck --track-origins=yes" git $ARGS
> +debug () {
> + case "$1" in
> + -d)
> + GIT_DEBUGGER="$2" &&
> + shift 2
> + ;;
> + --debugger=*)
> + GIT_DEBUGGER="${1#*=}" &&
> + shift 1
> + ;;
> + *)
> + GIT_DEBUGGER=1
> + ;;
> + esac &&
> + GIT_DEBUGGER="${GIT_DEBUGGER}" "$@" <&6 >&5 2>&7
> +}
> --
> 2.30.0.284.gd98b1dd5eaa7
>