Improve command for running test

It enables `make check` command to build tests and run it
altogether.
This commit is contained in:
Chocobo1 2022-07-30 18:22:06 +08:00
parent 1c0479a795
commit 958929aa77
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -16,10 +16,13 @@ set(testFiles
testutilsgzip.cpp
testutilsstring.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()