Fix errors in lightxml test logger

The newer test logger did not produce the same light XML output as the
logger that it replaced.  In particular, it did not output the <DataTag>
tag and it incorrectly nested a <Message> tag inside the <Incident> tag
when a fatal error occured in a test.

Unfortunately, it appears that the expected lightxml output for the
selftests was produced by running tests using the newer logger, while
the selftests did not use the older lightxml logger.  Thus the errors
were not detected by the selftests.

This commit adds the older lightxml logger to the selftests, updates the
expected test data accordingly, and modifies the newer lightxml logger
to behave correctly.  This last item is achieved by making the lightxml
streamer copy most of the code from the xml streamer -- lightxml output
is supposed to be same as xml, except for the omission of the root and
<TestCase> tags.

Change-Id: Ie6e1f69dd6000df2b9d0c5c8e2109fe7bbff3956
Reviewed-on: http://codereview.qt.nokia.com/3902
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
bb10
Jason McDonald 2011-08-31 12:52:27 +10:00 committed by Qt by Nokia
parent b94eba6899
commit 21776e9260
18 changed files with 177 additions and 68 deletions

View File

@ -77,9 +77,32 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, QTestCharBu
QTestCharBuffer cdataDesc;
QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, " <Description><![CDATA[%s]]></Description>\n",
cdataDesc.constData());
break;
QTestCharBuffer location;
QTestCharBuffer quotedFile;
QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
QTest::qt_asprintf(&location, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line));
if (element->attribute(QTest::AI_Tag)) {
QTestCharBuffer cdataTag;
QXmlTestLogger::xmlCdata(&cdataTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s>\n"
" <DataTag><![CDATA[%s]]></DataTag>\n"
" <Description><![CDATA[%s]]></Description>\n"
"</Incident>\n", element->attributeValue(QTest::AI_Result),
location.constData(), cdataTag.constData(), cdataDesc.constData());
}
else {
QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s>\n"
" <Description><![CDATA[%s]]></Description>\n"
"</Incident>\n", element->attributeValue(QTest::AI_Result),
location.constData(), cdataDesc.constData());
}
break;
}
case QTest::LET_Error: {
// assuming type and attribute names don't need quoting
@ -88,12 +111,20 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, QTestCharBu
QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description));
QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <Description><![CDATA[%s]]></Description>\n</Message>\n",
QTestCharBuffer tagbuf;
if (element->attribute(QTest::AI_Tag)) {
QTestCharBuffer cdataTag;
QXmlTestLogger::xmlCdata(&cdataTag, element->attributeValue(QTest::AI_Tag));
QTest::qt_asprintf(&tagbuf, " <DataTag><![CDATA[%s]]></DataTag>\n", cdataTag.constData());
}
QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n%s <Description><![CDATA[%s]]></Description>\n</Message>\n",
element->attributeValue(QTest::AI_Type),
element->attributeName(QTest::AI_File),
quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line),
tagbuf.constData(),
cdataDesc.constData());
break;
}
@ -126,10 +157,29 @@ void QTestLightXmlStreamer::formatEnd(const QTestElement *element, QTestCharBuff
return;
if (element->elementType() == QTest::LET_TestCase) {
if( element->attribute(QTest::AI_Result) && element->childElements())
QTest::qt_asprintf(formatted, "</Incident>\n</TestFunction>\n");
else
bool failed = false;
for (QTestElement* child = element->childElements(); child; child = child->nextElement()) {
if ( child->elementType() == QTest::LET_Failure
&& child->attribute(QTest::AI_Result)
&& ( !strcmp(child->attributeValue(QTest::AI_Result), "fail")
|| !strcmp(child->attributeValue(QTest::AI_Result), "xpass"))
)
{
failed = true;
break;
}
}
// For passing functions, no Incident has been output yet.
// For failing functions, we already output one.
// Please note: we are outputting "pass" even if there was an xfail etc.
// This is by design (arguably bad design, but dangerous to change now!)
if (element->attribute(QTest::AI_Result) && !failed) {
QTest::qt_asprintf(formatted, "<Incident type=\"pass\" file=\"\" line=\"0\" />\n</TestFunction>\n");
}
else {
QTest::qt_asprintf(formatted, "</TestFunction>\n");
}
} else {
formatted->data()[0] = '\0';
}
@ -137,29 +187,11 @@ void QTestLightXmlStreamer::formatEnd(const QTestElement *element, QTestCharBuff
void QTestLightXmlStreamer::formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const
{
if(!element || !formatted)
Q_UNUSED(element);
if (!formatted)
return;
if (element->elementType() == QTest::LET_TestCase && element->attribute(QTest::AI_Result)) {
QTestCharBuffer buf;
QTestCharBuffer quotedFile;
QXmlTestLogger::xmlQuote(&quotedFile, element->attributeValue(QTest::AI_File));
QTest::qt_asprintf(&buf, "%s=\"%s\" %s=\"%s\"",
element->attributeName(QTest::AI_File),
quotedFile.constData(),
element->attributeName(QTest::AI_Line),
element->attributeValue(QTest::AI_Line));
if( !element->childElements() )
QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s />\n",
element->attributeValue(QTest::AI_Result), buf.constData());
else
QTest::qt_asprintf(formatted, "<Incident type=\"%s\" %s>\n",
element->attributeValue(QTest::AI_Result), buf.constData());
} else {
formatted->data()[0] = '\0';
}
formatted->data()[0] = '\0';
}
void QTestLightXmlStreamer::output(QTestElement *element) const

View File

@ -9,10 +9,10 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testNumber2">
<Incident type="fail" file="Unknown file" line="0">
<Message type="qfatal" file="" line="0">
<Description><![CDATA[ASSERT: "false" in file /local/user_builds/qt/4.6/tests/auto/selftests/assert/tst_assert.cpp, line 62]]></Description>
</Message>
<Incident type="fail" file="Unknown file" line="0">
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
</TestFunction>

View File

@ -6,44 +6,61 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="badDataTag">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/badxml/tst_badxml.cpp" line="109">
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/badxml/tst_badxml.cpp" line="109">
<DataTag><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
<BenchmarkResult metric="Events" tag="end cdata ]]&gt; text ]]&gt; more text" value="0" iterations="1" />
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[quotes " text" more text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/badxml/tst_badxml.cpp" line="109">
<DataTag><![CDATA[quotes " text" more text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
<BenchmarkResult metric="Events" tag="quotes &quot; text&quot; more text" value="0" iterations="1" />
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[xml close > open < tags < text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/badxml/tst_badxml.cpp" line="109">
<DataTag><![CDATA[xml close > open < tags < text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
<BenchmarkResult metric="Events" tag="xml close &gt; open &lt; tags &lt; text" value="0" iterations="1" />
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/badxml/tst_badxml.cpp" line="109">
<DataTag><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
<Description><![CDATA[a failure]]></Description>
<BenchmarkResult metric="Events" tag="all &gt; &quot; mixed ]]&gt; up &gt; &quot; in &lt; the ]]&gt; hopes &lt; of triggering &quot;&lt; ]]&gt; bugs" value="0" iterations="1" />
</Incident>
<BenchmarkResult metric="Events" tag="all &gt; &quot; mixed ]]&gt; up &gt; &quot; in &lt; the ]]&gt; hopes &lt; of triggering &quot;&lt; ]]&gt; bugs" value="0" iterations="1" />
</TestFunction>
<TestFunction name="badMessage">
<Incident type="pass" file="" line="0">
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[string 0]]></DataTag>
<Description><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[string 1]]></DataTag>
<Description><![CDATA[quotes " text" more text]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[string 2]]></DataTag>
<Description><![CDATA[xml close > open < tags < text]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[string 3]]></DataTag>
<Description><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="failWithNoFile">
<Incident type="fail" file="" line="0">

View File

@ -6,9 +6,8 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="twoHundredMillionInstructions">
<Incident type="pass" file="" line="0">
<BenchmarkResult metric="InstructionReads" tag="" value="200000000" iterations="1" />
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -6,7 +6,6 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="events">
<Incident type="pass" file="" line="0">
<BenchmarkResult metric="Events" tag="0" value="0" iterations="1" />
<BenchmarkResult metric="Events" tag="1" value="1" iterations="1" />
<BenchmarkResult metric="Events" tag="10" value="10" iterations="1" />
@ -14,7 +13,7 @@
<BenchmarkResult metric="Events" tag="500" value="500" iterations="1" />
<BenchmarkResult metric="Events" tag="5000" value="5000" iterations="1" />
<BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" />
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -13,15 +13,25 @@
</TestFunction>
<TestFunction name="compare_tostring">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/cmptest/tst_cmptest.cpp" line="122">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual): QVariant(int,123)
Expected (expected): QVariant(QString,hi)]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/cmptest/tst_cmptest.cpp" line="122">
<DataTag><![CDATA[null hash, invalid]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual): QVariant(QVariantHash)
Expected (expected): QVariant()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/cmptest/tst_cmptest.cpp" line="122">
<DataTag><![CDATA[string, null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual): QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/cmptest/tst_cmptest.cpp" line="122">
<DataTag><![CDATA[both non-null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual): QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>

View File

@ -6,30 +6,34 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="fiveTablePasses">
<Incident type="pass" file="" line="0">
<Message type="info" file="/local/user_builds/qt/4.6/tests/auto/selftests/commandlinedata/tst_commandlinedata.cpp" line="65">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Message type="info" file="/local/user_builds/qt/4.6/tests/auto/selftests/commandlinedata/tst_commandlinedata.cpp" line="65">
<DataTag><![CDATA[fiveTablePasses_data2]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Message type="info" file="/local/user_builds/qt/4.6/tests/auto/selftests/commandlinedata/tst_commandlinedata.cpp" line="65">
<DataTag><![CDATA[fiveTablePasses_data3]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Message type="info" file="/local/user_builds/qt/4.6/tests/auto/selftests/commandlinedata/tst_commandlinedata.cpp" line="65">
<DataTag><![CDATA[fiveTablePasses_data4]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Message type="info" file="/local/user_builds/qt/4.6/tests/auto/selftests/commandlinedata/tst_commandlinedata.cpp" line="65">
<DataTag><![CDATA[fiveTablePasses_data5]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="fiveTablePasses">
<Incident type="pass" file="" line="0">
<Message type="info" file="/local/user_builds/qt/4.6/tests/auto/selftests/commandlinedata/tst_commandlinedata.cpp" line="65">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -16,34 +16,63 @@
</TestFunction>
<TestFunction name="fiveTableFailures">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[fiveTableFailures_data 1]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[fiveTableFailures_data 2]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[fiveTableFailures_data 3]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[fiveTableFailures_data 4]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[fiveTableFailures_data 5]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
</TestFunction>
<TestFunction name="startsWithFailure">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[startsWithFailure_data 1]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
</TestFunction>
<TestFunction name="endsWithFailure">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[endsWithFailure 5]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
</TestFunction>
<TestFunction name="failureInMiddle">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="91">
<DataTag><![CDATA[failureInMiddle_data 3]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
</TestFunction>
<TestFunction name="fiveIsolatedFailures">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="173">
<DataTag><![CDATA[fiveIsolatedFailures_data 1]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="173">
<DataTag><![CDATA[fiveIsolatedFailures_data 2]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="173">
<DataTag><![CDATA[fiveIsolatedFailures_data 3]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="173">
<DataTag><![CDATA[fiveIsolatedFailures_data 4]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datatable/tst_datatable.cpp" line="173">
<DataTag><![CDATA[fiveIsolatedFailures_data 5]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
</TestFunction>

View File

@ -17,6 +17,8 @@
<Description><![CDATA[Compared values are not the same
Actual (operandA): http://example.com
Expected (operandB): ]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/datetime/tst_datetime.cpp" line="74">
<Description><![CDATA[Compared values are not the same
Actual (operandA):
Expected (operandB): http://example.com]]></Description>

View File

@ -6,29 +6,34 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="expectAndContinue">
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/expectfail/tst_expectfail.cpp" line="60">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/expectfail/tst_expectfail.cpp" line="60">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<Description><![CDATA[after]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="expectAndAbort">
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/expectfail/tst_expectfail.cpp" line="68">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/expectfail/tst_expectfail.cpp" line="68">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="xfailWithQString">
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/expectfail/tst_expectfail.cpp" line="75">
<Description><![CDATA[A string]]></Description>
</Incident>
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/expectfail/tst_expectfail.cpp" line="80">
<Description><![CDATA[Bug 5 (The message)]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -6,10 +6,12 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="fetchBogus">
<Incident type="fail" file="Unknown file" line="0">
<Message type="qfatal" file="" line="0">
<DataTag><![CDATA[foo]]></DataTag>
<Description><![CDATA[QFETCH: Requested testdata 'bubu' not available, check your _data function.]]></Description>
</Message>
<Incident type="fail" file="Unknown file" line="0">
<DataTag><![CDATA[foo]]></DataTag>
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
</TestFunction>

View File

@ -10,20 +10,22 @@
</TestFunction>
<TestFunction name="skip">
<Message type="skip" file="/local/user_builds/qt/4.6/tests/auto/selftests/globaldata/tst_globaldata.cpp" line="128">
<DataTag><![CDATA[1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
</TestFunction>
<TestFunction name="skipLocal">
<Message type="skip" file="/local/user_builds/qt/4.6/tests/auto/selftests/globaldata/tst_globaldata.cpp" line="148">
<DataTag><![CDATA[1:local 1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
</TestFunction>
<TestFunction name="skipSingle">
<Incident type="pass" file="" line="0">
<Message type="skip" file="/local/user_builds/qt/4.6/tests/auto/selftests/globaldata/tst_globaldata.cpp" line="142">
<DataTag><![CDATA[2:local 1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -6,7 +6,6 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="warn">
<Incident type="pass" file="" line="0">
<Message type="qwarn" file="" line="0">
<Description><![CDATA[0]]></Description>
</Message>
@ -6013,7 +6012,7 @@
<Message type="system" file="" line="0">
<Description><![CDATA[Maximum amount of warnings exceeded. Use -maxwarnings to override.]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -16,14 +16,15 @@
</Message>
</TestFunction>
<TestFunction name="singleSkip">
<Incident type="pass" file="" line="0">
<Message type="skip" file="/local/user_builds/qt/4.6/tests/auto/selftests/skip/tst_skip.cpp" line="97">
<DataTag><![CDATA[local 1]]></DataTag>
<Description><![CDATA[skipping one]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[local 2]]></DataTag>
<Description><![CDATA[this line should only be reached once (true)]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />

View File

@ -9,10 +9,16 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="compareByteArray">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/strcmp/tst_strcmp.cpp" line="88">
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/strcmp/tst_strcmp.cpp" line="88">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/strcmp/tst_strcmp.cpp" line="95">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/strcmp/tst_strcmp.cpp" line="102">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/strcmp/tst_strcmp.cpp" line="109">
<Description><![CDATA[Compared values are not the same
Actual (a): 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 ...
Expected (b): 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 ...]]></Description>

View File

@ -6,7 +6,6 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testWarnings">
<Incident type="pass" file="" line="0">
<Message type="qwarn" file="" line="0">
<Description><![CDATA[Warning]]></Description>
</Message>
@ -25,16 +24,16 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[Baba]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testMissingWarnings">
<Incident type="fail" file="" line="0">
<Message type="info" file="" line="0">
<Description><![CDATA[Did not receive message: "Warning0"]]></Description>
</Message>
<Message type="info" file="" line="0">
<Description><![CDATA[Did not receive message: "Warning1"]]></Description>
</Message>
<Incident type="fail" file="" line="0">
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
</TestFunction>

View File

@ -6,17 +6,16 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testFunc1">
<Incident type="pass" file="" line="0">
<Message type="warn" file="" line="0">
<Description><![CDATA[just a QWARN() !]]></Description>
</Message>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testFunc2">
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/xunit/tst_xunit.cpp" line="74">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[a qDebug() call with comment-ending stuff -->]]></Description>
</Message>
<Incident type="fail" file="/local/user_builds/qt/4.6/tests/auto/selftests/xunit/tst_xunit.cpp" line="74">
<Description><![CDATA[Compared values are not the same
Actual (2): 2
Expected (3): 3]]></Description>
@ -36,11 +35,13 @@
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/xunit/tst_xunit.cpp" line="98">
<Description><![CDATA[this failure is expected]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testFunc6">
<Incident type="xfail" file="/local/user_builds/qt/4.6/tests/auto/selftests/xunit/tst_xunit.cpp" line="104">
<Description><![CDATA[this failure is also expected]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="testFunc7">
<Incident type="xpass" file="/local/user_builds/qt/4.6/tests/auto/selftests/xunit/tst_xunit.cpp" line="110">

View File

@ -173,11 +173,12 @@ Logger::Logger(QString const& _name, QString const& _testdata_suffix, QStringLis
static QList<Logger> allLoggers()
{
return QList<Logger>()
<< Logger("plain", "txt", QStringList())
<< Logger("xml", "xml", QStringList() << "-xml")
<< Logger("xml flush", "xml", QStringList() << "-xml" << "-flush")
<< Logger("xunitxml", "xunitxml", QStringList() << "-xunitxml")
<< Logger("lightxml", "lightxml", QStringList() << "-lightxml")
<< Logger("plain", "txt", QStringList())
<< Logger("xml", "xml", QStringList() << "-xml")
<< Logger("xml flush", "xml", QStringList() << "-xml" << "-flush")
<< Logger("xunitxml", "xunitxml", QStringList() << "-xunitxml")
<< Logger("lightxml", "lightxml", QStringList() << "-lightxml")
<< Logger("lightxml flush", "lightxml", QStringList() << "-lightxml" << "-flush")
;
}
@ -416,11 +417,12 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QString const& logger, Q
const QString expected(QString::fromLatin1(exp.at(i)).replace("@INSERT_QT_VERSION_HERE@", QT_VERSION_STR));
if (line.contains("ASSERT") && output != expected) {
QEXPECT_FAIL("assert", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert xml", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert xml flush","QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert lightxml", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert xunitxml", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert xml", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert xml flush", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert lightxml", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert lightxml flush", "QTestLib prints out the absolute path.", Continue);
QEXPECT_FAIL("assert xunitxml", "QTestLib prints out the absolute path.", Continue);
}
/* On some platforms we compile without RTTI, and as a result we never throw an exception. */