diff options
author | Eirik Aavitsland <eirik.aavitsland@theqtcompany.com> | 2015-11-25 11:27:03 +0100 |
---|---|---|
committer | aavit <eirik.aavitsland@theqtcompany.com> | 2015-11-25 11:18:32 +0000 |
commit | 6a7f3bfcb81b56a29814f50e684620fc3daeb431 (patch) | |
tree | c6b896bf4e5705aaafb4d989cc1a78b520f1b142 | |
parent | 2ca54cf19660ded8be8225a7181d8f6930c4d9e8 (diff) | |
download | qtimageformats-6a7f3bfcb81b56a29814f50e684620fc3daeb431.tar.gz |
Skip (pass) each autotest if the corresponding handler not present
Add a check at initialization of each autotest, skipping it if the
relevant plugin is not installed. This is the same as in the
qtimagereader autotest in qtbase (SKIP_IF_UNSUPPORTED macro).
Reason for change: Not all format handlers are supported on all
platforms. Hence, the suite of autotests ("make check") should not
fail on account of a missing plugin.
Change-Id: Ic0f4da68a9527831f017db0f326afe6e631efd9e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
-rw-r--r-- | tests/auto/auto.pro | 6 | ||||
-rw-r--r-- | tests/auto/dds/tst_qdds.cpp | 7 | ||||
-rw-r--r-- | tests/auto/icns/tst_qicns.cpp | 7 | ||||
-rw-r--r-- | tests/auto/jp2/tst_qjp2.cpp | 7 | ||||
-rw-r--r-- | tests/auto/mng/tst_qmng.cpp | 7 | ||||
-rw-r--r-- | tests/auto/tga/tst_qtga.cpp | 7 | ||||
-rw-r--r-- | tests/auto/tiff/tst_qtiff.cpp | 3 | ||||
-rw-r--r-- | tests/auto/wbmp/tst_qwbmp.cpp | 7 | ||||
-rw-r--r-- | tests/auto/webp/tst_qwebp.cpp | 7 |
9 files changed, 55 insertions, 3 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index deda6cb..bf0f8e5 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -5,6 +5,6 @@ SUBDIRS = \ dds \ icns \ jp2 \ - webp - -contains(QT_CONFIG, system-zlib): SUBDIRS += mng tiff + webp \ + mng \ + tiff diff --git a/tests/auto/dds/tst_qdds.cpp b/tests/auto/dds/tst_qdds.cpp index ec731c2..ca66ec6 100644 --- a/tests/auto/dds/tst_qdds.cpp +++ b/tests/auto/dds/tst_qdds.cpp @@ -40,6 +40,7 @@ class tst_qdds: public QObject Q_OBJECT private slots: + void initTestCase(); void readImage_data(); void readImage(); void testMipmaps_data(); @@ -48,6 +49,12 @@ private slots: void testWriteImage(); }; +void tst_qdds::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("dds")) + QSKIP("The image format handler is not installed."); +} + void tst_qdds::readImage_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/icns/tst_qicns.cpp b/tests/auto/icns/tst_qicns.cpp index 8385ad1..969a0ca 100644 --- a/tests/auto/icns/tst_qicns.cpp +++ b/tests/auto/icns/tst_qicns.cpp @@ -40,12 +40,19 @@ class tst_qicns: public QObject Q_OBJECT private slots: + void initTestCase(); void readIcons_data(); void readIcons(); void writeIcons_data(); void writeIcons(); }; +void tst_qicns::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("icns")) + QSKIP("The image format handler is not installed."); +} + void tst_qicns::readIcons_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/jp2/tst_qjp2.cpp b/tests/auto/jp2/tst_qjp2.cpp index 3400ece..5045eee 100644 --- a/tests/auto/jp2/tst_qjp2.cpp +++ b/tests/auto/jp2/tst_qjp2.cpp @@ -40,10 +40,17 @@ class tst_qjp2: public QObject Q_OBJECT private slots: + void initTestCase(); void readImage_data(); void readImage(); }; +void tst_qjp2::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("jp2")) + QSKIP("The image format handler is not installed."); +} + void tst_qjp2::readImage_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/mng/tst_qmng.cpp b/tests/auto/mng/tst_qmng.cpp index 7e37d97..b82ece1 100644 --- a/tests/auto/mng/tst_qmng.cpp +++ b/tests/auto/mng/tst_qmng.cpp @@ -39,12 +39,19 @@ class tst_qmng: public QObject Q_OBJECT private slots: + void initTestCase(); void readImage_data(); void readImage(); void readCorruptImage_data(); void readCorruptImage(); }; +void tst_qmng::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("mng")) + QSKIP("The image format handler is not installed."); +} + void tst_qmng::readImage_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/tga/tst_qtga.cpp b/tests/auto/tga/tst_qtga.cpp index 6569077..0001383 100644 --- a/tests/auto/tga/tst_qtga.cpp +++ b/tests/auto/tga/tst_qtga.cpp @@ -39,10 +39,17 @@ class tst_qtga: public QObject Q_OBJECT private slots: + void initTestCase(); void readImage_data(); void readImage(); }; +void tst_qtga::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("tga")) + QSKIP("The image format handler is not installed."); +} + void tst_qtga::readImage_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/tiff/tst_qtiff.cpp b/tests/auto/tiff/tst_qtiff.cpp index 70837a5..a77a735 100644 --- a/tests/auto/tiff/tst_qtiff.cpp +++ b/tests/auto/tiff/tst_qtiff.cpp @@ -89,6 +89,9 @@ private: void tst_qtiff::initTestCase() { + if (!QImageReader::supportedImageFormats().contains("tiff")) + QSKIP("The image format handler is not installed."); + prefix = ":/tiff/"; } diff --git a/tests/auto/wbmp/tst_qwbmp.cpp b/tests/auto/wbmp/tst_qwbmp.cpp index 344cd3d..a315fc4 100644 --- a/tests/auto/wbmp/tst_qwbmp.cpp +++ b/tests/auto/wbmp/tst_qwbmp.cpp @@ -39,10 +39,17 @@ class tst_qwbmp: public QObject Q_OBJECT private slots: + void initTestCase(); void readImage_data(); void readImage(); }; +void tst_qwbmp::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("wbmp")) + QSKIP("The image format handler is not installed."); +} + void tst_qwbmp::readImage_data() { QTest::addColumn<QString>("fileName"); diff --git a/tests/auto/webp/tst_qwebp.cpp b/tests/auto/webp/tst_qwebp.cpp index 2708004..5cbfc0c 100644 --- a/tests/auto/webp/tst_qwebp.cpp +++ b/tests/auto/webp/tst_qwebp.cpp @@ -39,12 +39,19 @@ class tst_qwebp : public QObject Q_OBJECT private slots: + void initTestCase(); void readImage_data(); void readImage(); void writeImage_data(); void writeImage(); }; +void tst_qwebp::initTestCase() +{ + if (!QImageReader::supportedImageFormats().contains("webp")) + QSKIP("The image format handler is not installed."); +} + void tst_qwebp::readImage_data() { QTest::addColumn<QString>("fileName"); |