summaryrefslogblamecommitdiff
path: root/user/kpmcore/test.patch
blob: e969cb91dbec2c9f40b9146a550ca216ac0eac45 (plain) (tree)









































                                                                                                                                                    
From 26e069d6cdd2d28b04f0beb9cfb35115ac8f29d5 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Sun, 12 Jun 2022 16:14:51 -0500
Subject: [PATCH] Tests: Fix backend loading for tests

Using $<TARGET_FILE> we receive the entire plugin file path, leading to
errors such as:

kf.coreaddons: no metadata found in "kpmcore//home/awilcox/Code/KDE/kpmcore/bin/kpmcore/pmdummybackendplugin.so" "The shared library was not found."

Using $<TARGET_FILE_NAME> instead we are able to have just the plugin
name, which does load properly.  The tests now pass.
---
 test/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 262c38f..53cb133 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -34,15 +34,15 @@ endmacro()
 # Tests of initialization: try explicitly loading some backends
 kpm_test(testinit testinit.cpp)  # Default backend
 if(TARGET pmdummybackendplugin)
-    add_test(NAME testinit-dummy COMMAND testinit $<TARGET_FILE:pmdummybackendplugin>)
+    add_test(NAME testinit-dummy COMMAND testinit $<TARGET_FILE_NAME:pmdummybackendplugin>)
 endif()
 if(TARGET pmsfdiskbackendplugin)
-    add_test(NAME testinit-sfdisk COMMAND testinit $<TARGET_FILE:pmsfdiskbackendplugin>)
+    add_test(NAME testinit-sfdisk COMMAND testinit $<TARGET_FILE_NAME:pmsfdiskbackendplugin>)
 else()
     return()  # All the rest really needs a working backend
 endif()
 
-set(BACKEND $<TARGET_FILE:pmsfdiskbackendplugin>)
+set(BACKEND $<TARGET_FILE_NAME:pmsfdiskbackendplugin>)
 
 ###
 #
-- 
GitLab