qBittorrent/test/CMakeLists.txt

32 lines
800 B
Text
Raw Normal View History

if (QT6)
find_package(Qt6 REQUIRED COMPONENTS Test)
else()
find_package(Qt5 REQUIRED COMPONENTS Test)
endif()
enable_testing(true)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
include_directories("../src")
set(testFiles
2022-07-10 10:21:07 +03:00
testalgorithm.cpp
testbittorrenttrackerentry.cpp
2022-07-10 10:21:07 +03:00
testorderedset.cpp
2022-08-13 07:32:18 +03:00
testpath.cpp
2022-07-10 10:21:07 +03:00
testutilscompare.cpp
testutilsgzip.cpp
testutilsstring.cpp
testutilsversion.cpp
)
foreach(testFile ${testFiles})
get_filename_component(testFilename "${testFile}" NAME_WLE)
add_executable("${testFilename}" "${testFile}")
target_link_libraries("${testFilename}" PRIVATE Qt::Test qbt_base)
add_test(NAME "${testFilename}" COMMAND "${testFilename}")
add_dependencies(check "${testFilename}")
endforeach()