diff options
author | Jason McDonald <[email protected]> | 2011-10-19 13:24:34 +1000 |
---|---|---|
committer | Qt by Nokia <[email protected]> | 2011-10-21 04:12:18 +0200 |
commit | 080a1f3ff328005b78f89381c8d9faf4b0b8e16c (patch) | |
tree | 31cacc4362b39e806448681232595b58f289cd92 | |
parent | 9167f5338ec978462d64f2f348144f674a2d599c (diff) |
Remove SkipMode from qtestlib API.
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 <[email protected]>
Reviewed-by: Rohan McGovern <[email protected]>
20 files changed, 36 insertions, 80 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 020f934aac..fd04c786a2 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -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") } diff --git a/src/imports/testlib/testcase.qdoc b/src/imports/testlib/testcase.qdoc index c08af334e5..719d9baea7 100644 --- a/src/imports/testlib/testcase.qdoc +++ b/src/imports/testlib/testcase.qdoc @@ -362,19 +362,7 @@ 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++. */ /*! diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index f3379ad14b..1924be0d26 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -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(), diff --git a/src/qmltest/quicktestresult_p.h b/src/qmltest/quicktestresult_p.h index 3e0ea18d25..8707b563e4 100644 --- a/src/qmltest/quicktestresult_p.h +++ b/src/qmltest/quicktestresult_p.h @@ -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, diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp index 574bbfab18..ba958859a0 100644 --- a/tests/auto/declarative/parserstress/tst_parserstress.cpp +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -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); diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp index 184a7df195..b3fa38de38 100644 --- a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp +++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp @@ -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("")); diff --git a/tests/auto/declarative/qjsengine/tst_qjsengine.cpp b/tests/auto/declarative/qjsengine/tst_qjsengine.cpp index 7df0064fa1..f83a1b3efd 100644 --- a/tests/auto/declarative/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/declarative/qjsengine/tst_qjsengine.cpp @@ -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. diff --git a/tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp b/tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp index 757270177e..aa39c52a31 100644 --- a/tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp +++ b/tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp @@ -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 diff --git a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp index fa3f13fea9..f8d7bfd28d 100644 --- a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp +++ b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp @@ -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; diff --git a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp b/tests/auto/declarative/qsgimage/tst_qsgimage.cpp index 84d5f75539..d0125e6582 100644 --- a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp +++ b/tests/auto/declarative/qsgimage/tst_qsgimage.cpp @@ -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 }"; diff --git a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp b/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp index 03dc18763c..22a33869fc 100644 --- a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp +++ b/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp @@ -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); diff --git a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp b/tests/auto/declarative/qsgtext/tst_qsgtext.cpp index ae3140e266..a46969e217 100644 --- a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp +++ b/tests/auto/declarative/qsgtext/tst_qsgtext.cpp @@ -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); diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp index 7afa5e6a75..9b48b5fbd4 100644 --- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp +++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp @@ -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 diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp index 67089d8de5..0a733b5618 100644 --- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp +++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp @@ -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!"; diff --git a/tests/auto/qmltest/selftests/tst_selftests.qml b/tests/auto/qmltest/selftests/tst_selftests.qml index 88f0468de9..3da615d8c2 100644 --- a/tests/auto/qmltest/selftests/tst_selftests.qml +++ b/tests/auto/qmltest/selftests/tst_selftests.qml @@ -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) diff --git a/tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp index 0c163e710a..e58e917492 100644 --- a/tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp +++ b/tests/auto/qtquick1/qdeclarativeanchors/tst_qdeclarativeanchors.cpp @@ -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."; diff --git a/tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index 3962102641..5915538393 100644 --- a/tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/qtquick1/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -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; diff --git a/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 2289762c54..2f5accae93 100644 --- a/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -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 diff --git a/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index fde2a49a5c..ff080cc1f2 100644 --- a/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -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 diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp index 70099f669f..ebc51dde8a 100644 --- a/tests/benchmarks/declarative/creation/tst_creation.cpp +++ b/tests/benchmarks/declarative/creation/tst_creation.cpp @@ -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(); |