Don't read unlimited data from files
[qBittorrent.git] / test / CMakeLists.txt
blobebdfff4136ef0c3d317b2d0df9fde16ce5ee392b
1 if (QT6)
2     find_package(Qt6 REQUIRED COMPONENTS Test)
3 else()
4     find_package(Qt5 REQUIRED COMPONENTS Test)
5 endif()
7 enable_testing(true)
8 add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
10 include_directories("../src")
12 set(testFiles
13     testalgorithm.cpp
14     testbittorrenttrackerentry.cpp
15     testorderedset.cpp
16     testpath.cpp
17     testutilscompare.cpp
18     testutilsbytearray.cpp
19     testutilsgzip.cpp
20     testutilsio.cpp
21     testutilsstring.cpp
22     testutilsversion.cpp
25 foreach(testFile ${testFiles})
26     get_filename_component(testFilename "${testFile}" NAME_WLE)
28     add_executable("${testFilename}" "${testFile}")
29     target_link_libraries("${testFilename}" PRIVATE Qt::Test qbt_base)
30     add_test(NAME "${testFilename}" COMMAND "${testFilename}")
32     add_dependencies(check "${testFilename}")
33 endforeach()