qBittorrent/test/CMakeLists.txt
Chocobo1 a4c2363f43
Improve constructor of Version class
Now we can write `Version<int, 3, 1>(1)` and provide only 1 parameter
instead of all 3 parameters at once at the constructor. Note that for
this instance of `Version` 3 numbers were specified but only 1 is truly
mandatory.

The added code are required to specify conditions of the template
instantiation for the compiler.
2022-08-01 14:53:55 +08:00

29 lines
748 B
CMake

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
testalgorithm.cpp
testorderedset.cpp
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()