HEIF tests skipped using kde-ci.yml

This commit is contained in:
Mirco Miranda
2025-12-17 10:23:04 +01:00
committed by Mirco Miranda
parent af4597f796
commit 30308f3541
6 changed files with 56 additions and 48 deletions

View File

@@ -7,5 +7,5 @@ Dependencies:
Options: Options:
test-before-installing: True test-before-installing: True
require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows'] require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows']
cmake-options: "-DKIMAGEFORMATS_DDS=ON -DKIMAGEFORMATS_JXR=ON -DKIMAGEFORMATS_HEIF=ON" cmake-options: "-DKIMAGEFORMATS_JXR=ON -DKIMAGEFORMATS_HEIF=ON -DKIMAGEFORMATS_HEIF_TEST:STRING=OFF -DKIMAGEFORMATS_HEJ2_TEST:STRING=OFF -DKIMAGEFORMATS_AVCI_TEST:STRING=OFF"
per-test-timeout: 90 per-test-timeout: 90

View File

@@ -65,6 +65,12 @@ set_package_properties(libavif PROPERTIES
option(KIMAGEFORMATS_DDS "Enable plugin for DDS format" ON) option(KIMAGEFORMATS_DDS "Enable plugin for DDS format" ON)
option(KIMAGEFORMATS_HEIF "Enable plugin for HEIF format" OFF) option(KIMAGEFORMATS_HEIF "Enable plugin for HEIF format" OFF)
set(KIMAGEFORMATS_HEIF_TEST "ALL" CACHE STRING "Enable HEIF tests: OFF, READ_ONLY, ALL")
set_property(CACHE KIMAGEFORMATS_HEIF_TEST PROPERTY STRINGS "OFF" "READ_ONLY" "ALL")
set(KIMAGEFORMATS_HEJ2_TEST "ALL" CACHE STRING "Enable HEJ2 tests: OFF, READ_ONLY, ALL")
set_property(CACHE KIMAGEFORMATS_HEJ2_TEST PROPERTY STRINGS "OFF" "READ_ONLY" "ALL")
set(KIMAGEFORMATS_AVCI_TEST "ALL" CACHE STRING "Enable AVCI tests: OFF, ALL")
set_property(CACHE KIMAGEFORMATS_AVCI_TEST PROPERTY STRINGS "OFF" "ALL")
if(KIMAGEFORMATS_HEIF) if(KIMAGEFORMATS_HEIF)
pkg_check_modules(LibHeif IMPORTED_TARGET libheif>=1.10.0) pkg_check_modules(LibHeif IMPORTED_TARGET libheif>=1.10.0)
endif() endif()

View File

@@ -303,6 +303,15 @@ distributions. In particular, it is necessary that the HEIF library has
support for HEVC codec. If HEVC codec is not available the plugin support for HEVC codec. If HEVC codec is not available the plugin
will compile but will fail the tests. will compile but will fail the tests.
**If you are interested in compiling the plugin without running the tests,
also use the following string options:**
- `KIMAGEFORMATS_HEIF_TEST` to change the behaviour of HEIF tests. Set to
`"OFF"` (no test at all) or `"READ_ONLY"` (run read tests only).
- `KIMAGEFORMATS_HEJ2_TEST` to change the behaviour of HEJ2 tests. Set to
`"OFF"` (no test at all) or `"READ_ONLY"` (run read tests only)..
- `KIMAGEFORMATS_AVCI_TEST` to change the behaviour of AVCI tests. Set to
`"OFF"` (no test at all).
### The EXR plugin ### The EXR plugin
The following defines can be defined in cmake to modify the behavior of the The following defines can be defined in cmake to modify the behavior of the

View File

@@ -111,29 +111,39 @@ if (TARGET avif)
endif() endif()
if (LibHeif_FOUND) if (LibHeif_FOUND)
if (KIMAGEFORMATS_HEIF_TEST STREQUAL "ALL" OR KIMAGEFORMATS_HEIF_TEST STREQUAL "READ_ONLY")
kimageformats_read_tests( kimageformats_read_tests(
heif heif
) )
endif()
if (KIMAGEFORMATS_HEIF_TEST STREQUAL "ALL")
# because the plug-ins use RGB->YUV conversion which sometimes results in 1 value difference. # because the plug-ins use RGB->YUV conversion which sometimes results in 1 value difference.
kimageformats_write_tests(FUZZ 1 kimageformats_write_tests(FUZZ 1
heif-nodatacheck-lossless heif-nodatacheck-lossless
) )
endif()
if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.17.0") if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.17.0")
if (KIMAGEFORMATS_HEJ2_TEST STREQUAL "ALL" OR KIMAGEFORMATS_HEJ2_TEST STREQUAL "READ_ONLY")
kimageformats_read_tests(FUZZ 1 kimageformats_read_tests(FUZZ 1
hej2 hej2
) )
endif()
if (KIMAGEFORMATS_HEJ2_TEST STREQUAL "ALL")
kimageformats_write_tests(FUZZ 1 kimageformats_write_tests(FUZZ 1
hej2-nodatacheck-lossless hej2-nodatacheck-lossless
) )
endif() endif()
endif()
if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.19.6") if (LibHeif_VERSION VERSION_GREATER_EQUAL "1.19.6")
if (KIMAGEFORMATS_AVCI_TEST STREQUAL "ALL")
kimageformats_read_tests(FUZZ 4 kimageformats_read_tests(FUZZ 4
avci avci
) )
endif() endif()
endif() endif()
endif()
if (OpenJPEG_FOUND) if (OpenJPEG_FOUND)
kimageformats_read_tests( kimageformats_read_tests(

View File

@@ -258,13 +258,12 @@ int main(int argc, char **argv)
}); });
QTextStream(stdout) << "QImageReader::supportedImageFormats: " << formatStrings.join(", ") << "\n"; QTextStream(stdout) << "QImageReader::supportedImageFormats: " << formatStrings.join(", ") << "\n";
// checks if the format has read capability
if (!formats.contains(format)) { if (!formats.contains(format)) {
if (format == "avci" || format == "heif" || format == "hej2") { QTextStream(stdout) << "FAIL : current configuration is missing necessary decoder(s) for " << suffix << "!\n"
QTextStream(stdout) << "WARNING : " << suffix << " is not supported with current libheif configuration!\n"
<< "********* " << "********* "
<< "Finished basic read tests for " << suffix << " images *********\n"; << "Finished basic read tests for " << suffix << " images *********\n";
return 0; return 1;
}
} }
const QFileInfoList lstImgDir = imgdir.entryInfoList(); const QFileInfoList lstImgDir = imgdir.entryInfoList();
@@ -343,12 +342,7 @@ int main(int argc, char **argv)
OptionTest optionTest; OptionTest optionTest;
if (!optionTest.store(&inputReader)) { if (!optionTest.store(&inputReader)) {
QTextStream(stdout) << "FAIL : " << fi.fileName() << ": error while reading options\n"; QTextStream(stdout) << "FAIL : " << fi.fileName() << ": error while reading options\n";
if (format == "heif") {
// libheif + ffmpeg decoder is unable to load all HEIF files.
++skipped;
} else {
++failed; ++failed;
}
continue; continue;
} }

