diff options
author | Caroline Chao <caroline.chao@nokia.com> | 2012-09-07 14:59:15 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-13 19:33:08 +0200 |
commit | cecc2c6851df9cad55595eb534b11a15e3ff738f (patch) | |
tree | 092268ab58cf20923536ffe270a2bd3ccad372a6 /tests | |
parent | 906f62c5455c0df313d99016eef30dd13dc843db (diff) |
Test: Redo remove QSKIP from printsupport tests
Redoing 5704cbc462ad0b316a6b55a0f1dadc3c50762ef
This can't work, because the define comes from qconfig.h, not qmake.
Skipping initTestCase and cleanupTestCase when QT_NO_PRINTER is
defined.
Change-Id: I2527c018294b7518a4692f2c93da933848640b5d
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 2 | ||||
-rw-r--r-- | tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 18 | ||||
-rw-r--r-- | tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp | 20 |
3 files changed, 39 insertions, 1 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 0cb2ef474d..b3906cc247 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -16,7 +16,7 @@ SUBDIRS += \ printsupport \ cmake -wince*|contains(DEFINES, QT_NO_PRINTER): SUBDIRS -= printsupport +wince*: SUBDIRS -= printsupport cross_compile: SUBDIRS -= tools isEmpty(QT.opengl.name): SUBDIRS -= opengl !unix|embedded|!contains(QT_CONFIG, dbus): SUBDIRS -= dbus diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index c8667822ae..646a740ef6 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -81,6 +81,11 @@ class tst_QPrinter : public QObject { Q_OBJECT +public slots: +#ifdef QT_NO_PRINTER + void initTestCase(); + void cleanupTestCase(); +#else private slots: void getSetCheck(); // Add your testfunctions and testdata create functions here @@ -113,8 +118,20 @@ private slots: void taskQTBUG4497_reusePrinterOnDifferentFiles(); void testPdfTitle(); +#endif }; +#ifdef QT_NO_PRINTER +void tst_QPrinter::initTestCase() +{ + QSKIP("This test requires printing support"); +} + +void tst_QPrinter::cleanupTestCase() +{ + QSKIP("This test requires printing support"); +} +#else // Testing get/set functions void tst_QPrinter::getSetCheck() { @@ -1033,6 +1050,7 @@ void tst_QPrinter::testPdfTitle() const char *expected = reinterpret_cast<const char*>(expectedBuf); QVERIFY(file.readAll().contains(QByteArray(expected, 26))); } +#endif // QT_NO_PRINTER QTEST_MAIN(tst_QPrinter) #include "tst_qprinter.moc" diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp index 63ed70045a..b79796c9d6 100644 --- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp @@ -56,6 +56,11 @@ class tst_QPrinterInfo : public QObject { Q_OBJECT +public slots: +#ifdef QT_NO_PRINTER + void initTestCase(); + void cleanupTestCase(); +#else private slots: #ifndef Q_OS_WIN32 void testForDefaultPrinter(); @@ -73,8 +78,22 @@ private: #ifdef Q_OS_UNIX QString getOutputFromCommand(const QStringList& command); #endif // Q_OS_UNIX +#endif }; + +#ifdef QT_NO_PRINTER +void tst_QPrinterInfo::initTestCase() +{ + QSKIP("This test requires printing support"); +} + +void tst_QPrinterInfo::cleanupTestCase() +{ + QSKIP("This test requires printing support"); +} + +#else QString tst_QPrinterInfo::getDefaultPrinterFromSystem() { QString printer; @@ -312,6 +331,7 @@ void tst_QPrinterInfo::namedPrinter() QCOMPARE(pi2.isDefault(), pi.isDefault()); } } +#endif // QT_NO_PRINTER QTEST_MAIN(tst_QPrinterInfo) #include "tst_qprinterinfo.moc" |