diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2012-02-07 15:09:44 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-09 00:31:00 +0100 |
commit | e8420af07158dc3aa5c6ea7ddae6f8be4976e454 (patch) | |
tree | f2f3b7ab0ca941117dbc645337b1cd4a5b1ab8ae /src | |
parent | f7d2bcf3c59d07548b88e8c7546821a5e86222dc (diff) |
qmltest: Perform extra checks after each data row is executed.
Add calls to the new function QTestResult::finishedCurrentTestData() to
verify that expected failures and expected messages have been produced.
Change-Id: Ia139a962c705a5f47be992b7f2e81775aa2e2f28
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/testlib/TestCase.qml | 5 | ||||
-rw-r--r-- | src/qmltest/quicktest.cpp | 1 | ||||
-rw-r--r-- | src/qmltest/quicktestresult.cpp | 5 | ||||
-rw-r--r-- | src/qmltest/quicktestresult_p.h | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 5b853cbad5..a1ab85c4cb 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -486,6 +486,7 @@ Item { if (!qtest_results.skipped) { qtest_results.functionType = TestResult.Func qtest_runInternal(prop, arg) + qtest_results.finishTestData() qtest_results.functionType = TestResult.CleanupFunc qtest_runInternal("cleanup") } @@ -510,7 +511,9 @@ Item { else qtest_results.startBenchmark(TestResult.RunOnce, qtest_results.dataTag) while (!qtest_results.isBenchmarkDone()) { - if (!qtest_runInternal(prop, arg)) + var success = qtest_runInternal(prop, arg) + qtest_results.finishTestData() + if (!success) break qtest_results.nextBenchmark() } diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index b1b9897edd..ed5fa7b3f8 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -173,6 +173,7 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View & // Fail with error 0. results.fail(errors.at(0).description(), errors.at(0).url(), errors.at(0).line()); + results.finishTestData(); results.finishTestFunction(); results.setFunctionName(QString()); results.setFunctionType(QuickTestResult::NoWhere); diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index bd47064ed2..c1c5368eeb 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -355,6 +355,11 @@ void QuickTestResult::clearTestTable() d->table = 0; } +void QuickTestResult::finishTestData() +{ + QTestResult::finishedCurrentTestData(); +} + void QuickTestResult::finishTestFunction() { QTestResult::finishedCurrentTestFunction(); diff --git a/src/qmltest/quicktestresult_p.h b/src/qmltest/quicktestresult_p.h index 26e1591235..2c37faba7e 100644 --- a/src/qmltest/quicktestresult_p.h +++ b/src/qmltest/quicktestresult_p.h @@ -122,6 +122,7 @@ public Q_SLOTS: void initTestTable(); void clearTestTable(); + void finishTestData(); void finishTestFunction(); void fail(const QString &message, const QUrl &location, int line); |