add support to run hello world target as a CMake test

This commit is contained in:
Alfi Maulana
2023-01-22 12:32:23 +07:00
parent d59afd2844
commit 633b25cfad
2 changed files with 4 additions and 6 deletions

View File

@@ -14,7 +14,9 @@ if(CHECK_SURPASS_WARNING)
endif()
endif()
enable_testing()
add_executable(hello_world hello_world.cpp)
add_test(NAME hello_world COMMAND $<TARGET_FILE:hello_world>)
list(APPEND LANGS c cpp)
foreach(LANG ${LANGS})