Skip to content

Commit

Permalink
Remove SkipMode from qtestlib API.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason McDonald authored and Qt by Nokia committed Oct 21, 2011
1 parent 9167f53 commit 080a1f3
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 80 deletions.
5 changes: 3 additions & 2 deletions src/imports/testlib/TestCase.qml
Expand Up @@ -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")
}

Expand Down
14 changes: 1 addition & 13 deletions src/imports/testlib/testcase.qdoc
Expand Up @@ -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++.
*/

/*!
Expand Down
9 changes: 1 addition & 8 deletions src/qmltest/quicktestresult.cpp
Expand Up @@ -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(),
Expand Down
3 changes: 1 addition & 2 deletions src/qmltest/quicktestresult_p.h
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/declarative/parserstress/tst_parserstress.cpp
Expand Up @@ -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);
Expand Down
Expand Up @@ -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(""));
Expand Down Expand Up @@ -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(""));
Expand Down
14 changes: 7 additions & 7 deletions tests/auto/declarative/qjsengine/tst_qjsengine.cpp
Expand Up @@ -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")));
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/declarative/qsgimage/tst_qsgimage.cpp
Expand Up @@ -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 }";
Expand Down
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions tests/auto/declarative/qsgtext/tst_qsgtext.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -1822,7 +1822,7 @@ void tst_qsgtextinput::cursorVisible()

void tst_qsgtextinput::cursorRectangle()
{
QSKIP("QTBUG-21689", SkipAll);
QSKIP("QTBUG-21689");

QString text = "Hello World!";

Expand Down
32 changes: 4 additions & 28 deletions tests/auto/qmltest/selftests/tst_selftests.qml
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Expand Up @@ -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.";
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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

Expand Down
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/benchmarks/declarative/creation/tst_creation.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 080a1f3

Please sign in to comment.