aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/CMakeLists.txt6
-rw-r--r--test/test_apng.cpp15
2 files changed, 18 insertions, 3 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 3dd51c71..31aab1e9 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,6 +1,6 @@
-find_package(Qt5 COMPONENTS Core REQUIRED)
+find_package(Qt5 COMPONENTS Core Gui REQUIRED)
find_package(Catch2 REQUIRED)
-add_executable(test test_aopacket.cpp test_caseloading.cpp ../include/aopacket.h ../src/aopacket.cpp)
+add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp ../include/aopacket.h ../src/aopacket.cpp)
target_include_directories(test PRIVATE ../include)
-target_link_libraries(test PRIVATE Qt5::Core Catch2::Catch2)
+target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2)
diff --git a/test/test_apng.cpp b/test/test_apng.cpp
new file mode 100644
index 00000000..c1c04814
--- /dev/null
+++ b/test/test_apng.cpp
@@ -0,0 +1,15 @@
+#include <catch2/catch.hpp>
+
+#include <QPluginLoader>
+#include <QImageReader>
+#include <QCoreApplication>
+
+TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") {
+ QCoreApplication::addLibraryPath(".");
+ QPluginLoader apngPlugin("qapng");
+ REQUIRE(apngPlugin.load());
+
+ // Fails for some reason on windows and linux don't know about osx
+ // apng animation seems to be broken linux qt5-5.15.2
+ REQUIRE(QImageReader::supportedImageFormats().contains("APNG"));
+}