aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkye Deving <76892045+skyedeving@users.noreply.github.com>2021-01-04 23:57:43 -0600
committerSkye Deving <76892045+skyedeving@users.noreply.github.com>2021-01-28 11:05:42 -0600
commit337b056400955c9384accf4bb4f3a58a768852cf (patch)
tree58e3af8d6f6a2b949958ec51bff736b79968347f
parentb1090d6e271ae2b04854462c242ef2ce87d74822 (diff)
Add test for apng
-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"));
+}