summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-03-14 18:33:59 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2022-03-22 17:43:13 +0100
commit02d130db7ebaa09f671c48ac83dfd5c3a250be16 (patch)
treed73b725bc6b26a247b60f2faeb181f189c8be142 /src/testlib
parentd52fbfe924a884ea3a0f516793e0038dd9099695 (diff)
Avoid duplicate descriptions in TAP's incident YAML
When a B?Fail's description doesn't match the QVERIFY/QCOMPARE regexes, it got output as a comment in the YAML block after the test line had already reported it as a TODO comment. An empty description would also have lead to an empty comment in the YAML block. Condition this fallback output case on there being a description that hasn't yet been reported in the test line. Task-number: QTBUG-96844 Change-Id: Id7fe81d26ddb01da3d8003ada8fa590a5e1a166f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtaptestlogger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp
index 435cf34bfa..62fde40d64 100644
--- a/src/testlib/qtaptestlogger.cpp
+++ b/src/testlib/qtaptestlogger.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtTest module of the Qt Toolkit.
@@ -234,7 +234,7 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
outputString(diagnosticsYamlish.data());
} else
#endif
- {
+ if (description && !incident) {
QTestCharBuffer unparsableDescription;
QTest::qt_asprintf(&unparsableDescription, YAML_INDENT "# %s\n", description);
outputString(unparsableDescription.data());