From be0fa26e85de1edaa5c7e0e68d62d9f59f854753 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Wed, 6 Jan 2021 00:43:30 -0600 Subject: [PATCH] Test seems to work if linking QtApng installed on system --- test/CMakeLists.txt | 2 +- test/test_apng.cpp | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 840eabc..e09e48e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,4 +4,4 @@ find_package(Catch2 REQUIRED) add_executable(test test_aopacket.cpp test_caseloading.cpp test_apng.cpp test_bass.cpp ../include/aopacket.h ../src/aopacket.cpp) target_include_directories(test PRIVATE ../include) target_link_directories(test PRIVATE ../lib) -target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus) +target_link_libraries(test PRIVATE Qt5::Core Qt5::Gui Catch2::Catch2 bass bassopus qapng) diff --git a/test/test_apng.cpp b/test/test_apng.cpp index 026826b..7d7062b 100644 --- a/test/test_apng.cpp +++ b/test/test_apng.cpp @@ -4,14 +4,15 @@ #include #include -TEST_CASE("Support APNG Plugin (place lib same path)", "[apng]") { +TEST_CASE("Support APNG Plugin", "[apng]") { + // Check paths for libs QCoreApplication::addLibraryPath("."); - QPluginLoader apngPlugin("qapng"); - REQUIRE(apngPlugin.load()); + QCoreApplication::addLibraryPath("lib"); + + // Either it's loaded from system or we load local + QPluginLoader apngPlugin("qapng"); + 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 INFO(QImageReader::supportedImageFormats().join(' ').toStdString()); - REQUIRE((QImageReader::supportedImageFormats().contains("apng") || - QImageReader::supportedImageFormats().contains("APNG"))); + REQUIRE(QImageReader::supportedImageFormats().contains("apng")); }