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.
This commit is contained in:
A. Wilcox 2022-06-12 16:14:51 -05:00
parent eb50358b72
commit 26e069d6cd
No known key found for this signature in database
GPG Key ID: CB29CB51922B9D14
1 changed files with 3 additions and 3 deletions

View File

@ -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>)
if(TARGET pmsfdiskbackendplugin)
add_test(NAME testinit-sfdisk COMMAND testinit $<TARGET_FILE:pmsfdiskbackendplugin>)
add_test(NAME testinit-sfdisk COMMAND testinit $<TARGET_FILE_NAME:pmsfdiskbackendplugin>)
return() # All the rest really needs a working backend
set(BACKEND $<TARGET_FILE:pmsfdiskbackendplugin>)
set(BACKEND $<TARGET_FILE_NAME:pmsfdiskbackendplugin>)