Remove SkipMode from qtestlib API.
authorJason McDonald <jason.mcdonald@nokia.com>
Wed, 19 Oct 2011 03:24:34 +0000 (13:24 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 21 Oct 2011 02:12:18 +0000 (04:12 +0200)
The SkipMode parameter to QSKIP has been removed in qtbase, therefore it
must also be removed here.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I8016f8c28338b1b532bdb593c796d699b99250dc
Reviewed-by: Charles Yin <charles.yin@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
20 files changed:
src/imports/testlib/TestCase.qml
src/imports/testlib/testcase.qdoc
src/qmltest/quicktestresult.cpp
src/qmltest/quicktestresult_p.h
tests/auto/declarative/parserstress/tst_parserstress.cpp
tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp
tests/auto/declarative/qjsengine/tst_qjsengine.cpp
tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp
tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
tests/auto/declarative/qsgimage/tst_qsgimage.cpp
tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp
tests/auto/declarative/qsgtext/tst_qsgtext.cpp
tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
tests/auto/qmltest/selftests/tst_selftests.qml
tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
tests/benchmarks/declarative/creation/tst_creation.cpp

index 020f934..fd04c78 100644 (file)
@@ -307,14 +307,15 @@ Item {
     function skip(msg) {
         if (msg === undefined)
             msg = ""
-        qtest_results.skipSingle(msg, util.callerFile(), util.callerLine())
+        qtest_results.skip(msg, util.callerFile(), util.callerLine())
         throw new Error("QtQuickTest::skip")
     }
 
     function skipAll(msg) {
         if (msg === undefined)
             msg = ""
-        qtest_results.skipAll(msg, util.callerFile(), util.callerLine())
+        warn("The skipAll function is deprecated and will be removed soon. Please update this test by changing skipAll to skip.")
+        qtest_results.skip(msg, util.callerFile(), util.callerLine())
         throw new Error("QtQuickTest::skip")
     }
 
index c08af33..719d9ba 100644 (file)
 
     Skips the current test case and prints the optional \a message.
     If this is a data-driven test, then only the current row is skipped.
-    Similar to \c{QSKIP(message, SkipSingle)} in C++.
-
-    \sa skipAll()
-*/
-
-/*!
-    \qmlmethod TestCase::skipAll(message = "")
-
-    Skips the current test case and prints the optional \a message.
-    If this is a data-driven test, then all remaining rows are skipped.
-    Similar to \c{QSKIP(message, SkipAll)} in C++.
-
-    \sa skip()
+    Similar to \c{QSKIP(message)} in C++.
 */
 
 /*!
index f3379ad..1924be0 100644 (file)
@@ -404,14 +404,7 @@ bool QuickTestResult::compare
     }
 }
 
-void QuickTestResult::skipSingle
-    (const QString &message, const QString &file, int line)
-{
-    QTestResult::addSkip(message.toLatin1().constData(),
-                         qtest_fixFile(file).toLatin1().constData(), line);
-}
-
-void QuickTestResult::skipAll
+void QuickTestResult::skip
     (const QString &message, const QString &file, int line)
 {
     QTestResult::addSkip(message.toLatin1().constData(),
index 3e0ea18..8707b56 100644 (file)
@@ -129,8 +129,7 @@ public Q_SLOTS:
     bool compare(bool success, const QString &message,
                  const QString &val1, const QString &val2,
                  const QString &file, int line);
-    void skipSingle(const QString &message, const QString &file, int line);
-    void skipAll(const QString &message, const QString &file, int line);
+    void skip(const QString &message, const QString &file, int line);
     bool expectFail(const QString &tag, const QString &comment,
                     const QString &file, int line);
     bool expectFailContinue(const QString &tag, const QString &comment,
index 574bbfa..ba95885 100644 (file)
@@ -100,7 +100,7 @@ void tst_parserstress::ecmascript_data()
 void tst_parserstress::ecmascript()
 {
 #ifndef TESTDATADIR
-    QSKIP("Needs QtScript sources", SkipAll);
+    QSKIP("Needs QtScript sources");
 #else
 
     QFETCH(QString, file);
index 184a7df..b3fa38d 100644 (file)
@@ -67,7 +67,7 @@ tst_qdeclarativeapplication::tst_qdeclarativeapplication()
 
 void tst_qdeclarativeapplication::active()
 {
-    QSKIP("QTBUG-21573", SkipAll);
+    QSKIP("QTBUG-21573");
 
     QDeclarativeComponent component(&engine);
     component.setData("import QtQuick 2.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile(""));
@@ -100,7 +100,7 @@ void tst_qdeclarativeapplication::active()
 
 void tst_qdeclarativeapplication::layoutDirection()
 {
-    QSKIP("QTBUG-21573", SkipAll);
+    QSKIP("QTBUG-21573");
 
     QDeclarativeComponent component(&engine);
     component.setData("import QtQuick 2.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile(""));
index 7df0064..f83a1b3 100644 (file)
@@ -701,7 +701,7 @@ void tst_QJSEngine::newVariant_promoteObject()
         QVERIFY(object.property("foo").isObject());
         QVERIFY(!object.property("foo").isVariant());
         QScriptValue originalProto = object.property("foo").prototype();
-        QSKIP("It is not possible to promote plain object to a wrapper", SkipAll);
+        QSKIP("It is not possible to promote plain object to a wrapper");
         QScriptValue ret = eng.newVariant(object.property("foo"), QVariant(123));
         QVERIFY(ret.isValid());
         QVERIFY(ret.strictlyEquals(object.property("foo")));
@@ -781,7 +781,7 @@ void tst_QJSEngine::newVariant_promoteNonObject()
 
 void tst_QJSEngine::newVariant_promoteNonQScriptObject()
 {
-    QSKIP("This test relay on limitation of QtScript JSC implementation", SkipAll);
+    QSKIP("This test relay on limitation of QtScript JSC implementation");
     QScriptEngine eng;
     {
         QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::newVariant(): changing class of non-QScriptObject not supported");
@@ -1073,7 +1073,7 @@ void tst_QJSEngine::newQObject_promoteObject()
 void tst_QJSEngine::newQObject_sameQObject()
 {
 #if 0 // ###FIXME: No QObjectWrapOptions API
-    QSKIP("This test stongly relay on strictlyEquals feature that would change in near future", SkipAll);
+    QSKIP("This test stongly relay on strictlyEquals feature that would change in near future");
     QScriptEngine eng;
     // calling newQObject() several times with same object
     for (int x = 0; x < 2; ++x) {
@@ -1151,7 +1151,7 @@ void tst_QJSEngine::newQObject_promoteNonObject()
 void tst_QJSEngine::newQObject_promoteNonQScriptObject()
 {
 #if 0 // ### FIXME: object promotion is not supported
-    QSKIP("Promotion of non QScriptObjects kind of works (there is not difference between Object and Array, look at comments in newQObject implementation).", SkipAll);
+    QSKIP("Promotion of non QScriptObjects kind of works (there is not difference between Object and Array, look at comments in newQObject implementation).");
     QScriptEngine eng;
     {
         QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::newQObject(): changing class of non-QScriptObject not supported");
@@ -1319,7 +1319,7 @@ void tst_QJSEngine::newQMetaObject()
 #if 0 // ###FIXME: No activation object support
 void tst_QJSEngine::newActivationObject()
 {
-    QSKIP("internal function not implemented in JSC-based back-end", SkipAll);
+    QSKIP("internal function not implemented in JSC-based back-end");
     QScriptEngine eng;
     QScriptValue act = eng.newActivationObject();
     QEXPECT_FAIL("", "", Continue);
@@ -3776,7 +3776,7 @@ void tst_QJSEngine::abortEvaluation()
 
 void tst_QJSEngine::abortEvaluation_tryCatch()
 {
-    QSKIP("It crashes", SkipAll);
+    QSKIP("It crashes");
     QScriptEngine eng;
     EventReceiver3 receiver(&eng);
     eng.setProcessEventsInterval(100);
@@ -4876,7 +4876,7 @@ void tst_QJSEngine::jsFutureReservedWords_data()
 
 void tst_QJSEngine::jsFutureReservedWords()
 {
-    QSKIP("Fails", SkipAll);
+    QSKIP("Fails");
     // See ECMA-262 Section 7.6.1.2, "Future Reserved Words".
     // In real-world implementations, most of these words are
     // actually allowed as normal identifiers.
index 7572701..aa39c52 100644 (file)
@@ -169,7 +169,7 @@ void tst_qsganimatedimage::mirror_running()
     QCOMPARE(anim->currentFrame(), 0);  // animation only has 2 frames, should cycle back to first
     QPixmap frame0_flipped = QPixmap::fromImage(canvas->grabFrameBuffer());
 
-    QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved", SkipSingle);
+    QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved");
 
     QTransform transform;
     transform.translate(width, 0).scale(-1, 1.0);
@@ -207,7 +207,7 @@ void tst_qsganimatedimage::mirror_notRunning()
     anim->setProperty("mirror", true);
     screenshot = QPixmap::fromImage(canvas->grabFrameBuffer());
 
-    QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved", SkipSingle);
+    QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved");
     QCOMPARE(screenshot, expected);
 
     // mirroring should not change the current frame or playing status
index fa3f13f..f8d7bfd 100644 (file)
@@ -534,7 +534,7 @@ void tst_qsgflickable::disabled()
 void tst_qsgflickable::flickVelocity()
 {
 #ifdef Q_WS_MAC
-    QSKIP("Producing flicks on Mac CI impossible due to timing problems", SkipAll);
+    QSKIP("Producing flicks on Mac CI impossible due to timing problems");
 #endif
 
     QSGView *canvas = new QSGView;
index 84d5f75..d0125e6 100644 (file)
@@ -352,7 +352,7 @@ void tst_qsgimage::mirror()
 void tst_qsgimage::svg()
 {
     if (!QImageReader::supportedImageFormats().contains("svg"))
-        QSKIP("svg support not available", SkipAll);
+        QSKIP("svg support not available");
 
     QString src = QUrl::fromLocalFile(TESTDATA("heart.svg")).toString();
     QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }";
index 03dc187..22a3386 100644 (file)
@@ -1404,7 +1404,7 @@ void tst_qsgpositioners::test_attachedproperties_data()
 
 void tst_qsgpositioners::test_attachedproperties_dynamic()
 {
-    QSKIP("QTBUG-21995 - Test crashes on exit", SkipAll);
+    QSKIP("QTBUG-21995 - Test crashes on exit");
     QSGView *canvas = createView(TESTDATA("attachedproperties-dynamic.qml"));
     QVERIFY(canvas->rootObject() != 0);
 
index ae3140e..a46969e 100644 (file)
@@ -514,8 +514,7 @@ void tst_qsgtext::alignments_data()
 
 void tst_qsgtext::alignments()
 {
-
-    QSKIP("Text alignment pixmap comparison tests will not work with scenegraph", SkipAll);
+    QSKIP("Text alignment pixmap comparison tests will not work with scenegraph");
 #if (0)// No widgets in scenegraph
     QFETCH(int, hAlign);
     QFETCH(int, vAlign);
index 7afa5e6..9b48b5f 100644 (file)
@@ -420,7 +420,7 @@ void tst_qsgtextedit::alignments_data()
 
 void tst_qsgtextedit::alignments()
 {
-    QSKIP("Image comparison of text is almost guaranteed to fail during development", SkipAll);
+    QSKIP("Image comparison of text is almost guaranteed to fail during development");
 
     QFETCH(int, hAlign);
     QFETCH(int, vAlign);
@@ -1800,7 +1800,7 @@ void tst_qsgtextedit::copyAndPaste() {
         if (status == noErr)
             CFRelease(pasteboard);
         else
-            QSKIP("This machine doesn't support the clipboard", SkipAll);
+            QSKIP("This machine doesn't support the clipboard");
     }
 #endif
 
index 67089d8..0a733b5 100644 (file)
@@ -1052,7 +1052,7 @@ void tst_qsgtextinput::horizontalAlignment_data()
 
 void tst_qsgtextinput::horizontalAlignment()
 {
-    QSKIP("Image comparison of text is almost guaranteed to fail during development", SkipAll);
+    QSKIP("Image comparison of text is almost guaranteed to fail during development");
 
     QFETCH(int, hAlign);
     QFETCH(QString, expectfile);
@@ -1605,7 +1605,7 @@ void tst_qsgtextinput::copyAndPaste() {
         if (status == noErr)
             CFRelease(pasteboard);
         else
-            QSKIP("This machine doesn't support the clipboard", SkipAll);
+            QSKIP("This machine doesn't support the clipboard");
     }
 #endif
 
@@ -1822,7 +1822,7 @@ void tst_qsgtextinput::cursorVisible()
 
 void tst_qsgtextinput::cursorRectangle()
 {
-    QSKIP("QTBUG-21689", SkipAll);
+    QSKIP("QTBUG-21689");
 
     QString text = "Hello World!";
 
index 88f0468..3da615d 100644 (file)
@@ -82,12 +82,8 @@ TestCase {
             }
         }
 
-        function skipSingle(msg, file, line) {
-            failmsg = "skipSingle:" + msg
-        }
-
-        function skipAll(msg, file, line) {
-            failmsg = "skipAll:" + msg
+        function skip(msg, file, line) {
+            failmsg = "skip:" + msg
         }
     }
 
@@ -271,7 +267,7 @@ TestCase {
             testCase.skip("foo")
         } catch (e) {
             compare(e.message, "QtQuickTest::skip")
-            compare(functions.failmsg, "skipSingle:foo")
+            compare(functions.failmsg, "skip:foo")
             caught = true
         }
         verify(caught)
@@ -281,27 +277,7 @@ TestCase {
             testCase.skip()
         } catch (e) {
             compare(e.message, "QtQuickTest::skip")
-            compare(functions.failmsg, "skipSingle:")
-            caught = true
-        }
-        verify(caught)
-
-        caught = false
-        try {
-            testCase.skipAll("foo")
-        } catch (e) {
-            compare(e.message, "QtQuickTest::skip")
-            compare(functions.failmsg, "skipAll:foo")
-            caught = true
-        }
-        verify(caught)
-
-        caught = false
-        try {
-            testCase.skipAll()
-        } catch (e) {
-            compare(e.message, "QtQuickTest::skip")
-            compare(functions.failmsg, "skipAll:")
+            compare(functions.failmsg, "skip:")
             caught = true
         }
         verify(caught)
index 0c163e7..e58e917 100644 (file)
@@ -376,7 +376,7 @@ void tst_QDeclarative1Anchors::loops()
     }
 
     {
-        QSKIP("This causes a lockup due to Bearer management stuff", SkipSingle);
+        QSKIP("This causes a lockup due to Bearer management stuff");
         QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop2.qml"));
 
         QString expect = source.toString() + ":8:3: QML Image: Possible anchor loop detected on horizontal anchor.";
index 3962102..5915538 100644 (file)
@@ -513,7 +513,7 @@ void tst_qdeclarativeflickable::disabled()
 void tst_qdeclarativeflickable::flickVelocity()
 {
 #ifdef Q_WS_MAC
-    QSKIP("Producing flicks on Mac CI impossible due to timing problems", SkipAll);
+    QSKIP("Producing flicks on Mac CI impossible due to timing problems");
 #endif
 
     QDeclarativeView *canvas = new QDeclarativeView;
index 2289762..2f5acca 100644 (file)
@@ -1917,7 +1917,7 @@ void tst_qdeclarativetextedit::copyAndPaste() {
         if (status == noErr)
             CFRelease(pasteboard);
         else
-            QSKIP("This machine doesn't support the clipboard", SkipAll);
+            QSKIP("This machine doesn't support the clipboard");
     }
 #endif
 
index fde2a49..ff080cc 100644 (file)
@@ -1665,7 +1665,7 @@ void tst_qdeclarativetextinput::copyAndPaste() {
         if (status == noErr)
             CFRelease(pasteboard);
         else
-            QSKIP("This machine doesn't support the clipboard", SkipAll);
+            QSKIP("This machine doesn't support the clipboard");
     }
 #endif
 
index 70099f6..ebc51dd 100644 (file)
@@ -348,7 +348,7 @@ void tst_creation::elements()
     QFETCH(QString, type);
     QDeclarativeType *t = QDeclarativeMetaType::qmlType(type, 2, 0);
     if (!t || !t->isCreatable())
-        QSKIP("Non-creatable type", SkipSingle);
+        QSKIP("Non-creatable type");
 
     QBENCHMARK {
         QObject *obj = t->create();