Separate thrift concerns from other unit tests

This commit is contained in:
Tyler Neely
2022-08-18 12:45:48 +00:00
parent b5cff914c0
commit 79ffcc1793
2 changed files with 3 additions and 7 deletions

View File

@@ -1,11 +1,10 @@
# include(MgThrift) include(MgThrift)
set(test_prefix memgraph__unit__) set(test_prefix memgraph__unit__)
find_package(fmt REQUIRED) find_package(fmt REQUIRED)
find_package(gflags REQUIRED) find_package(gflags REQUIRED)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
find_package(Folly REQUIRED)
add_custom_target(memgraph__unit) add_custom_target(memgraph__unit)
@@ -40,7 +39,7 @@ function(_add_unit_test test_cpp custom_main)
# used to help create two targets of the same name even though CMake # used to help create two targets of the same name even though CMake
# requires unique logical target names # requires unique logical target names
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${exec_name}) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${exec_name})
target_link_libraries(${target_name} mg-memory mg-utils gtest gmock Threads::Threads dl mg-interface-echo-cpp2) target_link_libraries(${target_name} mg-memory mg-utils gtest gmock Threads::Threads dl)
# register test # register test
if(TEST_COVERAGE) if(TEST_COVERAGE)
@@ -400,4 +399,4 @@ target_link_libraries(${test_prefix}future mg-io)
# Test Thrift transport echo # Test Thrift transport echo
add_unit_test(thrift_transport_echo.cpp) add_unit_test(thrift_transport_echo.cpp)
target_link_libraries(${test_prefix}thrift_transport_echo mg-io Threads::Threads mg-interface-echo-cpp2 fmt) target_link_libraries(${test_prefix}thrift_transport_echo mg-io fmt Threads::Threads FBThrift::thriftcpp2 mg-interface-echo-cpp2)

View File

@@ -9,15 +9,12 @@
// by the Apache License, Version 2.0, included in the file // by the Apache License, Version 2.0, included in the file
// licenses/APL.txt. // licenses/APL.txt.
#include <folly/init/Init.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <utils/logging.hpp> #include <utils/logging.hpp>
int main(int argc, char **argv) { int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
folly::Init(&argc, &argv);
memgraph::logging::RedirectToStderr(); memgraph::logging::RedirectToStderr();
spdlog::set_level(spdlog::level::trace); spdlog::set_level(spdlog::level::trace);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();