[kdelibs/frameworks] /: Add a porting macro QSKIP_PORTING.

Stephen Kelly steveire at gmail.com
Tue Feb 21 17:35:46 UTC 2012


Git commit 59c089ab7bb187b841b386da2153a2c1699d57c4 by Stephen Kelly.
Committed on 21/02/2012 at 18:25.
Pushed by skelly into branch 'frameworks'.

Add a porting macro QSKIP_PORTING.

The QSKIP macro has changed its API in Qt5.

The more of these hacks we accumulate, the more sense it will make
to drop Qt4 support in frameworks.

CCMAIL: kde-frameworks-devel at kde.org

M  +3    -3    kdecore/tests/kautostarttest.cpp
M  +2    -2    kdecore/tests/kdatetimetest.cpp
M  +3    -3    kdecore/tests/kdirwatch_unittest.cpp
M  +2    -2    kdecore/tests/klocaletest.cpp
M  +1    -1    kdecore/tests/klocalizedstringtest.cpp
M  +8    -8    kdecore/tests/kmimetypetest.cpp
M  +1    -1    kdecore/tests/kmountpointtest.cpp
M  +2    -2    kdecore/tests/kprocesstest.cpp
M  +1    -1    kdecore/tests/ksavefiletest.cpp
M  +11   -11   kdecore/tests/kservicetest.cpp
M  +7    -7    kdecore/tests/kstandarddirstest.cpp
M  +1    -1    kdecore/tests/ksycocadicttest.cpp
M  +3    -3    kdecore/tests/kurltest.cpp
M  +9    -0    kdecore/util/qtest_kde.h
M  +2    -2    kdeui/tests/kconfig_compiler/kconfigcompiler_test.cpp
M  +6    -6    kdeui/tests/kglobalshortcuttest.cpp
M  +1    -1    kdeui/tests/ktextedit_unittest.cpp
M  +2    -2    kdeui/tests/ktimezonewidget_unittest.cpp
M  +1    -1    kio/tests/fileundomanagertest.cpp
M  +5    -5    kio/tests/kdirmodeltest.cpp
M  +1    -1    kio/tests/kprotocolinfotest.cpp
M  +1    -1    kio/tests/krununittest.cpp
M  +1    -1    kpty/tests/kptyprocesstest.cpp
M  +3    -3    kutils/kemoticons/tests/kemoticontest.cpp
M  +1    -1    staging/kcoreaddons/autotests/klockfiletest.cpp
M  +2    -2    tier2/sonnet/core/tests/test_core.cpp

http://commits.kde.org/kdelibs/59c089ab7bb187b841b386da2153a2c1699d57c4

diff --git a/kdecore/tests/kautostarttest.cpp b/kdecore/tests/kautostarttest.cpp
index c980fb4..33b998d 100644
--- a/kdecore/tests/kautostarttest.cpp
+++ b/kdecore/tests/kautostarttest.cpp
@@ -66,7 +66,7 @@ void KAutostartTest::testStartInEnvDetection()
     KAutostart autostart("plasma-desktop");
     // Let's see if plasma.desktop actually exists
     if ( KStandardDirs::locate("autostart", "plasma-desktop.desktop").isEmpty() )
-        QSKIP( "plasma-desktop.desktop not found, kdebase not installed", SkipSingle );
+        QSKIP_PORTING( "plasma-desktop.desktop not found, kdebase not installed", SkipSingle );
     else
         QCOMPARE(autostart.autostarts(env), doesAutostart);
 }
@@ -97,7 +97,7 @@ void KAutostartTest::testStartphase()
 void KAutostartTest::testStartName()
 {
     if ( !KAutostart::isServiceRegistered("plasma-desktop") )
-        QSKIP( "plasma-desktop.desktop not found, kdebase not installed", SkipSingle );
+        QSKIP_PORTING( "plasma-desktop.desktop not found, kdebase not installed", SkipSingle );
     KAutostart autostart("plasma-desktop");
     QCOMPARE(autostart.visibleName(), QString("Plasma Desktop Workspace"));
 }
@@ -108,7 +108,7 @@ void KAutostartTest::testServiceRegistered()
     QCOMPARE(KAutostart::isServiceRegistered("doesnotexist"), false);
 
     if ( KStandardDirs::locate("autostart", "plasma-desktop.desktop").isEmpty() )
-        QSKIP( "plasma-desktop.desktop not found, kdebase not installed", SkipSingle );
+        QSKIP_PORTING( "plasma-desktop.desktop not found, kdebase not installed", SkipSingle );
     QCOMPARE(KAutostart::isServiceRegistered("plasma-desktop"), true);
 }
 
diff --git a/kdecore/tests/kdatetimetest.cpp b/kdecore/tests/kdatetimetest.cpp
index 5d864f6..fa4ca45 100644
--- a/kdecore/tests/kdatetimetest.cpp
+++ b/kdecore/tests/kdatetimetest.cpp
@@ -1344,7 +1344,7 @@ void KDateTimeTest::toZone()
 
     // This test relies on kded running, and on kdebase/runtime being installed
     if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kded")) {
-        QSKIP("kded not running", SkipSingle);
+        QSKIP_PORTING("kded not running", SkipSingle);
     }
     QDBusInterface ktimezoned("org.kde.kded", "/modules/ktimezoned", "org.kde.kded.KTimeZoned");
     if (!ktimezoned.isValid())
@@ -1353,7 +1353,7 @@ void KDateTimeTest::toZone()
         QDBusInterface kded("org.kde.kded", "/kded", "org.kde.kded");
         QDBusReply<bool> reply = kded.call("loadModule", "ktimezoned");
         if (!reply.isValid() || !reply)
