Commit Graph

4 Commits

Author SHA1 Message Date
Jason McDonald
26c41ed918 testlib: Clear ignored messages after every data row
Previously, ignored messages were only cleared at the end of each test
function, i.e. after all data rows were finished. This meant that if a
data row in a data-driven test function didn't cause all of the expected
messages to be generated, the remaining messages would be carried over
to the next data row.  This would result in errors about missing
messages being associated with the last data row rather than with the
correct data row.

This commit makes testlib check for missing ignored messages after
running each data row rather than only doing so after the last data
row.

This commit also adds a regression test to demonstrate that ignored
messages can no longer be carried over from one data row to another.

Change-Id: Ibee51aa6e96866fbcbcb4acee1a8340a86a6a4ba
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-08 03:13:23 +01:00
Jason McDonald
9f883c7571 Use placeholder for Qt version in expected output
The selftests already used the @INSERT_QT_VERSION_HERE@ placeholder
in place of the real Qt and QTestlib versions in the expected test
output of the subtests.  For unknown reasons, the same was not true for
the expected plain text output.  In the past, this has caused Release
Managers to waste time incrementing the version numbers in these files.

Change-Id: I52f7870486fce128c04d53ff06978afa947474fd
Reviewed-on: http://codereview.qt-project.org/5375
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-26 07:50:20 +02:00
Jason McDonald
1fcc6ba3d9 Remove printf calls from warnings selftest
The warnings selftest verifies that qtestlib correctly handles output
sent via qDebug() and friends.  The test had a number of printf calls
that were used to tell the user what output they should expect to see
next, but by bypassing testlib's logging, these made the testlog differ
depending on whether the test log was directed to the console or a file.

The printf calls are no longer needed, as any regressions in qDebug will
be detected by tst_selftests, which compares the output of the warnings
test with a reference copy of the expected output.

Change-Id: I8c3a3237463141fa494c50ca02062760cb583090
Reviewed-on: http://codereview.qt-project.org/5200
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-21 03:59:09 +02:00
Jo Asplin
87ee382419 Moved autotests in category 'testlib' into new directory structure
Task-number: QTBUG-21353

Change-Id: I2e2ad4b7570f80b3e6500821f769e967f0a75027
Reviewed-on: http://codereview.qt-project.org/4438
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-12 08:36:15 +02:00