git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 12/12] test-lib-functions: split out {debug,path,text} helpers

From
Denton Liu <liu.denton@gmail.com>
Date
Feb 9, 2021, 23:37 UTC
Message-ID
<YCMcoyDVNnc8Lkdp@generichostname>
In-Reply-To
<20210209214159.22815-13-avarab@gmail.com>
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
> 
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 8 of 38 in “test-lib: misc improvements”
  1. 00/12 test-lib: misc improvementsÆvar Arnfjörð Bjarmason, Feb 9, 2021
  2. 01/12 test-lib: remove check_var_migrationÆvar Arnfjörð Bjarmason, Feb 9, 2021
  3. Junio C HamanoFeb 10, 2021
  4. 02/12 test lib: change "error" to "BUG" as appropriateÆvar Arnfjörð Bjarmason, Feb 9, 2021
  5. 03/12 test-lib-functions: move test_set_index_version() to its userÆvar Arnfjörð Bjarmason, Feb 9, 2021
  6. 04/12 test-lib-functions: remove generate_zero_bytes() wrapperÆvar Arnfjörð Bjarmason, Feb 9, 2021
  7. 12/12 test-lib-functions: split out {debug,path,text} helpersÆvar Arnfjörð Bjarmason, Feb 9, 2021
  8. Denton LiuFeb 9, 2021
  9. Junio C HamanoFeb 10, 2021
  10. SZEDER GáborFeb 11, 2021
  11. Johannes SchindelinFeb 11, 2021
  12. Ævar Arnfjörð BjarmasonFeb 13, 2021
  13. 05/12 test libs: rename bundle helper to "lib-bundle.sh"Ævar Arnfjörð Bjarmason, Feb 9, 2021
  14. 10/12 test-lib-functions: remove bug-inducing "diagnostics" helper paramÆvar Arnfjörð Bjarmason, Feb 9, 2021
  15. 06/12 test libs: rename gitweb-lib.sh to lib-gitweb.shÆvar Arnfjörð Bjarmason, Feb 9, 2021
  16. 09/12 test libs: rename "diff-lib" to "lib-diff"Ævar Arnfjörð Bjarmason, Feb 9, 2021
  17. Junio C HamanoFeb 10, 2021
  18. Johannes SchindelinFeb 11, 2021
  19. Junio C HamanoFeb 11, 2021
  20. 11/12 test-lib-functions: assert correct parameter countÆvar Arnfjörð Bjarmason, Feb 9, 2021
  21. 08/12 t/.gitattributes: sort linesÆvar Arnfjörð Bjarmason, Feb 9, 2021
  22. 07/12 test-lib-functions: move function to lib-bitmap.shÆvar Arnfjörð Bjarmason, Feb 9, 2021
  23. SZEDER GáborFeb 10, 2021
  24. Jeff KingFeb 10, 2021
  25. SZEDER GáborFeb 11, 2021
  26. 00/11 test-lib: misc improvementsÆvar Arnfjörð Bjarmason, Feb 12, 2021
  27. Junio C HamanoFeb 12, 2021
  28. 02/11 test lib: change "error" to "BUG" as appropriateÆvar Arnfjörð Bjarmason, Feb 12, 2021
  29. 01/11 test-lib: remove check_var_migrationÆvar Arnfjörð Bjarmason, Feb 12, 2021
  30. 03/11 test-lib-functions: move test_set_index_version() to its userÆvar Arnfjörð Bjarmason, Feb 12, 2021
  31. 04/11 test-lib-functions: remove generate_zero_bytes() wrapperÆvar Arnfjörð Bjarmason, Feb 12, 2021
  32. 05/11 test libs: rename bundle helper to "lib-bundle.sh"Ævar Arnfjörð Bjarmason, Feb 12, 2021
  33. 06/11 test libs: rename gitweb-lib.sh to lib-gitweb.shÆvar Arnfjörð Bjarmason, Feb 12, 2021
  34. 07/11 test-lib-functions: move function to lib-bitmap.shÆvar Arnfjörð Bjarmason, Feb 12, 2021
  35. 08/11 t/.gitattributes: sort linesÆvar Arnfjörð Bjarmason, Feb 12, 2021
  36. 09/11 test libs: rename "diff-lib" to "lib-diff"Ævar Arnfjörð Bjarmason, Feb 12, 2021
  37. 10/11 test-lib-functions: remove bug-inducing "diagnostics" helper paramÆvar Arnfjörð Bjarmason, Feb 12, 2021
  38. 11/11 test-lib-functions: assert correct parameter countÆvar Arnfjörð Bjarmason, Feb 12, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.