Commit 3a3bc5e5 authored by Michael Pyne's avatar Michael Pyne
Browse files

test: Fix tagguessertest lookup error with ctest.

For whatever reason, running plain ctest or even "ninja test" on a
testing-enabled does not succeed in finding tagguessertest to run it,
probably because this test is located in the build directory's /bin
subfolder and the test metadata is incorrect.

However I was able to solve this just by using the existing ECM macro to
add a single test (https://api.kde.org/ecm/module/ECMAddTests.html)
directly, so that's what I did. ctest now runs and passes both tests
fine again.
parent 082914b0
Pipeline #50848 passed with stage
in 10 minutes and 29 seconds
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
########### next target ###############
include(ECMAddTests)
set(tagguessertest_SRCS tagguessertest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../tagguesser.cpp )
add_executable(tagguessertest ${tagguessertest_SRCS})
add_test(tagguesser tagguessertest)
ecm_mark_as_test(tagguessertest)
target_link_libraries(tagguessertest Qt5::Test KF5::ConfigCore KF5::CoreAddons)
# Simple unit tests of guessing tags from a filename
ecm_add_test("${CMAKE_SOURCE_DIR}/tagguesser.cpp" tagguessertest.cpp
LINK_LIBRARIES Qt5::Test KF5::ConfigCore KF5::CoreAddons
TEST_NAME tagguessertest)
target_include_directories(tagguessertest PRIVATE ${CMAKE_SOURCE_DIR})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment