From: Douglas Bagnall Date: Thu, 11 Feb 2021 04:39:18 +0000 (+1300) Subject: selftest/gdb_backtrace: add an off switch X-Git-Tag: tevent-0.11.0~1738 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b7c2c3b1abbad5ae6550b99496e251061585c90;p=thirdparty%2Fsamba.git selftest/gdb_backtrace: add an off switch Sometime you know a test is going to crash and produce a LOT of backtrace, and you already know what it will look like. For those times you can set PLEASE_NO_GDB_BACKTRACE=1 and there will be no backtrace, which can save quite a bit of time and thousands of lines of log file. (In particular, backtraces of Python programs can take over a minute to complete). Signed-off-by: Douglas Bagnall Reviewed-by: David Mulder --- diff --git a/selftest/gdb_backtrace b/selftest/gdb_backtrace index 4fe5f57353a..307a4d1e122 100755 --- a/selftest/gdb_backtrace +++ b/selftest/gdb_backtrace @@ -9,6 +9,12 @@ if [ -n "$VALGRIND" -o -n "$SMBD_VALGRIND" ]; then exit 1 fi +if [ "x$PLEASE_NO_GDB_BACKTRACE" != "x" ]; then + echo "${BASENAME}: Not running debugger because PLEASE_NO_GDB_BACKTRACE is set" + exit 0 +fi + + # we want everything on stderr, so the program is not disturbed exec 1>&2