Thread (30 messages) 30 messages, 5 authors, 2021-02-12

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

flat view

From: Denton Liu <hidden>
Date: 2021-02-10 00:12:14

Hi Ævar,

Just a quick drive-by comment:

On Tue, Feb 09, 2021 at 10:41:59PM +0100, Ævar Arnfjörð Bjarmason wrote:
quoted hunk ↗ jump to hunk
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?
quoted hunk ↗ jump to hunk
@@ -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.
[...]
quoted hunk ↗ jump to hunk
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?
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help