backend tests progress
This commit is contained in:
@@ -8,14 +8,21 @@ FetchContent_Declare(
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
|
||||
SET(POSTGRES_CONNECTION_STRING "postgresql://test:test123@127.0.0.1/matador_test" CACHE STRING "postgresql connection string")
|
||||
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
|
||||
include(CTest)
|
||||
include(Catch)
|
||||
|
||||
CONFIGURE_FILE(Connection.hpp.in ${PROJECT_BINARY_DIR}/backends/postgres/test/connection.hpp @ONLY IMMEDIATE)
|
||||
set(POSTGRES_CONNECTION_STRING "postgres://test:test123@127.0.0.1:15432/test")
|
||||
|
||||
MESSAGE(STATUS "postgresql connection string: ${POSTGRES_CONNECTION_STRING}")
|
||||
MESSAGE(STATUS "current binary dir: ${CMAKE_CURRENT_BINARY_DIR}")
|
||||
configure_file(Connection.hpp.in ${PROJECT_BINARY_DIR}/backends/postgres/test/connection.hpp @ONLY IMMEDIATE)
|
||||
|
||||
set(TEST_SOURCES ../../tests/QueryTest.cpp)
|
||||
message(STATUS "postgresql connection string: ${POSTGRES_CONNECTION_STRING}")
|
||||
|
||||
set(TEST_SOURCES
|
||||
../../tests/QueryTest.cpp
|
||||
../../tests/SessionTest.cpp
|
||||
../../tests/ConnectionTest.cpp
|
||||
../../tests/SessionRecordTest.cpp)
|
||||
|
||||
set(LIBRARY_TEST_TARGET postgres_tests)
|
||||
|
||||
@@ -29,6 +36,7 @@ target_link_libraries(${LIBRARY_TEST_TARGET} PRIVATE
|
||||
|
||||
target_include_directories(${LIBRARY_TEST_TARGET}
|
||||
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>/include
|
||||
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>/test
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_test(NAME matador_postgres_tests COMMAND ${LIBRARY_TEST_TARGET})
|
||||
catch_discover_tests(${LIBRARY_TEST_TARGET} TEST_SUFFIX " (PostgreSQL)")
|
||||
|
||||
Reference in New Issue
Block a user