Skip to content

Commit

Permalink
DEBUG: Rerun tests aborted by signal with gdb
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonlightSentinel committed Mar 25, 2021
1 parent b78746a commit 88cded2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/tools/d_do_test.d
Expand Up @@ -1608,8 +1608,10 @@ int tryMain(string[] args)
}

// automatically rerun a segfaulting test and print its stack trace
version(linux)
if (e.msg.canFind("exited with rc == 139"))
version(Windows) {}
else version (OSX) {}
else
if (e.msg.canFind("exited with rc == 139") || e.msg.canFind("caught signal"))
{
auto gdbCommand = "gdb -q -n -ex 'set backtrace limit 100' -ex run -ex bt -batch -args " ~ command;
runGDBTestWithLock(envData, () => spawnShell(gdbCommand).wait);
Expand Down

0 comments on commit 88cded2

Please sign in to comment.