Skip to content

Commit

Permalink
Expose ODBC test connector strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzmbrzl committed Feb 17, 2024
1 parent b3be869 commit e1e4433
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/odbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ if (WIN32)
add_library(odbc_ms_access_tests OBJECT odbc_ms_access_tests.cpp)
target_link_libraries(odbc_ms_access_tests PUBLIC soci_common_tests soci_odbc_interface)

set(SOCI_ODBC_TEST_ACCESS_CONNSTR "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-access.dsn" CACHE STRING "Connection string for the ODBC MS Access test")

soci_make_tests(
OBJECT_LIB odbc_ms_access_tests
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-access.dsn"
CONNECTION_STRING "${SOCI_ODBC_TEST_ACCESS_CONNSTR}"
SHARED_NAME "soci_odbc_ms_access_test"
STATIC_NAME "soci_odbc_ms_access_test_static"
SOCI_DEP_ALIAS "ODBC"
Expand All @@ -23,9 +25,11 @@ endif()
add_library(odbc_mssql_tests OBJECT odbc_mssql_tests.cpp)
target_link_libraries(odbc_mssql_tests PUBLIC soci_common_tests soci_odbc_interface)

set(SOCI_ODBC_TEST_MSSQL_CONNSTR "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-access.dsn" CACHE STRING "Connection string for the ODBC MSSQL test")

soci_make_tests(
OBJECT_LIB odbc_mssql_tests
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-access.dsn"
CONNECTION_STRING "${SOCI_ODBC_TEST_MSSQL_CONNSTR}"
SHARED_NAME "soci_odbc_mssql_test"
STATIC_NAME "soci_odbc_mssql_test_static"
SOCI_DEP_ALIAS "ODBC"
Expand All @@ -36,9 +40,11 @@ add_library(odbc_mysql_tests OBJECT odbc_mysql_tests.cpp)
target_link_libraries(odbc_mysql_tests PUBLIC soci_common_tests soci_odbc_interface)
target_include_directories(odbc_mysql_tests PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../")

set(SOCI_ODBC_TEST_MYSQL_CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-mysql.dsn" CACHE STRING "Connection string for the ODBC MySQL test")

soci_make_tests(
OBJECT_LIB odbc_mysql_tests
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-mysql.dsn"
CONNECTION_STRING "${SOCI_ODBC_TEST_MYSQL_CONNSTR}"
SHARED_NAME "soci_odbc_mysql_test"
STATIC_NAME "soci_odbc_mysql_test_static"
SOCI_DEP_ALIAS "ODBC"
Expand All @@ -54,9 +60,11 @@ endif()
add_library(odbc_postgresql_tests OBJECT odbc_postgresql_tests.cpp)
target_link_libraries(odbc_postgresql_tests PUBLIC soci_common_tests soci_odbc_interface)

set(SOCI_ODBC_TEST_POSTGRESQL_CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/${TEST_PGSQL_DSN}" CACHE STRING "Connection string for the ODBC PostgreSQL test")

soci_make_tests(
OBJECT_LIB odbc_postgresql_tests
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/${TEST_PGSQL_DSN}"
CONNECTION_STRING "${SOCI_ODBC_TEST_POSTGRESQL_CONNSTR}"
SHARED_NAME "soci_odbc_postgresql_test"
STATIC_NAME "soci_odbc_postgresql_test_static"
SOCI_DEP_ALIAS "ODBC"
Expand All @@ -70,9 +78,11 @@ if (WITH_ODBC_TEST_DB2)
add_library(odbc_db2_tests OBJECT odbc_db2_tests.cpp)
target_link_libraries(odbc_db2_tests PUBLIC soci_common_tests soci_odbc_interface)

set(SOCI_ODBC_TEST_DB2_CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-db2.dsn" CACHE STRING "Connection string for the ODBC DB2 test")

soci_make_tests(
OBJECT_LIB odbc_db2_tests
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-db2.dsn"
CONNECTION_STRING "${SOCI_ODBC_TEST_DB2_CONNSTR}"
SHARED_NAME "soci_odbc_db2_test"
STATIC_NAME "soci_odbc_db2_test_static"
SOCI_DEP_ALIAS "ODBC"
Expand Down

0 comments on commit e1e4433

Please sign in to comment.