diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-06-01 03:08:32 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-06-01 03:24:00 (GMT) |
commit | 049619000c031964cf33ef351d3df619a6815f5e (patch) | |
tree | 8d4da676cd5d3d0f19dad6dcdd005e48979721d3 /tests | |
parent | 5f1ec2a20d13b9ca9bae1b7b40692925dcd99051 (diff) | |
download | Qt-049619000c031964cf33ef351d3df619a6815f5e.zip Qt-049619000c031964cf33ef351d3df619a6815f5e.tar.gz Qt-049619000c031964cf33ef351d3df619a6815f5e.tar.bz2 |
Fixed failure of tst_Selftests::checkXML.
Cherry-pick of 548da9a5434d615456a7a6efda3380b7138c6000 and some
earlier changes predating public repo.
Note that this test is not failing if using Qt 4.5 only.
However, it fails if using Qt 4.5 selftests against Qt master testlib.
We want to be able to use master testlib to run 4.5 testcases,
and this change does no harm when using Qt 4.5 testlib, so backport
it to 4.5 for convenience.
Original change description follows:
A few tests use printf, which means they interfere with the XML test
logging. Blacklist them for the XML test.
Note that these tests happened to pass under the old test logger
implementation. That was because the test logger always printed XML
tags on a single line, and the printf calls contained no special XML
characters. The test logs generated were technically valid XML but
contained extraneous text.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/selftests/expected_skip.txt | 2 | ||||
-rw-r--r-- | tests/auto/selftests/skip/tst_skip.cpp | 6 | ||||
-rw-r--r-- | tests/auto/selftests/tst_selftests.cpp | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt index ba41e67..f3be5b5 100644 --- a/tests/auto/selftests/expected_skip.txt +++ b/tests/auto/selftests/expected_skip.txt @@ -7,7 +7,7 @@ SKIP : tst_Skip::emptytest() skipping all Loc: [/home/fenglich/dev/qt-4.3/tests/auto/selftests/skip/tst_skip.cpp(45)] SKIP : tst_Skip::singleSkip(local 1) skipping one Loc: [/home/fenglich/dev/qt-4.3/tests/auto/selftests/skip/tst_skip.cpp(64)] -this line should only be reached once (true) +QDEBUG : tst_Skip::singleSkip(local 2) this line should only be reached once (true) PASS : tst_Skip::singleSkip() PASS : tst_Skip::cleanupTestCase() Totals: 3 passed, 0 failed, 3 skipped diff --git a/tests/auto/selftests/skip/tst_skip.cpp b/tests/auto/selftests/skip/tst_skip.cpp index b1a3936..437cf62 100644 --- a/tests/auto/selftests/skip/tst_skip.cpp +++ b/tests/auto/selftests/skip/tst_skip.cpp @@ -70,7 +70,7 @@ void tst_Skip::test_data() void tst_Skip::test() { - printf("this line should never be reached, since we skip in the _data function\n"); + qDebug("this line should never be reached, since we skip in the _data function"); } void tst_Skip::emptytest_data() @@ -80,7 +80,7 @@ void tst_Skip::emptytest_data() void tst_Skip::emptytest() { - printf("this line should never be reached, since we skip in the _data function\n"); + qDebug("this line should never be reached, since we skip in the _data function"); } void tst_Skip::singleSkip_data() @@ -95,7 +95,7 @@ void tst_Skip::singleSkip() QFETCH(bool, booll); if (!booll) QSKIP("skipping one", SkipSingle); - printf("this line should only be reached once (%s)\n", booll ? "true" : "false"); + qDebug("this line should only be reached once (%s)", booll ? "true" : "false"); } QTEST_MAIN(tst_Skip) diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 103fd79..6776b12 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -295,6 +295,11 @@ void tst_Selftests::initTestCase() m_checkXMLBlacklist.append("differentexec"); m_checkXMLBlacklist.append("qexecstringlist"); m_checkXMLBlacklist.append("benchliboptions"); + + /* These tests use printf and therefore corrupt the testlog */ + m_checkXMLBlacklist.append("subtest"); + m_checkXMLBlacklist.append("globaldata"); + m_checkXMLBlacklist.append("warnings"); } void tst_Selftests::checkXML() const |