diff --git a/UnitTests/tst_deploytest.cpp b/UnitTests/tst_deploytest.cpp index bbd1f06..9fb0aa7 100644 --- a/UnitTests/tst_deploytest.cpp +++ b/UnitTests/tst_deploytest.cpp @@ -29,6 +29,23 @@ #include "qmlcreator.h" #include "testutils.h" // add necessary includes here +#include +#include +#include + +void handler(int sig) { + void *array[10]; + size_t size; + + // get void*'s for all entries on the stack + size = backtrace(array, 10); + + // print out all the frames to stderr + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + const QString TestBinDir = TEST_BIN_DIR; const QString TestQtDir = QT_BASE_DIR; @@ -238,6 +255,10 @@ QSet deploytest::getFilesTree(const QStringList &keys) { } deploytest::deploytest() { + signal(SIGSEGV, handler); // install our handler + signal(SIGABRT, handler); // install our handler + + TestUtils utils; auto tempTree = utils.getTree(TestQtDir);