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>
-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
cross_compile: SUBDIRS -= tools
isEmpty(QT.opengl.name): SUBDIRS -= opengl
!unix|embedded|!contains(QT_CONFIG, dbus): SUBDIRS -= dbus
+public slots:
+#ifdef QT_NO_PRINTER
+ void initTestCase();
+ void cleanupTestCase();
+#else
private slots:
void getSetCheck();
// Add your testfunctions and testdata create functions here
private slots:
void getSetCheck();
// Add your testfunctions and testdata create functions here
void taskQTBUG4497_reusePrinterOnDifferentFiles();
void testPdfTitle();
void taskQTBUG4497_reusePrinterOnDifferentFiles();
void testPdfTitle();
+#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()
{
// Testing get/set functions
void tst_QPrinter::getSetCheck()
{
const char *expected = reinterpret_cast<const char*>(expectedBuf);
QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
}
const char *expected = reinterpret_cast<const char*>(expectedBuf);
QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
}
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"
+public slots:
+#ifdef QT_NO_PRINTER
+ void initTestCase();
+ void cleanupTestCase();
+#else
private slots:
#ifndef Q_OS_WIN32
void testForDefaultPrinter();
private slots:
#ifndef Q_OS_WIN32
void testForDefaultPrinter();
#ifdef Q_OS_UNIX
QString getOutputFromCommand(const QStringList& command);
#endif // Q_OS_UNIX
#ifdef Q_OS_UNIX
QString getOutputFromCommand(const QStringList& command);
#endif // Q_OS_UNIX
+
+#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;
QString tst_QPrinterInfo::getDefaultPrinterFromSystem()
{
QString printer;
QCOMPARE(pi2.isDefault(), pi.isDefault());
}
}
QCOMPARE(pi2.isDefault(), pi.isDefault());
}
}
QTEST_MAIN(tst_QPrinterInfo)
#include "tst_qprinterinfo.moc"
QTEST_MAIN(tst_QPrinterInfo)
#include "tst_qprinterinfo.moc"