From 74a1fc7780261c061d0562cdf507ba9333b21806 Mon Sep 17 00:00:00 2001 From: James Gilbertson Date: Tue, 3 Nov 2026 20:26:09 -0800 Subject: [PATCH] Make anitest and pictest load the built plugins addLibraryPath() is a no-op if the path being added is already present, which is the case for PLUGIN_DIR here (it is set to the test's own directory). The docs for addLibraryPath() say this directory is last in the default list. --- autotests/anitest.cpp | 2 ++ autotests/pictest.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/autotests/anitest.cpp b/autotests/anitest.cpp index eaa3a80..295ae35 100644 --- a/autotests/anitest.cpp +++ b/autotests/anitest.cpp @@ -31,6 +31,8 @@ class AniTests : public QObject private Q_SLOTS: void initTestCase() { + // addLibraryPath is a no-op if the path added is already present in the list + QCoreApplication::removeLibraryPath(QStringLiteral(PLUGIN_DIR)); QCoreApplication::addLibraryPath(QStringLiteral(PLUGIN_DIR)); } diff --git a/autotests/pictest.cpp b/autotests/pictest.cpp index 09be23a..f0572e6 100644 --- a/autotests/pictest.cpp +++ b/autotests/pictest.cpp @@ -59,6 +59,8 @@ private: private Q_SLOTS: void initTestCase() { + // addLibraryPath is a no-op if the path added is already present in the list + QCoreApplication::removeLibraryPath(QStringLiteral(PLUGIN_DIR)); QCoreApplication::addLibraryPath(QStringLiteral(PLUGIN_DIR)); }