summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/tst_selftests.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-09-02 16:26:41 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-09-03 14:16:30 +0000
commitc486cacba8fc6f22f8479ae588a399ae402f3bd0 (patch)
treebd8b3bd6a5eec890e08ac078a7b8b041ed81e88e /tests/auto/testlib/selftests/tst_selftests.cpp
parente6a2ba708931d353bad4f399180d46116404aa2c (diff)
Testlib/Windows: Output crash information on stdout instead of stderr.
Make it easier to capture information about crashing tests in log files, since it is not possible to do something like foo > log.txt 2> errlog.txt on Windows. Adapt selftest. [ChangeLog][QtTest][Important Behavior Changes] Crash/exception information is now logged to standard output on Windows. Task-number: QTBUG-47370 Change-Id: I3e6a2d25855ed0f20516418a031990b562f5f757 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/testlib/selftests/tst_selftests.cpp')
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 9b76bca28c..42d929c4a1 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -625,6 +625,13 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
for (int n = 0; n < loggers.count(); ++n) {
QString logger = loggers[n];
+#if defined(Q_OS_WIN)
+ if (n == 0 && subdir == QLatin1String("crashes")) { // Remove stack trace which is output to stdout.
+ const int exceptionLogStart = actualOutputs.first().indexOf("A crash occurred in ");
+ if (exceptionLogStart >= 0)
+ actualOutputs[0].truncate(exceptionLogStart);
+ }
+#endif // Q_OS_WIN
QList<QByteArray> res = splitLines(actualOutputs[n]);
const QString expectedFileName = expectedFileNameFromTest(subdir, logger);
QList<QByteArray> exp = expectedResult(expectedFileName);