Skip to content

Commit d59abed

Browse files
authored
Fix CMake subdir test
* Fix CMake subdir test `add_test(main main)` treats the 2nd argument as the command to run. The one-argument (or named argument variant) supports resolving target names so it will always find it * Use named arguments for subdir-add_test
1 parent d5ccc9e commit d59abed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/cmake_subdir_test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ add_executable(main main.cpp)
3939
target_link_libraries(main Boost::openmethod)
4040

4141
enable_testing()
42-
add_test(main main)
42+
add_test(NAME main COMMAND main)
4343

4444
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

0 commit comments

Comments
 (0)