googletest added

pull/93/merge
moneroexamples 6 years ago
parent 784cf5b558
commit 8c559342a6

@ -5,7 +5,7 @@ set(PROJECT_NAME
project(${PROJECT_NAME})
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
if(CMAKE_SIZEOF_VOID_P EQUAL "4")
add_definitions(-DMDB_VL32)
@ -15,6 +15,8 @@ if (NOT MONERO_DIR)
set(MONERO_DIR ~/monero)
endif()
option(BUILD_TEST "Build tests for the project" ON)
message(STATUS MONERO_DIR ": ${MONERO_DIR}")
set(MONERO_SOURCE_DIR ${MONERO_DIR}
@ -118,7 +120,6 @@ set(LIBRARIES
pthread
unbound
curl
dl
cncrypto
ssl
crypto)
@ -146,3 +147,12 @@ else()
endif()
target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
include_directories(
${CMAKE_SOURCE_DIR}/tests/googletest/googletest/include
${CMAKE_SOURCE_DIR}/tests/googletest/googlemock/include)
enable_testing()
add_subdirectory(ext/googletest)
add_subdirectory(tests)

@ -0,0 +1 @@
Subproject commit ba96d0b1161f540656efdaed035b3c062b60e006

@ -0,0 +1,16 @@
macro(add_om_test _TEST_NAME)
add_executable(${_TEST_NAME}_tests
${_TEST_NAME}_tests.cpp)
target_link_libraries(${_TEST_NAME}_tests
gtest gtest_main
${LIBRARIES})
add_test(NAME ${_TEST_NAME}_tests COMMAND ${_TEST_NAME}_tests)
endmacro()
resource_dir("./res")
add_om_test(mysql)

@ -0,0 +1,12 @@
//
// Created by mwo on 15/06/18.
//
#include "gtest/gtest.h"
TEST(BasicTests, First)
{
EXPECT_TRUE(true);
}
Loading…
Cancel
Save