-            QSKIP("Could not load ktimezoned kded module", SkipSingle);
+            QSKIP_PORTING("Could not load ktimezoned kded module", SkipSingle);
     }
 
     KTimeZone london = KSystemTimeZones::zone("Europe/London");
diff --git a/kdecore/tests/kdirwatch_unittest.cpp b/kdecore/tests/kdirwatch_unittest.cpp
index 8fd602e..10f055a 100644
--- a/kdecore/tests/kdirwatch_unittest.cpp
+++ b/kdecore/tests/kdirwatch_unittest.cpp
@@ -488,7 +488,7 @@ void KDirWatch_UnitTest::testDeleteAndRecreateFile() // Useful for /etc/localtim
 
     // gamin does not signal the change in this case; probably because it uses polling internally...
     if (watch.internalMethod() == KDirWatch::FAM || watch.internalMethod() == KDirWatch::Stat) {
-        QSKIP("Deleting and recreating a file is not detected by FAM (at least with gamin) or Stat", SkipAll);
+        QSKIP_PORTING("Deleting and recreating a file is not detected by FAM (at least with gamin) or Stat", SkipAll);
     }
     //QCOMPARE(KDE::stat(QFile::encodeName(file1), &stat_buf), 0);
     //kDebug() << "new inode" << stat_buf.st_ino; // same!
@@ -503,7 +503,7 @@ void KDirWatch_UnitTest::testDeleteAndRecreateFile() // Useful for /etc/localtim
     // QFileSystemWatcher, as documented, stops watching when the file is deleted
     // so the appendToFile below will fail. Or further changes to /etc/localtime...
     if (watch.internalMethod() == KDirWatch::QFSWatch) {
-        QSKIP("Limitation of QFSWatcher: it stops watching when deleting+recreating the file", SkipAll);
+        QSKIP_PORTING("Limitation of QFSWatcher: it stops watching when deleting+recreating the file", SkipAll);
     }
 
     waitUntilMTimeChange(file1);
@@ -666,7 +666,7 @@ void KDirWatch_UnitTest::testHardlinkChange()
     appendToFile(existingFile);
     QVERIFY(waitForOneSignal(watch, SIGNAL(dirty(QString)), existingFile));
 #else
-    QSKIP("Unix-specific", SkipAll);
+    QSKIP_PORTING("Unix-specific", SkipAll);
 #endif
 }
 
diff --git a/kdecore/tests/klocaletest.cpp b/kdecore/tests/klocaletest.cpp
index cf380cf..35124f2 100644
--- a/kdecore/tests/klocaletest.cpp
+++ b/kdecore/tests/klocaletest.cpp
@@ -817,7 +817,7 @@ KLocaleTest::formatDateTime()
 
 	// The use of KSystemTimeZones requires kded to be running
 	if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kded")) {
-	    QSKIP( "kded not running", SkipAll );
+	    QSKIP_PORTING( "kded not running", SkipAll );
 	}
 
 	small = "%Y-%m-%d %H:%M";
@@ -827,7 +827,7 @@ KLocaleTest::formatDateTime()
 	KDateTime kdt;
 	const KTimeZone tz = KSystemTimeZones::zone("Pacific/Fiji");
         if (!tz.isValid())
-            QSKIP( "Pacific/Fiji timezone not available", SkipAll );
+            QSKIP_PORTING( "Pacific/Fiji timezone not available", SkipAll );
 	kdt = KDateTime::currentDateTime(tz);
 	today = kdt.date();
 	nowt = kdt.time();
diff --git a/kdecore/tests/klocalizedstringtest.cpp b/kdecore/tests/klocalizedstringtest.cpp
index ce2e3f8..4cf20d5 100644
--- a/kdecore/tests/klocalizedstringtest.cpp
+++ b/kdecore/tests/klocalizedstringtest.cpp
@@ -218,7 +218,7 @@ void KLocalizedStringTest::miscMethods ()
 void KLocalizedStringTest::translateToFrench()
 {
     if (!m_hasFrench) {
-        QSKIP("l10n/fr not installed", SkipAll);
+        QSKIP_PORTING("l10n/fr not installed", SkipAll);
     }
     QCOMPARE(i18n("Loadable modules"), QString::fromUtf8("Modules chargeables"));
     QCOMPARE(i18n("Job"), QString::fromUtf8("Tâche"));
diff --git a/kdecore/tests/kmimetypetest.cpp b/kdecore/tests/kmimetypetest.cpp
index fc411bb..f4cf3e3 100644
--- a/kdecore/tests/kmimetypetest.cpp
+++ b/kdecore/tests/kmimetypetest.cpp
@@ -366,7 +366,7 @@ void KMimeTypeTest::testFindByUrl()
     QCOMPARE( mime->name(), QString::fromLatin1( "application/octet-stream" ) ); // HTTP can't know before downloading
 
     if ( !KProtocolInfo::isKnownProtocol(KUrl("man:/")) )
-        QSKIP( "man protocol not installed", SkipSingle );
+        QSKIP_PORTING( "man protocol not installed", SkipSingle );
 
 #if 0 // no such logic in QMimeType, we get default mimetype, KRun will figure it out
     mime = KMimeType::findByUrl( KUrl("man:/ls") );
@@ -586,7 +586,7 @@ void KMimeTypeTest::testMimeTypeParent()
     // Check that text/x-mrml knows that it inherits from text/plain (implicitly)
     const KMimeType::Ptr mrml = KMimeType::mimeType("text/x-mrml");
     if (!mrml)
-        QSKIP("kdelibs not installed", SkipAll);
+        QSKIP_PORTING("kdelibs not installed", SkipAll);
     QVERIFY(mrml->is("text/plain"));
     QVERIFY(mrml->is("application/octet-stream"));
 }
