diff --git a/autotests/readtest.cpp b/autotests/readtest.cpp index 1416ce5..83beb3a 100644 --- a/autotests/readtest.cpp +++ b/autotests/readtest.cpp @@ -258,6 +258,15 @@ int main(int argc, char **argv) }); QTextStream(stdout) << "QImageReader::supportedImageFormats: " << formatStrings.join(", ") << "\n"; + if (!formats.contains(format)) { + if (format == "avci" || format == "heif" || format == "hej2") { + QTextStream(stdout) << "WARNING : " << suffix << " is not supported with current libheif configuration!\n" + << "********* " + << "Finished basic read tests for " << suffix << " images *********\n"; + return 0; + } + } + const QFileInfoList lstImgDir = imgdir.entryInfoList(); // Launch 2 runs for each test: first run on a random access device, second run on a sequential access device for (int seq = 0; seq < 2; ++seq) { diff --git a/autotests/writetest.cpp b/autotests/writetest.cpp index 10a3df8..3fb630b 100644 --- a/autotests/writetest.cpp +++ b/autotests/writetest.cpp @@ -622,8 +622,24 @@ int main(int argc, char **argv) } } - // run test auto suffix = args.at(0); + + // skip test if libheif configuration is obviously incomplete + QByteArray format = suffix.toLatin1(); + const QList read_formats = QImageReader::supportedImageFormats(); + const QList write_formats = QImageWriter::supportedImageFormats(); + + if (!read_formats.contains(format) && format == "heif") { + QTextStream(stdout) << "WARNING : libheif configuration is missing necessary decoder(s)!\n"; + return 0; + } + + if (!write_formats.contains(format) && format == "heif") { + QTextStream(stdout) << "WARNING : libheif configuration is missing necessary encoder(s)!\n"; + return 0; + } + + // run test auto ret = basicTest(suffix, parser.isSet(lossless), parser.isSet(ignoreDataCheck), parser.isSet(skipOptTest), fuzzarg); if (ret == 0) { ret = formatTest(suffix, parser.isSet(createFormatTempates));