diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2012-02-09 16:17:32 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-13 04:20:25 +0100 |
commit | 5572b4c9ed6041d23c79c9cd93d196653a690a43 (patch) | |
tree | caa4c2ad98bdc6dd2d313fe86a9f3688b38272be /src/qmltest/quicktestresult.cpp | |
parent | 09923aec384ae8b972c85e9912aa89a8c2eeba8b (diff) |
qmltest: Count passes, fails and skips consistently.
This commit changes qmltest to count one pass per data row, rather than
a single pass for an entire data-driven test function. This makes
counting of passes consistent with counting of fails and skips which
were already counted once per data row. This change also means that the
plain-text, xml and light-xml output formats will now show one result
per data row, so that every data row executed will be shown in the test
output with either a pass, fail or skip result. Previously data rows
that passed were not shown in the output, preventing analysis of total
number of tests runs, pass-rates, and various other metrics.
This commit corresponds to (and depends on) a commit in the qtbase
module which changes the behaviour of qtestlib in the same way.
Task-number: QTBUG-21848
Task-number: QTBUG-22124
Change-Id: I3c1f0e68bdff4087b9ccfc80a3f96f4541335b6f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/qmltest/quicktestresult.cpp')
-rw-r--r-- | src/qmltest/quicktestresult.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index ddfa928f96..5654c87ad9 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -192,28 +192,15 @@ void QuickTestResult::setDataTag(const QString &tag) /*! \qmlproperty bool TestResult::failed - This property returns true if the current test function has - failed; false otherwise. The fail state is reset when - functionName is changed or finishTestFunction() is called. + This property returns true if the current test function (or + current test data row for a data-driven test) has failed; + false otherwise. The fail state is reset when functionName + is changed or finishTestDataCleanup() is called. - \sa skipped, dataFailed + \sa skipped */ bool QuickTestResult::isFailed() const { - return QTestResult::testFailed(); -} - -/*! - \qmlproperty bool TestResult::dataFailed - - This property returns true if the current data function has - failed; false otherwise. The fail state is reset when - functionName is changed or finishTestFunction() is called. - - \sa failed -*/ -bool QuickTestResult::isDataFailed() const -{ return QTestResult::currentTestFailed(); } @@ -349,6 +336,11 @@ void QuickTestResult::finishTestData() QTestResult::finishedCurrentTestData(); } +void QuickTestResult::finishTestDataCleanup() +{ + QTestResult::finishedCurrentTestDataCleanup(); +} + void QuickTestResult::finishTestFunction() { QTestResult::finishedCurrentTestFunction(); |