mirror of
https://github.com/rbock/sqlpp11.git
synced 2025-12-17 18:44:37 -06:00
style: Align CMake files with 4 spaces indent
This commit is contained in:
@@ -50,23 +50,23 @@ set(SQLPP11_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Sqlpp11 CACHE STRING
|
||||
|
||||
### Dependencies
|
||||
if(DEPENDENCY_CHECK AND BUILD_MYSQL_CONNECTOR)
|
||||
find_package(MySQL REQUIRED)
|
||||
find_package(MySQL REQUIRED)
|
||||
endif()
|
||||
|
||||
if(DEPENDENCY_CHECK AND BUILD_MARIADB_CONNECTOR)
|
||||
find_package(MariaDB REQUIRED)
|
||||
find_package(MariaDB REQUIRED)
|
||||
endif()
|
||||
|
||||
if(DEPENDENCY_CHECK AND BUILD_POSTGRESQL_CONNECTOR)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
endif()
|
||||
|
||||
if(DEPENDENCY_CHECK AND BUILD_SQLITE3_CONNECTOR)
|
||||
find_package(SQLite3 REQUIRED)
|
||||
find_package(SQLite3 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(DEPENDENCY_CHECK AND BUILD_SQLCIPHER_CONNECTOR)
|
||||
find_package(SQLCipher REQUIRED)
|
||||
find_package(SQLCipher REQUIRED)
|
||||
endif()
|
||||
|
||||
if(DEPENDENCY_CHECK AND USE_SYSTEM_DATE)
|
||||
@@ -83,79 +83,79 @@ add_library(sqlpp11::sqlpp11 ALIAS sqlpp11)
|
||||
|
||||
target_link_libraries(sqlpp11 INTERFACE date::date)
|
||||
target_include_directories(sqlpp11 INTERFACE
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
)
|
||||
target_compile_features(sqlpp11 INTERFACE cxx_std_11)
|
||||
|
||||
|
||||
if(BUILD_SQLITE3_CONNECTOR)
|
||||
add_component(NAME sqlite3 DEPENDENCIES SQLite::SQLite3)
|
||||
add_component(NAME sqlite3 DEPENDENCIES SQLite::SQLite3)
|
||||
endif()
|
||||
|
||||
if(BUILD_SQLCIPHER_CONNECTOR)
|
||||
add_component(NAME sqlcipher DEPENDENCIES SQLite::SQLCipher)
|
||||
target_compile_definitions(sqlpp11_sqlcipher INTERFACE SQLPP_USE_SQLCIPHER)
|
||||
add_component(NAME sqlcipher DEPENDENCIES SQLite::SQLCipher)
|
||||
target_compile_definitions(sqlpp11_sqlcipher INTERFACE SQLPP_USE_SQLCIPHER)
|
||||
endif()
|
||||
|
||||
if(BUILD_MYSQL_CONNECTOR)
|
||||
add_component(NAME mysql DEPENDENCIES MySQL::MySQL)
|
||||
add_component(NAME mysql DEPENDENCIES MySQL::MySQL)
|
||||
endif()
|
||||
|
||||
if(BUILD_MARIADB_CONNECTOR)
|
||||
add_component(NAME mariadb DEPENDENCIES MariaDB::MariaDB)
|
||||
add_component(NAME mariadb DEPENDENCIES MariaDB::MariaDB)
|
||||
endif()
|
||||
|
||||
if(BUILD_POSTGRESQL_CONNECTOR)
|
||||
add_component(NAME postgresql DEPENDENCIES PostgreSQL::PostgreSQL)
|
||||
add_component(NAME postgresql DEPENDENCIES PostgreSQL::PostgreSQL)
|
||||
endif()
|
||||
|
||||
### Packaging
|
||||
install(PROGRAMS ${PROJECT_SOURCE_DIR}/scripts/ddl2cpp
|
||||
RENAME sqlpp11-ddl2cpp
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
RENAME sqlpp11-ddl2cpp
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
write_basic_package_version_file(Sqlpp11ConfigVersion.cmake
|
||||
COMPATIBILITY SameMajorVersion
|
||||
ARCH_INDEPENDENT
|
||||
COMPATIBILITY SameMajorVersion
|
||||
ARCH_INDEPENDENT
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Sqlpp11ConfigVersion.cmake
|
||||
DESTINATION ${SQLPP11_INSTALL_CMAKEDIR}
|
||||
DESTINATION ${SQLPP11_INSTALL_CMAKEDIR}
|
||||
)
|
||||
|
||||
install_component(NAME Sqlpp11 TARGETS sqlpp11 DIRECTORY)
|
||||
|
||||
if(BUILD_SQLITE3_CONNECTOR)
|
||||
install_component(NAME Sqlpp11SQLite3 TARGETS sqlpp11_sqlite3 DIRECTORY sqlite3)
|
||||
install_component(NAME Sqlpp11SQLite3 TARGETS sqlpp11_sqlite3 DIRECTORY sqlite3)
|
||||
endif()
|
||||
|
||||
if(BUILD_SQLCIPHER_CONNECTOR)
|
||||
install_component(NAME Sqlpp11SQLCipher TARGETS sqlpp11_sqlcipher DIRECTORY sqlite3)
|
||||
install_component(NAME Sqlpp11SQLCipher TARGETS sqlpp11_sqlcipher DIRECTORY sqlite3)
|
||||
endif()
|
||||
|
||||
if(BUILD_MYSQL_CONNECTOR)
|
||||
install_component(NAME Sqlpp11MySQL TARGETS sqlpp11_mysql DIRECTORY mysql)
|
||||
install_component(NAME Sqlpp11MySQL TARGETS sqlpp11_mysql DIRECTORY mysql)
|
||||
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/cmake/FindMySQL.cmake
|
||||
DESTINATION ${SQLPP11_INSTALL_CMAKEDIR}
|
||||
)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/cmake/FindMySQL.cmake
|
||||
DESTINATION ${SQLPP11_INSTALL_CMAKEDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BUILD_MARIADB_CONNECTOR)
|
||||
install_component(NAME Sqlpp11MariaDB TARGETS sqlpp11_mariadb DIRECTORY mysql)
|
||||
install_component(NAME Sqlpp11MariaDB TARGETS sqlpp11_mariadb DIRECTORY mysql)
|
||||
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/cmake/FindMariaDB.cmake
|
||||
DESTINATION ${SQLPP11_INSTALL_CMAKEDIR}
|
||||
)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/cmake/FindMariaDB.cmake
|
||||
DESTINATION ${SQLPP11_INSTALL_CMAKEDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BUILD_POSTGRESQL_CONNECTOR)
|
||||
install_component(NAME Sqlpp11PostgreSQL TARGETS sqlpp11_postgresql DIRECTORY postgresql)
|
||||
install_component(NAME Sqlpp11PostgreSQL TARGETS sqlpp11_postgresql DIRECTORY postgresql)
|
||||
endif()
|
||||
|
||||
|
||||
### Tests
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
@@ -24,20 +24,20 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if(DEFINED MSVC)
|
||||
find_path(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
find_library(MariaDB_LIBRARY
|
||||
NAMES libmariadb
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
find_path(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
find_library(MariaDB_LIBRARY
|
||||
NAMES libmariadb
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
else()
|
||||
find_path(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATH_SUFFIXES mariadb mysql
|
||||
)
|
||||
find_library(MariaDB_LIBRARY NAMES mariadb)
|
||||
find_path(MariaDB_INCLUDE_DIR
|
||||
NAMES mariadb_version.h
|
||||
PATH_SUFFIXES mariadb mysql
|
||||
)
|
||||
find_library(MariaDB_LIBRARY NAMES mariadb)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
@@ -55,4 +55,4 @@ if(MariaDB_FOUND AND NOT TARGET MariaDB::MariaDB)
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MariaDB_INCLUDE_DIR MariaDB_LIBRARY)
|
||||
mark_as_advanced(MariaDB_INCLUDE_DIR MariaDB_LIBRARY)
|
||||
@@ -24,34 +24,33 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if(DEFINED MSVC)
|
||||
set(SEARCH_PATHS
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.0"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.7"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.6"
|
||||
"$ENV{ProgramFiles\(x86\)}/MySQL/MySQL Server 8.0"
|
||||
"$ENV{ProgramFiles\(x86\)}/MySQL/MySQL Server 5.7"
|
||||
"$ENV{ProgramFiles\(x86\)}/MySQL/MySQL Server 5.6"
|
||||
)
|
||||
find_path(MySQL_INCLUDE_DIR
|
||||
NAMES mysql_version.h
|
||||
PATHS ${SEARCH_PATHS}
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
find_library(MySQL_LIBRARY
|
||||
NAMES libmysql
|
||||
PATHS ${SEARCH_PATHS}
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
set(SEARCH_PATHS
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 8.0"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.7"
|
||||
"$ENV{ProgramFiles}/MySQL/MySQL Server 5.6"
|
||||
"$ENV{ProgramFiles\(x86\)}/MySQL/MySQL Server 8.0"
|
||||
"$ENV{ProgramFiles\(x86\)}/MySQL/MySQL Server 5.7"
|
||||
"$ENV{ProgramFiles\(x86\)}/MySQL/MySQL Server 5.6"
|
||||
)
|
||||
find_path(MySQL_INCLUDE_DIR
|
||||
NAMES mysql_version.h
|
||||
PATHS ${SEARCH_PATHS}
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
find_library(MySQL_LIBRARY
|
||||
NAMES libmysql
|
||||
PATHS ${SEARCH_PATHS}
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
else()
|
||||
find_path(MySQL_INCLUDE_DIR
|
||||
NAMES mysql_version.h
|
||||
PATH_SUFFIXES mysql
|
||||
)
|
||||
find_library(MySQL_LIBRARY
|
||||
NAMES mysqlclient mysqlclient_r
|
||||
PATH_SUFFIXES mysql # for CentOS 7
|
||||
)
|
||||
|
||||
find_path(MySQL_INCLUDE_DIR
|
||||
NAMES mysql_version.h
|
||||
PATH_SUFFIXES mysql
|
||||
)
|
||||
find_library(MySQL_LIBRARY
|
||||
NAMES mysqlclient mysqlclient_r
|
||||
PATH_SUFFIXES mysql # for CentOS 7
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
@@ -69,4 +68,4 @@ if(MySQL_FOUND AND NOT TARGET MySQL::MySQL)
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(MySQL_INCLUDE_DIR MySQL_LIBRARY)
|
||||
mark_as_advanced(MySQL_INCLUDE_DIR MySQL_LIBRARY)
|
||||
@@ -55,15 +55,15 @@ endforeach()
|
||||
|
||||
# Import "ddl2cpp" script
|
||||
if(NOT TARGET sqlpp11::ddl2cpp)
|
||||
get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH)
|
||||
if(NOT EXISTS "${sqlpp11_ddl2cpp_location}")
|
||||
message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.")
|
||||
endif()
|
||||
add_executable(sqlpp11::ddl2cpp IMPORTED)
|
||||
set_target_properties(sqlpp11::ddl2cpp PROPERTIES
|
||||
IMPORTED_LOCATION "${sqlpp11_ddl2cpp_location}"
|
||||
)
|
||||
unset(sqlpp11_ddl2cpp_location)
|
||||
get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH)
|
||||
if(NOT EXISTS "${sqlpp11_ddl2cpp_location}")
|
||||
message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.")
|
||||
endif()
|
||||
add_executable(sqlpp11::ddl2cpp IMPORTED)
|
||||
set_target_properties(sqlpp11::ddl2cpp PROPERTIES
|
||||
IMPORTED_LOCATION "${sqlpp11_ddl2cpp_location}"
|
||||
)
|
||||
unset(sqlpp11_ddl2cpp_location)
|
||||
endif()
|
||||
|
||||
# Resture module path
|
||||
|
||||
2
dependencies/CMakeLists.txt
vendored
2
dependencies/CMakeLists.txt
vendored
@@ -32,4 +32,4 @@ if(NOT USE_SYSTEM_DATE AND NOT TARGET date::date)
|
||||
)
|
||||
|
||||
add_subdirectory(hinnant_date)
|
||||
endif()
|
||||
endif()
|
||||
@@ -25,8 +25,8 @@
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(sqlpp11
|
||||
GIT_REPOSITORY https://github.com/rbock/sqlpp11
|
||||
GIT_TAG origin/main
|
||||
GIT_REPOSITORY https://github.com/rbock/sqlpp11
|
||||
GIT_TAG origin/main
|
||||
)
|
||||
|
||||
add_subdirectory(sqlpp11)
|
||||
add_subdirectory(sqlpp11)
|
||||
@@ -35,4 +35,4 @@ if(BUILD_SQLITE3_CONNECTOR OR BUILD_SQLCIPHER_CONNECTOR)
|
||||
add_subdirectory(sqlite3)
|
||||
endif()
|
||||
|
||||
add_subdirectory(scripts)
|
||||
add_subdirectory(scripts)
|
||||
@@ -25,6 +25,4 @@ add_subdirectory(usage)
|
||||
add_subdirectory(serialize)
|
||||
add_subdirectory(constraints)
|
||||
add_subdirectory(static_asserts)
|
||||
add_subdirectory(types)
|
||||
|
||||
|
||||
add_subdirectory(types)
|
||||
@@ -23,20 +23,20 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
function(test_constraint name pattern)
|
||||
set(test sqlpp11.core.constraints.${name})
|
||||
set(target sqlpp11_${name})
|
||||
add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
add_test(NAME ${test}
|
||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
||||
)
|
||||
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET ${target} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
set(test sqlpp11.core.constraints.${name})
|
||||
set(target sqlpp11_${name})
|
||||
add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
add_test(NAME ${test}
|
||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
||||
)
|
||||
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET ${target} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Compiling these is required to fail (testing some static_assert)
|
||||
@@ -44,5 +44,4 @@ test_constraint(count_of_count "count\\(\\) cannot be used on an aggregate funct
|
||||
test_constraint(max_of_max "max\\(\\) cannot be used on an aggregate function")
|
||||
test_constraint(require_insert "required column is missing")
|
||||
test_constraint(must_not_insert "one assignment is prohibited")
|
||||
test_constraint(must_not_update "one assignment is prohibited")
|
||||
|
||||
test_constraint(must_not_update "one assignment is prohibited")
|
||||
@@ -23,20 +23,20 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
set(test_files
|
||||
As.cpp
|
||||
Blob.cpp
|
||||
CustomQuery.cpp
|
||||
DynamicWhere.cpp
|
||||
ForUpdate.cpp
|
||||
From.cpp
|
||||
In.cpp
|
||||
Insert.cpp
|
||||
Operator.cpp
|
||||
Over.cpp
|
||||
TableAlias.cpp
|
||||
Where.cpp
|
||||
ParameterizedVerbatim.cpp
|
||||
)
|
||||
As.cpp
|
||||
Blob.cpp
|
||||
CustomQuery.cpp
|
||||
DynamicWhere.cpp
|
||||
ForUpdate.cpp
|
||||
From.cpp
|
||||
In.cpp
|
||||
Insert.cpp
|
||||
Operator.cpp
|
||||
Over.cpp
|
||||
TableAlias.cpp
|
||||
Where.cpp
|
||||
ParameterizedVerbatim.cpp
|
||||
)
|
||||
|
||||
create_test_sourcelist(test_sources test_serializer_main.cpp ${test_files})
|
||||
add_executable(sqlpp11_core_serialize ${test_sources})
|
||||
@@ -44,15 +44,14 @@ target_link_libraries(sqlpp11_core_serialize PRIVATE sqlpp11::sqlpp11 sqlpp11_te
|
||||
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_EXTENSIONS no)
|
||||
set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
|
||||
foreach(test_file IN LISTS test_files)
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.core.serialize.${test}
|
||||
COMMAND sqlpp11_core_serialize ${test}
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.core.serialize.${test}
|
||||
COMMAND sqlpp11_core_serialize ${test}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endforeach()
|
||||
@@ -23,15 +23,15 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
function(test_compile name)
|
||||
set(target sqlpp11_assert_${name})
|
||||
add_executable(${target} ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_assert_${name} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_assert_${name} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_assert_${name} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
set(target sqlpp11_assert_${name})
|
||||
add_executable(${target} ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_assert_${name} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_assert_${name} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_assert_${name} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
test_compile(aggregates)
|
||||
@@ -47,5 +47,4 @@ test_compile(date)
|
||||
test_compile(date_time)
|
||||
test_compile(text)
|
||||
test_compile(no_self_compare)
|
||||
test_compile(unwrapped_bool)
|
||||
|
||||
test_compile(unwrapped_bool)
|
||||
@@ -23,16 +23,15 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
function(test_compile name)
|
||||
set(target sqlpp11_${name})
|
||||
add_executable(${target} ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_${name} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_${name} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_${name} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
set(target sqlpp11_${name})
|
||||
add_executable(${target} ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_${name} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_${name} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_${name} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
test_compile(result_row)
|
||||
|
||||
test_compile(result_row)
|
||||
@@ -26,31 +26,31 @@ add_library(sqlpp11_testing INTERFACE)
|
||||
target_include_directories(sqlpp11_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if (NOT MSVC)
|
||||
target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic)
|
||||
target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic)
|
||||
endif ()
|
||||
|
||||
set(test_files
|
||||
BooleanExpression.cpp
|
||||
CustomQuery.cpp
|
||||
DateTime.cpp
|
||||
Interpret.cpp
|
||||
Insert.cpp
|
||||
Remove.cpp
|
||||
Update.cpp
|
||||
Select.cpp
|
||||
SelectType.cpp
|
||||
Function.cpp
|
||||
Prepared.cpp
|
||||
Minimalistic.cpp
|
||||
Result.cpp
|
||||
Union.cpp
|
||||
With.cpp
|
||||
)
|
||||
BooleanExpression.cpp
|
||||
CustomQuery.cpp
|
||||
DateTime.cpp
|
||||
Interpret.cpp
|
||||
Insert.cpp
|
||||
Remove.cpp
|
||||
Update.cpp
|
||||
Select.cpp
|
||||
SelectType.cpp
|
||||
Function.cpp
|
||||
Prepared.cpp
|
||||
Minimalistic.cpp
|
||||
Result.cpp
|
||||
Union.cpp
|
||||
With.cpp
|
||||
)
|
||||
|
||||
find_package(Boost 1.50)
|
||||
if(Boost_FOUND)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
list(APPEND test_files Ppgen.cpp)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
list(APPEND test_files Ppgen.cpp)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -59,15 +59,15 @@ add_executable(sqlpp11_core_tests ${test_sources})
|
||||
target_link_libraries(sqlpp11_core_tests PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_core_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_core_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_core_tests PROPERTY CXX_EXTENSIONS no)
|
||||
set_property(TARGET sqlpp11_core_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_core_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_core_tests PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
|
||||
foreach(test_file IN LISTS test_files)
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.core.usage.${test}
|
||||
COMMAND sqlpp11_core_tests ${test}
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.core.usage.${test}
|
||||
COMMAND sqlpp11_core_tests ${test}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
@@ -77,4 +77,4 @@ endforeach()
|
||||
# OUTPUT "${CMAKE_CURRENT_LIST_DIR}/Sample.h"
|
||||
# COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/scripts/ddl2cpp" "${CMAKE_CURRENT_LIST_DIR}/sample.sql" Sample test
|
||||
# DEPENDS "${CMAKE_CURRENT_LIST_DIR}/sample.sql"
|
||||
# VERBATIM)
|
||||
# VERBATIM)
|
||||
@@ -21,6 +21,5 @@
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
add_subdirectory(usage)
|
||||
|
||||
|
||||
add_subdirectory(usage)
|
||||
@@ -28,18 +28,18 @@ add_library(sqlpp11_mysql_testing INTERFACE)
|
||||
target_include_directories(sqlpp11_mysql_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(test_files
|
||||
Json.cpp
|
||||
CustomQuery.cpp
|
||||
DateTime.cpp
|
||||
Sample.cpp
|
||||
Select.cpp
|
||||
Union.cpp
|
||||
DynamicSelect.cpp
|
||||
MoveConstructor.cpp
|
||||
Prepared.cpp
|
||||
Truncated.cpp
|
||||
Update.cpp
|
||||
Remove.cpp
|
||||
Json.cpp
|
||||
CustomQuery.cpp
|
||||
DateTime.cpp
|
||||
Sample.cpp
|
||||
Select.cpp
|
||||
Union.cpp
|
||||
DynamicSelect.cpp
|
||||
MoveConstructor.cpp
|
||||
Prepared.cpp
|
||||
Truncated.cpp
|
||||
Update.cpp
|
||||
Remove.cpp
|
||||
)
|
||||
|
||||
create_test_sourcelist(test_sources test_main.cpp ${test_files})
|
||||
@@ -52,15 +52,14 @@ endif()
|
||||
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_EXTENSIONS no)
|
||||
set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
|
||||
foreach(test_file IN LISTS test_files)
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.mysql.usage.${test}
|
||||
COMMAND sqlpp11_mysql_tests ${test}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.mysql.usage.${test}
|
||||
COMMAND sqlpp11_mysql_tests ${test}
|
||||
)
|
||||
endforeach()
|
||||
@@ -23,6 +23,4 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
add_subdirectory(constraints)
|
||||
add_subdirectory(usage)
|
||||
|
||||
|
||||
add_subdirectory(usage)
|
||||
@@ -23,20 +23,20 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
function(test_constraint name pattern)
|
||||
set(test sqlpp11.postgresql.constraints.${name})
|
||||
set(target sqlpp11_postgresql_${name})
|
||||
add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::postgresql sqlpp11_testing)
|
||||
add_test(NAME ${test}
|
||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
||||
)
|
||||
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET ${target} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
set(test sqlpp11.postgresql.constraints.${name})
|
||||
set(target sqlpp11_postgresql_${name})
|
||||
add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp)
|
||||
target_link_libraries(${target} PRIVATE sqlpp11::postgresql sqlpp11_testing)
|
||||
add_test(NAME ${test}
|
||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
||||
)
|
||||
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET ${target} PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Compiling these is required to fail (testing some static_assert)
|
||||
@@ -48,5 +48,4 @@ test_constraint(OnConflictMissingAction "either do_nothing\\(\\) or do_update\\(
|
||||
test_constraint(OnConflictMissingAssignmentsDoUpdate "conflict_target specification is required with do_update")
|
||||
test_constraint(OnConflictMissingParameterDoUpdate "conflict_target specification is required with do_update")
|
||||
test_constraint(ReturningEmptyAssert "at least one returnable expression")
|
||||
test_constraint(ReturningInvalidArgument "at least one returning column requires a table which is otherwise not known in the statement")
|
||||
|
||||
test_constraint(ReturningInvalidArgument "at least one returning column requires a table which is otherwise not known in the statement")
|
||||
@@ -27,17 +27,17 @@ add_library(sqlpp11_postgresql_testing INTERFACE)
|
||||
target_include_directories(sqlpp11_postgresql_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(test_files
|
||||
Basic.cpp
|
||||
Blob.cpp
|
||||
Constructor.cpp
|
||||
Date.cpp
|
||||
DateTime.cpp
|
||||
Exceptions.cpp
|
||||
InsertOnConflict.cpp
|
||||
Returning.cpp
|
||||
Select.cpp
|
||||
Transaction.cpp
|
||||
Type.cpp
|
||||
Basic.cpp
|
||||
Blob.cpp
|
||||
Constructor.cpp
|
||||
Date.cpp
|
||||
DateTime.cpp
|
||||
Exceptions.cpp
|
||||
InsertOnConflict.cpp
|
||||
Returning.cpp
|
||||
Select.cpp
|
||||
Transaction.cpp
|
||||
Type.cpp
|
||||
)
|
||||
|
||||
create_test_sourcelist(test_sources test_main.cpp ${test_files})
|
||||
@@ -49,15 +49,14 @@ endif()
|
||||
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_EXTENSIONS no)
|
||||
set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
||||
set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_EXTENSIONS no)
|
||||
endif()
|
||||
|
||||
foreach(test_file IN LISTS test_files)
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.postgresql.usage.${test}
|
||||
COMMAND sqlpp11_postgresql_tests ${test}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.postgresql.usage.${test}
|
||||
COMMAND sqlpp11_postgresql_tests ${test}
|
||||
)
|
||||
endforeach()
|
||||
@@ -25,64 +25,64 @@
|
||||
include(FindPython3)
|
||||
|
||||
if (${Python3_Interpreter_FOUND})
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "import pyparsing"
|
||||
RESULT_VARIABLE PythonRESULT
|
||||
OUTPUT_VARIABLE PythonOUTPUT
|
||||
ERROR_VARIABLE PythonERROR
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${Python3_EXECUTABLE} -c "import pyparsing"
|
||||
RESULT_VARIABLE PythonRESULT
|
||||
OUTPUT_VARIABLE PythonOUTPUT
|
||||
ERROR_VARIABLE PythonERROR
|
||||
)
|
||||
|
||||
if (${PythonRESULT})
|
||||
message(WARNING "Pyparsing is not installed. Disabling ddl2cpp tests")
|
||||
if (${PythonRESULT})
|
||||
message(WARNING "Pyparsing is not installed. Disabling ddl2cpp tests")
|
||||
else()
|
||||
message(STATUS "Pyparsing is installed: Enabling ddl2cpp tests.")
|
||||
|
||||
else()
|
||||
message(STATUS "Pyparsing is installed: Enabling ddl2cpp tests.")
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.parser
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"--test"
|
||||
test)
|
||||
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.parser
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"--test"
|
||||
test)
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.bad_will_fail
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_bad.sql"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fail"
|
||||
test)
|
||||
set_tests_properties(sqlpp11.scripts.ddl2cpp.bad_will_fail PROPERTIES WILL_FAIL 1)
|
||||
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.bad_will_fail
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_bad.sql"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fail"
|
||||
test)
|
||||
set_tests_properties(sqlpp11.scripts.ddl2cpp.bad_will_fail PROPERTIES WILL_FAIL 1)
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.bad_has_parse_error
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_bad.sql"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fail"
|
||||
test)
|
||||
set_tests_properties(sqlpp11.scripts.ddl2cpp.bad_has_parse_error PROPERTIES
|
||||
PASS_REGULAR_EXPRESSION "ERROR: Could not parse.*")
|
||||
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.bad_has_parse_error
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_bad.sql"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fail"
|
||||
test)
|
||||
set_tests_properties(sqlpp11.scripts.ddl2cpp.bad_has_parse_error PROPERTIES PASS_REGULAR_EXPRESSION "ERROR: Could not parse.*")
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.good_succeeds
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fail"
|
||||
test)
|
||||
|
||||
add_test(NAME sqlpp11.scripts.ddl2cpp.good_succeeds
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/fail"
|
||||
test)
|
||||
foreach(sample_name sample sample_identity_naming)
|
||||
set(sqlpp.scripts.generated.sample.include "${CMAKE_CURRENT_BINARY_DIR}/${sample_name}")
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(use_identity_naming)
|
||||
if(sample_name STREQUAL "sample_identity_naming")
|
||||
set(use_identity_naming -identity-naming)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT "${sqlpp.scripts.generated.sample.include}.h"
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
${use_identity_naming}
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
|
||||
"${sqlpp.scripts.generated.sample.include}"
|
||||
test
|
||||
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
|
||||
VERBATIM)
|
||||
|
||||
foreach(sample_name sample sample_identity_naming)
|
||||
set(sqlpp.scripts.generated.sample.include "${CMAKE_CURRENT_BINARY_DIR}/${sample_name}")
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(use_identity_naming)
|
||||
if(sample_name STREQUAL "sample_identity_naming")
|
||||
set(use_identity_naming -identity-naming)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT "${sqlpp.scripts.generated.sample.include}.h"
|
||||
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_LIST_DIR}/../../scripts/ddl2cpp"
|
||||
${use_identity_naming}
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
|
||||
"${sqlpp.scripts.generated.sample.include}"
|
||||
test
|
||||
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/ddl2cpp_sample_good.sql"
|
||||
VERBATIM)
|
||||
|
||||
add_executable(sqlpp.scripts.compiled.${sample_name} ${sample_name}.cpp "${sqlpp.scripts.generated.sample.include}.h")
|
||||
target_link_libraries(sqlpp.scripts.compiled.${sample_name} PRIVATE sqlpp11)
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
add_executable(sqlpp.scripts.compiled.${sample_name} ${sample_name}.cpp
|
||||
"${sqlpp.scripts.generated.sample.include}.h")
|
||||
target_link_libraries(sqlpp.scripts.compiled.${sample_name} PRIVATE sqlpp11)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
@@ -21,6 +21,5 @@
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
add_subdirectory(usage)
|
||||
|
||||
|
||||
add_subdirectory(usage)
|
||||
@@ -26,19 +26,19 @@ add_library(sqlpp11_sqlite3_testing INTERFACE)
|
||||
target_include_directories(sqlpp11_sqlite3_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(test_files
|
||||
DateTime.cpp
|
||||
Sample.cpp
|
||||
Select.cpp
|
||||
Union.cpp
|
||||
With.cpp
|
||||
Attach.cpp
|
||||
DynamicSelect.cpp
|
||||
AutoIncrement.cpp
|
||||
Transaction.cpp
|
||||
FloatingPoint.cpp
|
||||
Integral.cpp
|
||||
Blob.cpp
|
||||
)
|
||||
DateTime.cpp
|
||||
Sample.cpp
|
||||
Select.cpp
|
||||
Union.cpp
|
||||
With.cpp
|
||||
Attach.cpp
|
||||
DynamicSelect.cpp
|
||||
AutoIncrement.cpp
|
||||
Transaction.cpp
|
||||
FloatingPoint.cpp
|
||||
Integral.cpp
|
||||
Blob.cpp
|
||||
)
|
||||
|
||||
create_test_sourcelist(test_sources test_main.cpp ${test_files})
|
||||
|
||||
@@ -55,16 +55,16 @@ endif()
|
||||
|
||||
# conditionally bump to a higher C++ standard to test compatibility
|
||||
if (SQLPP11_TESTS_CXX_STD)
|
||||
set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_EXTENSIONS OFF)
|
||||
set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
||||
set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
foreach(test_file IN LISTS test_files)
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.sqlite3.usage.${test}
|
||||
COMMAND sqlpp11_sqlite3_tests ${test}
|
||||
)
|
||||
get_filename_component(test ${test_file} NAME_WLE)
|
||||
add_test(NAME sqlpp11.sqlite3.usage.${test}
|
||||
COMMAND sqlpp11_sqlite3_tests ${test}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# the dynamic loading test needs the extra option "SQLPP_DYNAMIC_LOADING" and does NOT link the sqlite libs
|
||||
@@ -76,4 +76,4 @@ if (SQLPP_DYNAMIC_LOADING)
|
||||
target_compile_options(Sqlpp11Sqlite3DynamicLoadingTest INTERFACE -Wall -Wextra -pedantic)
|
||||
endif ()
|
||||
add_test(NAME Sqlpp11Sqlite3DynamicLoadingTest COMMAND Sqlpp11Sqlite3DynamicLoadingTest)
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user