]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-debug-fail: New utility script for debugging
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 4 Dec 2015 18:12:38 +0000 (18:12 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 8 Dec 2015 14:51:02 +0000 (14:51 +0000)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Use "egrep ''" rather than "egrep .".  Both sanitise
     missing-final-newline but "egrep ''" will print blank lines,
     which is desirable here.

mg-debug-fail [new file with mode: 0755]

diff --git a/mg-debug-fail b/mg-debug-fail
new file mode 100755 (executable)
index 0000000..a163aef
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# This script can be provided anywhere an executable or command name is
+# wanted.  It prints its arguments, and its stdin, to its stderr, and
+# then exits nonzero.
+#
+# When using this it may be useful to provide </dev/null as a
+# redirection for the whole program under test.  Otherwise things
+# can mysteriously hang.
+
+bash -xc ': mg-debug-fail "$@"' x "$@"
+egrep '' >&2
+exit 127