View File

@@ -380,12 +380,7 @@ int formatTest(const QString &suffix, bool createTemplates)
QBuffer buffer(&ba); QBuffer buffer(&ba);
auto writtenImage = QImageReader(&buffer, suffix.toLatin1()).read(); auto writtenImage = QImageReader(&buffer, suffix.toLatin1()).read();
if (writtenImage.isNull()) { if (writtenImage.isNull()) {
if (suffix.toLatin1() == "heif") {
// libheif + ffmpeg decoder is unable to load all HEIF files.
++skipped;
} else {
++failed; ++failed;
}
QTextStream(stdout) << "FAIL : error while reading the image " << formatName << "\n"; QTextStream(stdout) << "FAIL : error while reading the image " << formatName << "\n";
continue; continue;
} }
@@ -639,23 +634,17 @@ int main(int argc, char **argv)
auto suffix = args.at(0); auto suffix = args.at(0);
// skip test if libheif configuration is obviously incomplete // skip test if configuration is obviously incomplete
QByteArray format = suffix.toLatin1(); QByteArray format = suffix.toLatin1();
const QList<QByteArray> read_formats = QImageReader::supportedImageFormats(); const QList<QByteArray> read_formats = QImageReader::supportedImageFormats();
if (!read_formats.contains(format)) { // checks if the format has read capability
QTextStream(stdout) << "FAIL : current configuration is missing necessary decoder(s) for " << format << "!\n";
return 1;
}
const QList<QByteArray> write_formats = QImageWriter::supportedImageFormats(); const QList<QByteArray> write_formats = QImageWriter::supportedImageFormats();
if (!write_formats.contains(format)) { // checks if the format has write capability
if (!read_formats.contains(format)) { QTextStream(stdout) << "FAIL : libraries configuration is missing necessary encoder(s) for " << format << "!\n";
if (format == "heif" || format == "hej2") { return 1;
QTextStream(stdout) << "WARNING : libheif configuration is missing necessary decoder(s)!\n";
return 0;
}
}
if (!write_formats.contains(format)) {
if (format == "heif" || format == "hej2") {
QTextStream(stdout) << "WARNING : libheif configuration is missing necessary encoder(s)!\n";
return 0;
}
} }
// run test // run test