Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3247095
D5117.id16606.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5117.id16606.diff
View Options
diff --git a/services/backup/CMakeLists.txt b/services/backup/CMakeLists.txt
--- a/services/backup/CMakeLists.txt
+++ b/services/backup/CMakeLists.txt
@@ -12,9 +12,6 @@
# For C++17 on MacOS, we must set minimum target to 10.14+
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
-set(BUILD_TESTING OFF CACHE BOOL "Turn off tests" FORCE)
-set(WITH_GTEST "Use Google Test" OFF)
-
find_package(glog REQUIRED)
find_package(Protobuf REQUIRED)
find_package(gRPC REQUIRED)
@@ -55,17 +52,12 @@
add_executable(
backup
- ${GENERATED_CODE}
- ${FOLLY_SOURCES}
-
${SOURCE_CODE}
)
add_library_rust(PATH blob_client NAMESPACE backup)
-target_include_directories(
- backup
- PUBLIC
+set(INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/DatabaseEntities
${CMAKE_CURRENT_SOURCE_DIR}/src/Reactors
@@ -75,6 +67,12 @@
${Boost_INCLUDE_DIR}
)
+target_include_directories(
+ backup
+ PUBLIC
+ ${INCLUDE_DIRS}
+)
+
set(
LIBS
@@ -104,7 +102,9 @@
)
# TEST
-if ($ENV{COMM_TEST_SERVICES} MATCHES 1)
+option(BUILD_TESTING "Turn off tests" ON)
+
+if (BUILD_TESTING)
file(GLOB TEST_CODE "./test/*.cpp")
list(FILTER SOURCE_CODE EXCLUDE REGEX "./src/server.cpp")
enable_testing()
@@ -118,21 +118,23 @@
add_executable(
runTests
- ${GENERATED_CODE}
- ${FOLLY_SOURCES}
${SOURCE_CODE}
${TEST_CODE}
)
+
+ target_include_directories(
+ runTests
+ PUBLIC
+ ${INCLUDE_DIRS}
+ )
+
target_link_libraries(
runTests
${LIBS}
- gtest
- gtest_main
+ GTest::gtest_main
)
- add_test(
- NAME runTests
- COMMAND runTests
- )
+ include(GoogleTest)
+ gtest_discover_tests(runTests)
endif()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 3:29 AM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2496258
Default Alt Text
D5117.id16606.diff (1 KB)
Attached To
Mode
D5117: [Services] Fix backup test suite build
Attached
Detach File
Event Timeline
Log In to Comment