From 20d90a10bc4f6eb4a8a835ce2c90e64a0b1a8f04 Mon Sep 17 00:00:00 2001 From: Hyunsu Philip Cho Date: Thu, 4 May 2023 08:27:59 -0700 Subject: [PATCH] Add ctest target --- CMakeLists.txt | 1 + tests/cpp/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72f961a..8a7d7ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ if (BUILD_JVM_RUNTIME) add_subdirectory(java_runtime) endif () if (BUILD_CPP_TESTS) + enable_testing() add_subdirectory(tests/cpp) endif () diff --git a/tests/cpp/CMakeLists.txt b/tests/cpp/CMakeLists.txt index 1ac14c3..a29268e 100644 --- a/tests/cpp/CMakeLists.txt +++ b/tests/cpp/CMakeLists.txt @@ -7,6 +7,10 @@ target_link_libraries(tl2cgen_cpp_test PRIVATE obj_tl2cgen rapidjson GTest::GTest GTest::gmock fmt::fmt-header-only) set_output_directory(tl2cgen_cpp_test ${PROJECT_BINARY_DIR}) +add_test( + NAME TestTL2cgen + COMMAND tl2cgen_cpp_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) if (MSVC) target_compile_options(tl2cgen_cpp_test PRIVATE