summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-09-30 09:35:45 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-09-30 09:35:45 +1000
commitf6f63a6744eb5f7a65a9885befa85c9166cbde00 (patch)
tree54c80aa14bbed7838e47c5b26fb38a6c86c20f00
parent33a6204f85c9ea41e123d0abed6cafcc78acc0ca (diff)
Make the error reports more consistent with qtestlib.
-rw-r--r--QtTest/TestCaseBase.qml17
1 files changed, 12 insertions, 5 deletions
diff --git a/QtTest/TestCaseBase.qml b/QtTest/TestCaseBase.qml
index 122c6ae..b44dc06 100644
--- a/QtTest/TestCaseBase.qml
+++ b/QtTest/TestCaseBase.qml
@@ -14,14 +14,16 @@ Item {
property string expectFailMsg
function fail(msg) {
+ if (!msg)
+ msg = "";
if (expectingFail) {
if (expectFailMsg)
- print("EXPECT : " + currentTestCase + " " + expectFailMsg + " " + msg)
+ print("XFAIL : " + currentTestCase + " " + expectFailMsg + " " + msg)
else
- print("EXPECT : " + currentTestCase + " " + msg)
+ print("XFAIL : " + currentTestCase + " " + msg)
throw new Error("QtTest::expect_fail")
} else {
- print("FAIL : " + currentTestCase + " " + msg)
+ print("FAIL! : " + currentTestCase + " " + msg)
throw new Error("QtTest::fail")
}
}
@@ -68,8 +70,13 @@ Item {
expectingFail = false
try {
testCase[prop]()
- ++numPassed
- print("PASS : " + currentTestCase)
+ if (expectingFail) {
+ ++numFailed
+ print("XPASS : " + currentTestCase)
+ } else {
+ ++numPassed
+ print("PASS : " + currentTestCase)
+ }
} catch (e) {
if (e.message == "QtTest::fail") {
++numFailed