@@ -648,7 +648,7 @@ static bool offerListHasService( const KService::List& offers,
 void KMimeTypeTest::testMimeTypeTraderForTextPlain()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     // Querying mimetype trader for services associated with text/plain
     KService::List offers = KMimeTypeTrader::self()->query("text/plain", "KParts/ReadOnlyPart");
@@ -670,7 +670,7 @@ void KMimeTypeTest::testMimeTypeTraderForTextPlain()
 void KMimeTypeTest::testMimeTypeTraderForDerivedMimeType()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     // Querying mimetype trader for services associated with text/x-patch, which inherits from text/plain
     KService::List offers = KMimeTypeTrader::self()->query("text/x-patch", "KParts/ReadOnlyPart");
@@ -705,7 +705,7 @@ void KMimeTypeTest::testPreferredService()
 void KMimeTypeTest::testMimeTypeTraderForAlias()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     const KService::List referenceOffers = KMimeTypeTrader::self()->query("application/xml", "KParts/ReadOnlyPart");
     QVERIFY(offerListHasService(referenceOffers, "faketextpart.desktop"));
@@ -785,11 +785,11 @@ void KMimeTypeTest::testPatterns()
     QStringList mimePatterns = mime->patterns();
 
     if (mimeType == "application/vnd.oasis.opendocument.text" && mimePatterns.contains("*.fodt")) {
-        QSKIP("Skipping test which would fail due to an upstream bug, see https://bugs.freedesktop.org/show_bug.cgi?id=31242", SkipSingle);
+        QSKIP_PORTING("Skipping test which would fail due to an upstream bug, see https://bugs.freedesktop.org/show_bug.cgi?id=31242", SkipSingle);
     }
 
     if (mimeType == "application/vnd.oasis.opendocument.presentation" && mimePatterns.contains("*.fodp")) {
-        QSKIP("Skipping test which would fail due to an upstream bug, see https://bugs.freedesktop.org/show_bug.cgi?id=31242", SkipSingle);
+        QSKIP_PORTING("Skipping test which would fail due to an upstream bug, see https://bugs.freedesktop.org/show_bug.cgi?id=31242", SkipSingle);
     }
 
     // shared-mime-info 0.30 adds *,v to text/plain, let's add it from this test so that it works
@@ -835,7 +835,7 @@ void KMimeTypeTest::testHelperProtocols()
 
     KService::Ptr kmail2 = KService::serviceByStorageId("KMail2.desktop");
     if (!kmail2) {
-        QSKIP( "kmail2 not installed", SkipSingle );
+        QSKIP_PORTING( "kmail2 not installed", SkipSingle );
     }
 
     QVERIFY(KProtocolInfo::isKnownProtocol("mailto"));
diff --git a/kdecore/tests/kmountpointtest.cpp b/kdecore/tests/kmountpointtest.cpp
index 947c916..f465ecf 100644
--- a/kdecore/tests/kmountpointtest.cpp
+++ b/kdecore/tests/kmountpointtest.cpp
@@ -92,7 +92,7 @@ void KMountPointTest::testPossibleMountPoints()
 {
     const KMountPoint::List mountPoints = KMountPoint::possibleMountPoints(KMountPoint::NeedRealDeviceName|KMountPoint::NeedMountOptions);
     if (mountPoints.isEmpty()) { // can happen in chroot jails
-        QSKIP("fstab is empty", SkipAll);
+        QSKIP_PORTING("fstab is empty", SkipAll);
         return;
     }
     KMountPoint::Ptr mountWithDevice;
diff --git a/kdecore/tests/kprocesstest.cpp b/kdecore/tests/kprocesstest.cpp
index cb20be2..1aae8d8 100644
--- a/kdecore/tests/kprocesstest.cpp
+++ b/kdecore/tests/kprocesstest.cpp
@@ -70,7 +70,7 @@ void KProcessTest::test_channels()
     TESTCHAN(OnlyStdoutChannel, "forwarded stderr", EE, EO, "");
     TESTCHAN(MergedChannels, "merged", "", EO EE, "");
 #else
-    QSKIP("This test needs a UNIX system", SkipSingle);
+    QSKIP_PORTING("This test needs a UNIX system", SkipSingle);
 #endif
 }
 
@@ -78,7 +78,7 @@ void KProcessTest::test_setShellCommand()
 {
 // Condition copied from kprocess.cpp
 #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__GNU__)
-    QSKIP("This test needs a free UNIX system", SkipSingle);
+    QSKIP_PORTING("This test needs a free UNIX system", SkipSingle);
 #else
     KProcess p;
 
diff --git a/kdecore/tests/ksavefiletest.cpp b/kdecore/tests/ksavefiletest.cpp
index ee5e661..f856d33 100644
--- a/kdecore/tests/ksavefiletest.cpp
+++ b/kdecore/tests/ksavefiletest.cpp
@@ -301,7 +301,7 @@ void KSaveFileTest::test_rcsBackupFile()
 {
     QString cipath = QStandardPaths::findExecutable("ci");
     if (cipath.isEmpty())
-        QSKIP("ci not available", SkipAll);
+        QSKIP_PORTING("ci not available", SkipAll);
 
     {
         QTemporaryFile f;
diff --git a/kdecore/tests/kservicetest.cpp b/kdecore/tests/kservicetest.cpp
index db778ad..28d2661 100644
--- a/kdecore/tests/kservicetest.cpp
+++ b/kdecore/tests/kservicetest.cpp
@@ -186,7 +186,7 @@ void KServiceTest::cleanupTestCase()
 void KServiceTest::testByName()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     KServiceType::Ptr s0 = KServiceType::serviceType("KParts/ReadOnlyPart");
     QVERIFY( s0 );
@@ -225,7 +225,7 @@ void KServiceTest::testProperty()
 void KServiceTest::testAllServiceTypes()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     const KServiceType::List allServiceTypes = KServiceType::allServiceTypes();
 
@@ -243,7 +243,7 @@ void KServiceTest::testAllServiceTypes()
 void KServiceTest::testAllServices()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
     const KService::List lst = KService::allServices();
     QVERIFY( !lst.isEmpty() );
 
@@ -299,9 +299,9 @@ static bool offerListHasService( const KService::List& offers,
 void KServiceTest::testDBUSStartupType()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
     if ( !m_hasKde4Konsole )
-        QSKIP( "kde4-konsole.desktop not available", SkipAll );
+        QSKIP_PORTING( "kde4-konsole.desktop not available", SkipAll );
     //KService::Ptr konsole = KService::serviceByMenuId( "kde4-konsole.desktop" );
     KService::Ptr konsole = KService::serviceByDesktopName( "konsole" );
     QVERIFY(konsole);
@@ -313,7 +313,7 @@ void KServiceTest::testDBUSStartupType()
 void KServiceTest::testByStorageId()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP("ksycoca not available", SkipAll);
+        QSKIP_PORTING("ksycoca not available", SkipAll);
     QVERIFY(KService::serviceByMenuId("kde4-kmailservice.desktop"));
     QVERIFY(!KService::serviceByMenuId("kde4-kmailservice")); // doesn't work, extension mandatory
     QVERIFY(KService::serviceByStorageId("kde4-kmailservice.desktop"));
@@ -334,7 +334,7 @@ void KServiceTest::testByStorageId()
 void KServiceTest::testServiceTypeTraderForReadOnlyPart()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     // Querying trader for services associated with KParts/ReadOnlyPart
     KService::List offers = KServiceTypeTrader::self()->query("KParts/ReadOnlyPart");
@@ -375,7 +375,7 @@ void KServiceTest::testServiceTypeTraderForReadOnlyPart()
 void KServiceTest::testTraderConstraints()
 {
     if ( !KSycoca::isAvailable() )
-        QSKIP( "ksycoca not available", SkipAll );
+        QSKIP_PORTING( "ksycoca not available", SkipAll );
 
     KService::List offers = KServiceTypeTrader::self()->query("KTextEditor/Plugin", "Library == 'faketextplugin'");
     QCOMPARE(offers.count(), 1);
@@ -461,7 +461,7 @@ void KServiceTest::testDefaultOffers()
     QVERIFY( offerListHasService( offers, "fakepart2.desktop" ) ); // it's here even though it's disabled in the profile
     QVERIFY( offerListHasService( offers, "otherpart.desktop" ) );
     if ( m_firstOffer.isEmpty() )
-        QSKIP( "testServiceTypeTraderForReadOnlyPart not run", SkipAll );
+        QSKIP_PORTING( "testServiceTypeTraderForReadOnlyPart not run", SkipAll );
     QCOMPARE( offers[0]->entryPath(), m_firstOffer );
 }
 
@@ -475,7 +475,7 @@ void KServiceTest::testDeleteServiceTypeProfile()
     QVERIFY( offerListHasService( offers, "fakepart2.desktop" ) ); // it's back
 
     if ( m_firstOffer.isEmpty() )
-        QSKIP( "testServiceTypeTraderForReadOnlyPart not run", SkipAll );
+        QSKIP_PORTING( "testServiceTypeTraderForReadOnlyPart not run", SkipAll );
     QCOMPARE( offers[0]->entryPath(), m_firstOffer );
 }
 
@@ -483,7 +483,7 @@ void KServiceTest::testActionsAndDataStream()
 {
     const QString servicePath = KStandardDirs::locate( "services", "ScreenSavers/krandom.desktop" );
     if (servicePath.isEmpty() )
-        QSKIP("kdebase not installed, krandom.desktop not found", SkipAll);
+        QSKIP_PORTING("kdebase not installed, krandom.desktop not found", SkipAll);
     KService service( servicePath );
     QVERIFY(!service.property("Name[fr]", QVariant::String).isValid());
     const QList<KServiceAction> actions = service.actions();
diff --git a/kdecore/tests/kstandarddirstest.cpp b/kdecore/tests/kstandarddirstest.cpp
index 479f302..1254277 100644
--- a/kdecore/tests/kstandarddirstest.cpp
+++ b/kdecore/tests/kstandarddirstest.cpp
@@ -111,7 +111,7 @@ static bool isKdelibsInstalled()
 void KStandarddirsTest::testFindResource()
 {
     if ( !isKdelibsInstalled() )
-        QSKIP( "kdelibs not installed", SkipAll );
+        QSKIP_PORTING( "kdelibs not installed", SkipAll );
 
 #ifdef Q_WS_WIN
 #define EXT ".exe"
@@ -143,7 +143,7 @@ static bool oneEndsWith( const QStringList& lst, const QString& str)
 void KStandarddirsTest::testFindAllResources()
 {
     if ( !isKdelibsInstalled() )
-        QSKIP( "kdelibs not installed", SkipAll );
+        QSKIP_PORTING( "kdelibs not installed", SkipAll );
 
     const QStringList cmakeModulesFiles = KGlobal::dirs()->findAllResources( "data", "cmake/modules/" );
     QVERIFY( !cmakeModulesFiles.isEmpty() );
@@ -231,7 +231,7 @@ void KStandarddirsTest::testFindAllResourcesNewDir()
 void KStandarddirsTest::testFindDirs()
 {
     if ( !isKdelibsInstalled() )
-        QSKIP( "kdelibs not installed", SkipAll );
+        QSKIP_PORTING( "kdelibs not installed", SkipAll );
 
     const QString t = KStandardDirs::locateLocal("data", "kconf_update/" );
     QCOMPARE(t, QString(m_kdehome + "/xdg/local/kconf_update/"));
@@ -244,7 +244,7 @@ void KStandarddirsTest::testFindDirs()
 void KStandarddirsTest::testFindResourceDir()
 {
     if ( !isKdelibsInstalled() )
-        QSKIP( "kdelibs not installed", SkipAll );
+        QSKIP_PORTING( "kdelibs not installed", SkipAll );
 
     const QString configDir = KGlobal::dirs()->findResourceDir( "config", "foorc" );
     QVERIFY( !configDir.isEmpty() );
@@ -254,7 +254,7 @@ void KStandarddirsTest::testFindResourceDir()
 void KStandarddirsTest::testFindExe()
 {
     if ( !isKdelibsInstalled() )
-        QSKIP( "kdelibs not installed", SkipAll );
+        QSKIP_PORTING( "kdelibs not installed", SkipAll );
 
     // findExe with a result in bin
     const QString kdeinit = KGlobal::dirs()->findExe( "kdeinit4" );
@@ -330,7 +330,7 @@ void KStandarddirsTest::testLocate()
         }
     }
     if( textPlain == "text/x-patch.xml" )
-        QSKIP("xdg-share-mime not installed", SkipAll);
+        QSKIP_PORTING("xdg-share-mime not installed", SkipAll);
 
     const QString res = KGlobal::dirs()->locate("xdgdata-mime", "text/x-patch.xml");
     QCOMPARE_PATHS(res, textPlain);
@@ -346,7 +346,7 @@ void KStandarddirsTest::testRelativeLocation()
 void KStandarddirsTest::testAddResourceType()
 {
     if ( !isKdelibsInstalled() )
-        QSKIP( "kdelibs not installed", SkipAll );
+        QSKIP_PORTING( "kdelibs not installed", SkipAll );
 
     QString ret = KStandardDirs::locate( "dtd", "customization/catalog.xml" );
     QCOMPARE(ret, QString()); // normal, there's no "dtd" resource in kstandarddirs by default
diff --git a/kdecore/tests/ksycocadicttest.cpp b/kdecore/tests/ksycocadicttest.cpp
index cef0eca..7bc0bf3 100644
--- a/kdecore/tests/ksycocadicttest.cpp
+++ b/kdecore/tests/ksycocadicttest.cpp
@@ -47,7 +47,7 @@ QTEST_KDEMAIN_CORE(KSycocaDictTest)
 void KSycocaDictTest::testStandardDict()
 {
     if (!KServiceType::serviceType("KCModule"))
-        QSKIP( "Missing servicetypes", SkipAll );
+        QSKIP_PORTING( "Missing servicetypes", SkipAll );
 
     QStringList serviceTypes;
     serviceTypes << "KUriFilter/Plugin"
diff --git a/kdecore/tests/kurltest.cpp b/kdecore/tests/kurltest.cpp
index e8bf767..0fdacec 100644
--- a/kdecore/tests/kurltest.cpp
+++ b/kdecore/tests/kurltest.cpp
@@ -1208,7 +1208,7 @@ void KUrlTest::testSetEncodedFragment()
 {
     // Bug fixed in 4.5.1 by Thiago
 #if QT_VERSION < 0x040501
-    QSKIP("Bug in Qt-4.4/4.5-rc1: setEncodedFragment doesn't work if the initial url has no fragment", SkipAll);
+    QSKIP_PORTING("Bug in Qt-4.4/4.5-rc1: setEncodedFragment doesn't work if the initial url has no fragment", SkipAll);
 #endif
 
     QFETCH(QByteArray, base);
@@ -1246,7 +1246,7 @@ void KUrlTest::testSubURL()
   QCOMPARE( splitList[2].url(), QString("tar:/#myref") );
 
 #if QT_VERSION < 0x040500
-  QSKIP( "Multiple sub urls not supported with Qt < 4.5", SkipSingle );
+  QSKIP_PORTING( "Multiple sub urls not supported with Qt < 4.5", SkipSingle );
 #endif
   KUrl rejoined = KUrl::join(splitList);
   QCOMPARE(rejoined.url(), url1.url());
@@ -1305,7 +1305,7 @@ void KUrlTest::testSubURL()
   const KUrl url1Rejoined = KUrl::join(url1Splitted);
   // Bug fixed in 4.5.1 by Thiago
 #if QT_VERSION < 0x040501
-  QSKIP("Bug in Qt-4.4/4.5-rc1: setEncodedFragment doesn't work if the initial url has no fragment", SkipAll);
+  QSKIP_PORTING("Bug in Qt-4.4/4.5-rc1: setEncodedFragment doesn't work if the initial url has no fragment", SkipAll);
 #endif
   QCOMPARE(url1Rejoined.url(), url1.url());
   QCOMPARE(url1.upUrl().url(), QString("file:///home/dfaure/my%20tar%20file.tgz#gzip:/#tar:/"));
diff --git a/kdecore/util/qtest_kde.h b/kdecore/util/qtest_kde.h
index 10922f9..698b079 100644
--- a/kdecore/util/qtest_kde.h
+++ b/kdecore/util/qtest_kde.h
@@ -155,4 +155,13 @@ int main(int argc, char *argv[]) \
  */
 #define QTEST_KDEMAIN_CORE(TestObject) QTEST_KDEMAIN_CORE_WITH_COMPONENTNAME(TestObject, "qttest")
 
+#pragma message("Port to Qt5 version of QSKIP_PORTING")
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+#define SkipSingle 0
+#define SkipAll 0
+#define QSKIP_PORTING(message, argument) QSKIP(message)
+#else
+#define QSKIP_PORTING(message, argument) QSKIP(message, argument)
+#endif
+
 #endif /* QTEST_KDE_H */
diff --git a/kdeui/tests/kconfig_compiler/kconfigcompiler_test.cpp b/kdeui/tests/kconfig_compiler/kconfigcompiler_test.cpp
index 4ebd6f3..ffce7f5 100644
--- a/kdeui/tests/kconfig_compiler/kconfigcompiler_test.cpp
+++ b/kdeui/tests/kconfig_compiler/kconfigcompiler_test.cpp
@@ -20,7 +20,7 @@
 #include <QtCore/QString>
 #include <kdebug.h>
 #include <qstandardpaths.h>
-#include <qtest.h>
+#include <qtest_kde.h>
 #include "kconfigcompiler_test.h"
 
 // QT5 TODO QTEST_GUILESS_MAIN(KConfigCompiler_Test)
@@ -153,7 +153,7 @@ void KConfigCompiler_Test::performCompare(const QString &fileName, bool fail)
 	}
 	else
 	{
-		QSKIP("Can't open file for comparison", SkipSingle);
+		QSKIP_PORTING("Can't open file for comparison", SkipSingle);
 	}
 }
 
diff --git a/kdeui/tests/kglobalshortcuttest.cpp b/kdeui/tests/kglobalshortcuttest.cpp
index 9ae924f..b0eb873 100644
--- a/kdeui/tests/kglobalshortcuttest.cpp
+++ b/kdeui/tests/kglobalshortcuttest.cpp
@@ -97,7 +97,7 @@ void KGlobalShortcutTest::testSetShortcut()
     setupTest("testSetShortcut");
 
     if (!m_daemonInstalled)
-        QSKIP("kglobalaccel not installed", SkipAll);
+        QSKIP_PORTING("kglobalaccel not installed", SkipAll);
 
     // Just ensure that the desired values are set for both actions
     KShortcut cutA(sequenceA, sequenceB);
@@ -117,7 +117,7 @@ void KGlobalShortcutTest::testFindActionByKey()
     // Skip this. The above testcase hasn't changed the actions
     setupTest("testFindActionByKey");
     if (!m_daemonInstalled)
-        QSKIP("kglobalaccel not installed", SkipAll);
+        QSKIP_PORTING("kglobalaccel not installed", SkipAll);
 
     QList<KGlobalShortcutInfo> actionId = KGlobalAccel::self()->getGlobalShortcutsByKey(sequenceB);
     QCOMPARE(actionId.size(), 1);
@@ -147,7 +147,7 @@ void KGlobalShortcutTest::testChangeShortcut()
     setupTest("testChangeShortcut");
 
     if (!m_daemonInstalled)
-        QSKIP("kglobalaccel not installed", SkipAll);
+        QSKIP_PORTING("kglobalaccel not installed", SkipAll);
     // Change the shortcut
     KShortcut newCutA(sequenceC);
     m_actionA->setGlobalShortcut(newCutA, KAction::ActiveShortcut, KAction::NoAutoloading);
@@ -180,7 +180,7 @@ void KGlobalShortcutTest::testStealShortcut()
 {
     setupTest("testStealShortcut");
     if (!m_daemonInstalled)
-        QSKIP("kglobalaccel not installed", SkipAll);
+        QSKIP_PORTING("kglobalaccel not installed", SkipAll);
 
     // Steal a shortcut from an action. First ensure the initial state is
     // correct
@@ -237,7 +237,7 @@ void KGlobalShortcutTest::testListActions()
 {
     setupTest("testListActions");
     if (!m_daemonInstalled)
-        QSKIP("kglobalaccel not installed", SkipAll);
+        QSKIP_PORTING("kglobalaccel not installed", SkipAll);
 
     // As in kdebase/workspace/kcontrol/keys/globalshortcuts.cpp
     KGlobalAccel *kga = KGlobalAccel::self();
@@ -406,7 +406,7 @@ void KGlobalShortcutTest::testForgetGlobalShortcut()
     KAction a("Test", NULL);
     a.forgetGlobalShortcut();
     if (!m_daemonInstalled)
-        QSKIP("kglobalaccel not installed", SkipAll);
+        QSKIP_PORTING("kglobalaccel not installed", SkipAll);
 
     // We forget these two shortcuts and check that the component is gone
     // after that. If not it can mean the forgetGlobalShortcut() call is
diff --git a/kdeui/tests/ktextedit_unittest.cpp b/kdeui/tests/ktextedit_unittest.cpp
index f3b6e07..1df3aaa 100644
--- a/kdeui/tests/ktextedit_unittest.cpp
+++ b/kdeui/tests/ktextedit_unittest.cpp
@@ -87,7 +87,7 @@ void KTextEdit_UnitTest::testPaste()
 //
 // void KTextEdit_UnitTest::testBrInsideParagraphThroughTextEdit()
 // {
-//     QSKIP("This is worked around during export", SkipSingle);
+//     QSKIP_PORTING("This is worked around during export", SkipSingle);
 //     QTextEdit *te = new QTextEdit();
 //
 //     te->setHtml("<p>Foo<br />Bar</p>");
diff --git a/kdeui/tests/ktimezonewidget_unittest.cpp b/kdeui/tests/ktimezonewidget_unittest.cpp
index a9aeb4d..c91ebd4 100644
--- a/kdeui/tests/ktimezonewidget_unittest.cpp
+++ b/kdeui/tests/ktimezonewidget_unittest.cpp
@@ -45,7 +45,7 @@ private Q_SLOTS:
     void testSetSelected()
     {
         if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kded")) {
-            QSKIP("kded not running", SkipSingle);
+            QSKIP_PORTING("kded not running", SkipSingle);
         }
 
         KTimeZoneWidget tzw;
@@ -76,7 +76,7 @@ private Q_SLOTS:
     void testCheckableItems()
     {
         //if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kded")) {
-        //    QSKIP("kded not running", SkipSingle);
+        //    QSKIP_PORTING("kded not running", SkipSingle);
         //}
 
         KTimeZoneWidget tzw;
diff --git a/kio/tests/fileundomanagertest.cpp b/kio/tests/fileundomanagertest.cpp
index 2dcdf47..64ef68c 100644
--- a/kio/tests/fileundomanagertest.cpp
+++ b/kio/tests/fileundomanagertest.cpp
@@ -427,7 +427,7 @@ void FileUndoManagerTest::testCreateDir()
 void FileUndoManagerTest::testTrashFiles()
 {
     if ( !KProtocolInfo::isKnownProtocol( "trash" ) )
-        QSKIP( "kio_trash not installed", SkipAll );
+        QSKIP_PORTING( "kio_trash not installed", SkipAll );
 
     // Trash it all at once: the file, the symlink, the subdir.
     QList<KUrl> lst = sourceList();
diff --git a/kio/tests/kdirmodeltest.cpp b/kio/tests/kdirmodeltest.cpp
index 6085c3b..b0c9477 100644
--- a/kio/tests/kdirmodeltest.cpp
+++ b/kio/tests/kdirmodeltest.cpp
@@ -990,7 +990,7 @@ void KDirModelTest::testUrlWithRef() // #171117
 void KDirModelTest::testFontUrlWithHost() // #160057
 {
     if (!KProtocolInfo::isKnownProtocol("fonts")) {
-        QSKIP("kio_fonts not installed", SkipAll);
+        QSKIP_PORTING("kio_fonts not installed", SkipAll);
     }
     KUrl url("fonts://foo/System");
     KDirLister* dirLister = m_dirModel->dirLister();
@@ -1004,7 +1004,7 @@ void KDirModelTest::testFontUrlWithHost() // #160057
 void KDirModelTest::testRemoteUrlWithHost() // #178416
 {
     if (!KProtocolInfo::isKnownProtocol("remote")) {
-        QSKIP("kio_remote not installed", SkipAll);
+        QSKIP_PORTING("kio_remote not installed", SkipAll);
     }
     KUrl url("remote://foo");
     KDirLister* dirLister = m_dirModel->dirLister();
@@ -1043,7 +1043,7 @@ void KDirModelTest::testSmb()
     // This requires that KDirModel does not ask the KDirLister for its rootItem anymore,
     // but that KDirLister emits the root item whenever it changes.
     if (!KProtocolInfo::isKnownProtocol("smb")) {
-        QSKIP("kio_smb not installed", SkipAll);
+        QSKIP_PORTING("kio_smb not installed", SkipAll);
     }
     KDirLister* dirLister = m_dirModel->dirLister();
     dirLister->openUrl(smbUrl, KDirLister::NoFlags);
@@ -1053,7 +1053,7 @@ void KDirModelTest::testSmb()
     enterLoop(); // wait for completed signal
 
     if (spyCanceled.count() > 0) {
-        QSKIP("smb:/ returns an error, probably no network available", SkipAll);
+        QSKIP_PORTING("smb:/ returns an error, probably no network available", SkipAll);
     }
 
     QModelIndex index = m_dirModel->index(0, 0);
@@ -1142,7 +1142,7 @@ void KDirModelTest::testDeleteFileWhileListing() // doesn't really test that yet
     connect(dirLister, SIGNAL(completed()), this, SLOT(slotListingCompleted()));
     dirLister->openUrl(KUrl(path), KDirLister::NoFlags);
     if (!spyCompleted.isEmpty())
-        QSKIP("listing completed too early", SkipAll);
+        QSKIP_PORTING("listing completed too early", SkipAll);
     QSignalSpy spyRowsRemoved(m_dirModel, SIGNAL(rowsRemoved(QModelIndex,int,int)));
     KIO::DeleteJob* job = KIO::del(url, KIO::HideProgressInfo);
     QVERIFY(job->exec());
diff --git a/kio/tests/kprotocolinfotest.cpp b/kio/tests/kprotocolinfotest.cpp
index 6651929..7e5caf4 100644
--- a/kio/tests/kprotocolinfotest.cpp
+++ b/kio/tests/kprotocolinfotest.cpp
@@ -57,7 +57,7 @@ int main(int argc, char **argv) {
     //assert(capabilities.contains("ACL"));
 
     if (!QFile::exists(KStandardDirs::locate("services", "zip.protocol"))) {
-        //QSKIP("kdebase not installed", SkipAll);
+        //QSKIP_PORTING("kdebase not installed", SkipAll);
     } else {
         QString zip = KProtocolManager::protocolForArchiveMimetype("application/zip");
         assert( zip == "zip");
diff --git a/kio/tests/krununittest.cpp b/kio/tests/krununittest.cpp
index e91d11e..1488065 100644
--- a/kio/tests/krununittest.cpp
+++ b/kio/tests/krununittest.cpp
@@ -153,7 +153,7 @@ void KRunUnitTest::testProcessDesktopExecNoFile_data()
 
     QString kioexec = KStandardDirs::findExe("kioexec");
     if (kioexec.isEmpty())
-        QSKIP("kioexec not found, kdebase needed", SkipAll);
+        QSKIP_PORTING("kioexec not found, kdebase needed", SkipAll);
 
     QString kmailservice = KStandardDirs::findExe("kmailservice");
     if (kmailservice.isEmpty()) kmailservice = "kmailservice";
diff --git a/kpty/tests/kptyprocesstest.cpp b/kpty/tests/kptyprocesstest.cpp
index 0c71e0a..f73a616 100644
--- a/kpty/tests/kptyprocesstest.cpp
+++ b/kpty/tests/kptyprocesstest.cpp
@@ -184,7 +184,7 @@ void KPtyProcessTest::test_pty_signals()
 void KPtyProcessTest::test_ctty()
 {
 #ifdef Q_OS_MAC
-    QSKIP("This test currently hangs on OSX", SkipSingle);
+    QSKIP_PORTING("This test currently hangs on OSX", SkipSingle);
 #else
     KPtyProcess p;
     p.setShellCommand("echo this is a test > /dev/tty");
diff --git a/kutils/kemoticons/tests/kemoticontest.cpp b/kutils/kemoticons/tests/kemoticontest.cpp
index e944f38..b94b0f5 100644
--- a/kutils/kemoticons/tests/kemoticontest.cpp
+++ b/kutils/kemoticons/tests/kemoticontest.cpp
@@ -60,7 +60,7 @@ void KEmoticonTest::testEmoticonParser()
         // check if the expected output file exists
         // if it doesn't, skip the testcase
         if (! expectedFile.exists()) {
-            QSKIP("Warning! expected output for testcase not found. Skiping testcase", SkipSingle);
+            QSKIP_PORTING("Warning! expected output for testcase not found. Skiping testcase", SkipSingle);
             continue;
         }
         if (inputFile.open(QIODevice::ReadOnly) && expectedFile.open(QIODevice::ReadOnly)) {
@@ -72,7 +72,7 @@ void KEmoticonTest::testEmoticonParser()
 
             const QString path = KGlobal::dirs()->findResource("emoticons", "kde4/smile.png").remove("smile.png");
             if (path.isEmpty())
-                QSKIP("Emoticons not installed, skipping. kdebase-runtime needed.", SkipAll);
+                QSKIP_PORTING("Emoticons not installed, skipping. kdebase-runtime needed.", SkipAll);
 
             QString result = emo.parseEmoticons(inputData, KEmoticonsTheme::RelaxedParse | KEmoticonsTheme::SkipHTML).replace(path, QString());
 
@@ -94,7 +94,7 @@ void KEmoticonTest::testEmoticonParser()
                 QCOMPARE(result, expectedData);
             }
         } else {
-            QSKIP("Warning! can't open testcase files. Skiping testcase", SkipSingle);
+            QSKIP_PORTING("Warning! can't open testcase files. Skiping testcase", SkipSingle);
             continue;
         }
     }
diff --git a/staging/kcoreaddons/autotests/klockfiletest.cpp b/staging/kcoreaddons/autotests/klockfiletest.cpp
index cf2336a..b8b20b2 100644
--- a/staging/kcoreaddons/autotests/klockfiletest.cpp
+++ b/staging/kcoreaddons/autotests/klockfiletest.cpp
@@ -146,7 +146,7 @@ void
 Test_KLockFile::testStaleNoBlockFlag()
 {
 #ifdef Q_WS_WIN
-    QSKIP("lockfile on windows has different format",SkipSingle);
+    QSKIP_PORTING("lockfile on windows has different format",SkipSingle);
 #else
     char hostname[256];
     ::gethostname(hostname, sizeof(hostname));
diff --git a/tier2/sonnet/core/tests/test_core.cpp b/tier2/sonnet/core/tests/test_core.cpp
index d4cf1af..a7ceff6 100644
--- a/tier2/sonnet/core/tests/test_core.cpp
+++ b/tier2/sonnet/core/tests/test_core.cpp
@@ -23,7 +23,7 @@
 #include "speller.h"
 #include "globals.h"
 
-#include <qtest.h>
+#include <qtest_kde.h>
 #include <kdebug.h>
 
 // QT5 TODO QTEST_GUILESS_MAIN(SonnetCoreTest)
@@ -105,7 +105,7 @@ void SonnetCoreTest::testCore2()
 {
     Speller dict("de_DE");
     if (!dict.availableDictionaries().contains("German")) {
-        QSKIP("This test requires a german spelling dictionary", SkipSingle);
+        QSKIP_PORTING("This test requires a german spelling dictionary", SkipSingle);
         return;
     }
     qDebug()<< "Clients are "   << dict.availableBackends();


More information about the Kde-frameworks-devel mailing list