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
This commit is contained in:
Alexander Grund
2025-11-01 16:28:11 +01:00
committed by GitHub
parent d5ccc9edaa
commit d59abed109

View File

@@ -39,6 +39,6 @@ add_executable(main main.cpp)
target_link_libraries(main Boost::openmethod)
enable_testing()
add_test(main main)
add_test(NAME main COMMAND main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)