From 5572b4c9ed6041d23c79c9cd93d196653a690a43 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 9 Feb 2012 16:17:32 +1000 Subject: 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 Reviewed-by: Yunqiao Yin --- src/imports/testlib/TestCase.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/imports/testlib') diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 02fa095da2..1e08686b61 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -477,7 +477,7 @@ Item { e.fileName, e.lineNumber) } } - return !qtest_results.dataFailed + return !qtest_results.failed } function qtest_runFunction(prop, arg) { @@ -486,6 +486,7 @@ Item { qtest_runInternal(prop, arg) qtest_results.finishTestData() qtest_runInternal("cleanup") + qtest_results.finishTestDataCleanup() } } @@ -515,6 +516,7 @@ Item { // Run the cleanup function. qtest_runInternal("cleanup") + qtest_results.finishTestDataCleanup() } while (!qtest_results.measurementAccepted()) qtest_results.endDataRun() } while (qtest_results.needsMoreMeasurements()) @@ -566,6 +568,8 @@ Item { var runTests = true if (!qtest_runInternal("initTestCase")) runTests = false + qtest_results.finishTestData() + qtest_results.finishTestDataCleanup() qtest_results.finishTestFunction() // Run the test methods. @@ -636,6 +640,8 @@ Item { // Clean up and exit. running = false completed = true + qtest_results.finishTestData() + qtest_results.finishTestDataCleanup() qtest_results.finishTestFunction() qtest_results.functionName = "" -- cgit v1.2.3