-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
155 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,80 @@ | ||
############################################################################### | ||
# | ||
# This file is part of CMake configuration for SOCI library | ||
# | ||
# Copyright (C) 2010-2013 Mateusz Loskot <mateusz@loskot.net> | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# | ||
############################################################################### | ||
|
||
if (WIN32) | ||
# MDBTools driver seems unreliable | ||
soci_backend_test( | ||
NAME access | ||
BACKEND ODBC | ||
DEPENDS ODBC | ||
SOURCE test-odbc-access.cpp ${SOCI_TESTS_COMMON} | ||
CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-access.dsn") | ||
else() | ||
message(STATUS "MS Access test disabled on non-Windows platform") | ||
endif() | ||
|
||
set(MSSQL_VER $ENV{MSSQL_VER}) | ||
if (NOT MSSQL_VER) | ||
# Use the same value that was used before by default. | ||
set(MSSQL_VER "2014") | ||
endif() | ||
configure_file("test-mssql.dsn.in" "test-mssql.dsn" @ONLY) | ||
configure_file("test-mssql.dsn.in" "${CMAKE_CURRENT_BINARY_DIR}/test-mssql.dsn" @ONLY) | ||
|
||
|
||
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) | ||
|
||
soci_make_tests( | ||
OBJECT_LIB odbc_ms_access_tests | ||
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-access.dsn" | ||
SHARED_NAME "soci_odbc_ms_access_test" | ||
STATIC_NAME "soci_odbc_ms_access_test_static" | ||
SOCI_DEP_ALIAS "ODBC" | ||
) | ||
endif() | ||
|
||
soci_backend_test( | ||
NAME mssql | ||
BACKEND ODBC | ||
DEPENDS ODBC | ||
SOURCE test-odbc-mssql.cpp ${SOCI_TESTS_COMMON} | ||
CONNSTR "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-mssql.dsn") | ||
|
||
soci_backend_test( | ||
NAME mysql | ||
BACKEND ODBC | ||
DEPENDS ODBC | ||
SOURCE test-odbc-mysql.cpp ${SOCI_TESTS_COMMON} | ||
CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-mysql.dsn") | ||
add_library(odbc_mssql_tests OBJECT odbc_mssql_tests.cpp) | ||
target_link_libraries(odbc_mssql_tests PUBLIC soci_common_tests soci_odbc_interface) | ||
|
||
soci_make_tests( | ||
OBJECT_LIB odbc_mssql_tests | ||
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_BINARY_DIR}/test-access.dsn" | ||
SHARED_NAME "soci_odbc_mssql_test" | ||
STATIC_NAME "soci_odbc_mssql_test_static" | ||
SOCI_DEP_ALIAS "ODBC" | ||
) | ||
|
||
|
||
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}/../") | ||
|
||
soci_make_tests( | ||
OBJECT_LIB odbc_mysql_tests | ||
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-mysql.dsn" | ||
SHARED_NAME "soci_odbc_mysql_test" | ||
STATIC_NAME "soci_odbc_mysql_test_static" | ||
SOCI_DEP_ALIAS "ODBC" | ||
) | ||
|
||
|
||
if(WIN32) | ||
set(TEST_PGSQL_DSN "test-postgresql-win64.dsn") | ||
else() | ||
set(TEST_PGSQL_DSN "test-postgresql.dsn") | ||
endif() | ||
soci_backend_test( | ||
NAME postgresql | ||
BACKEND ODBC | ||
DEPENDS ODBC | ||
SOURCE test-odbc-postgresql.cpp ${SOCI_TESTS_COMMON} | ||
CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/${TEST_PGSQL_DSN}") | ||
|
||
add_library(odbc_postgresql_tests OBJECT odbc_postgresql_tests.cpp) | ||
target_link_libraries(odbc_postgresql_tests PUBLIC soci_common_tests soci_odbc_interface) | ||
|
||
soci_make_tests( | ||
OBJECT_LIB odbc_postgresql_tests | ||
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/${TEST_PGSQL_DSN}" | ||
SHARED_NAME "soci_odbc_postgresql_test" | ||
STATIC_NAME "soci_odbc_postgresql_test_static" | ||
SOCI_DEP_ALIAS "ODBC" | ||
) | ||
|
||
# TODO: DB2 backend is tested by Travis CI on dedicated VM, separate from ODBC, | ||
# in order to test DB2 with ODBC, it would be best to install DB2 driver only. | ||
# if (NOT $ENV{TRAVIS}) | ||
option(WITH_ODBC_TEST_DB2 "Build ODBC DB2 test" OFF) | ||
if (WITH_ODBC_TEST_DB2) | ||
soci_backend_test( | ||
NAME db2 | ||
BACKEND ODBC | ||
SOURCE test-odbc-db2.cpp | ||
CONNSTR "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-db2.dsn") | ||
else() | ||
message(STATUS "ODBC DB2 test disabled.") | ||
add_library(odbc_db2_tests OBJECT odbc_db2_tests.cpp) | ||
target_link_libraries(odbc_db2_tests PUBLIC soci_common_tests soci_odbc_interface) | ||
|
||
soci_make_tests( | ||
OBJECT_LIB odbc_db2_tests | ||
CONNECTION_STRING "FILEDSN=${CMAKE_CURRENT_SOURCE_DIR}/test-db2.dsn" | ||
SHARED_NAME "soci_odbc_db2_test" | ||
STATIC_NAME "soci_odbc_db2_test_static" | ||
SOCI_DEP_ALIAS "ODBC" | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.