mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 12:51:13 +08:00
Remove option to compile tests with different standard
The library is header only. It makes no sense to distinuish between the standard the library is compiled with and the standard the tests are compiled with. The library does not get compiled on its own.
This commit is contained in:
parent
a7ee6e5d3b
commit
4a9f9c384c
@ -27,12 +27,6 @@ function(test_compile name)
|
|||||||
set(target sqlpp11_compat_${name})
|
set(target sqlpp11_compat_${name})
|
||||||
add_executable(${target} ${name}.cpp)
|
add_executable(${target} ${name}.cpp)
|
||||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
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_compat_${name} PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
|
||||||
set_property(TARGET sqlpp11_compat_${name} PROPERTY CXX_STANDARD_REQUIRED yes)
|
|
||||||
set_property(TARGET sqlpp11_compat_${name} PROPERTY CXX_EXTENSIONS no)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
test_compile(make_unique)
|
test_compile(make_unique)
|
||||||
|
@ -31,12 +31,6 @@ function(test_constraint name pattern)
|
|||||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
||||||
)
|
)
|
||||||
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
|
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()
|
endfunction()
|
||||||
|
|
||||||
# Compiling these is required to fail (testing some static_assert)
|
# Compiling these is required to fail (testing some static_assert)
|
||||||
|
@ -60,13 +60,6 @@ create_test_sourcelist(test_sources test_serializer_main.cpp ${test_files})
|
|||||||
add_executable(sqlpp11_core_serialize ${test_sources})
|
add_executable(sqlpp11_core_serialize ${test_sources})
|
||||||
target_link_libraries(sqlpp11_core_serialize PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
target_link_libraries(sqlpp11_core_serialize 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_serialize PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
|
||||||
set_property(TARGET sqlpp11_core_serialize PROPERTY CXX_STANDARD_REQUIRED yes)
|
|
||||||
set_property(TARGET sqlpp11_core_serialize PROPERTY CXX_EXTENSIONS no)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.core.serialize.${test}
|
add_test(NAME sqlpp11.core.serialize.${test}
|
||||||
|
@ -26,12 +26,6 @@ function(test_compile name)
|
|||||||
set(target sqlpp11_assert_${name})
|
set(target sqlpp11_assert_${name})
|
||||||
add_executable(${target} ${name}.cpp)
|
add_executable(${target} ${name}.cpp)
|
||||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
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()
|
endfunction()
|
||||||
|
|
||||||
test_compile(aggregates)
|
test_compile(aggregates)
|
||||||
|
@ -27,11 +27,6 @@ function(test_compile name)
|
|||||||
add_executable(${target} ${name}.cpp)
|
add_executable(${target} ${name}.cpp)
|
||||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
||||||
# conditionally bump to a higher C++ standard to test compatibility
|
# 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()
|
endfunction()
|
||||||
|
|
||||||
add_subdirectory(operator)
|
add_subdirectory(operator)
|
||||||
|
@ -23,15 +23,9 @@
|
|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
function(test_compile name)
|
function(test_compile name)
|
||||||
set(target sqlpp11_${name})
|
set(target sqlpp11_types_operator_${name})
|
||||||
add_executable(${target} ${name}.cpp)
|
add_executable(${target} ${name}.cpp)
|
||||||
target_link_libraries(${target} PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
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()
|
endfunction()
|
||||||
|
|
||||||
test_compile(any)
|
test_compile(any)
|
||||||
|
@ -57,12 +57,6 @@ endif()
|
|||||||
create_test_sourcelist(test_sources test_main.cpp ${test_files})
|
create_test_sourcelist(test_sources test_main.cpp ${test_files})
|
||||||
add_executable(sqlpp11_core_tests ${test_sources})
|
add_executable(sqlpp11_core_tests ${test_sources})
|
||||||
target_link_libraries(sqlpp11_core_tests PRIVATE sqlpp11::sqlpp11 sqlpp11_testing)
|
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)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
|
@ -36,13 +36,6 @@ if(NOT MSVC)
|
|||||||
target_compile_options(sqlpp11_mysql_serialize_tests PRIVATE -Wall -Wextra -pedantic)
|
target_compile_options(sqlpp11_mysql_serialize_tests PRIVATE -Wall -Wextra -pedantic)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# conditionally bump to a higher C++ standard to test compatibility
|
|
||||||
if (SQLPP11_TESTS_CXX_STD)
|
|
||||||
set_property(TARGET sqlpp11_mysql_serialize_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
|
||||||
set_property(TARGET sqlpp11_mysql_serialize_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
|
||||||
set_property(TARGET sqlpp11_mysql_serialize_tests PROPERTY CXX_EXTENSIONS no)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.mysql.serialize.${test}
|
add_test(NAME sqlpp11.mysql.serialize.${test}
|
||||||
|
@ -52,13 +52,6 @@ if(NOT MSVC)
|
|||||||
target_compile_options(sqlpp11_mysql_tests PRIVATE -Wall -Wextra -pedantic)
|
target_compile_options(sqlpp11_mysql_tests PRIVATE -Wall -Wextra -pedantic)
|
||||||
endif()
|
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)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.mysql.usage.${test}
|
add_test(NAME sqlpp11.mysql.usage.${test}
|
||||||
|
@ -31,12 +31,6 @@ function(test_constraint name pattern)
|
|||||||
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}
|
||||||
)
|
)
|
||||||
set_property(TEST ${test} PROPERTY PASS_REGULAR_EXPRESSION ${pattern})
|
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()
|
endfunction()
|
||||||
|
|
||||||
# Compiling these is required to fail (testing some static_assert)
|
# Compiling these is required to fail (testing some static_assert)
|
||||||
|
@ -33,13 +33,6 @@ if(NOT MSVC)
|
|||||||
target_compile_options(sqlpp11_postgresql_serialize_tests PRIVATE -Wall -Wextra -pedantic)
|
target_compile_options(sqlpp11_postgresql_serialize_tests PRIVATE -Wall -Wextra -pedantic)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# conditionally bump to a higher C++ standard to test compatibility
|
|
||||||
if (SQLPP11_TESTS_CXX_STD)
|
|
||||||
set_property(TARGET sqlpp11_postgresql_serialize_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
|
||||||
set_property(TARGET sqlpp11_postgresql_serialize_tests PROPERTY CXX_STANDARD_REQUIRED yes)
|
|
||||||
set_property(TARGET sqlpp11_postgresql_serialize_tests PROPERTY CXX_EXTENSIONS no)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.postgresql.serialize.${test}
|
add_test(NAME sqlpp11.postgresql.serialize.${test}
|
||||||
|
@ -50,13 +50,6 @@ if(NOT MSVC)
|
|||||||
target_compile_options(sqlpp11_postgresql_tests PRIVATE -Wall -Wextra -pedantic)
|
target_compile_options(sqlpp11_postgresql_tests PRIVATE -Wall -Wextra -pedantic)
|
||||||
endif()
|
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)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.postgresql.usage.${test}
|
add_test(NAME sqlpp11.postgresql.usage.${test}
|
||||||
|
@ -39,13 +39,6 @@ else()
|
|||||||
target_link_libraries(sqlpp11_sqlite3_serialize_tests PRIVATE sqlpp11::sqlite3)
|
target_link_libraries(sqlpp11_sqlite3_serialize_tests PRIVATE sqlpp11::sqlite3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# conditionally bump to a higher C++ standard to test compatibility
|
|
||||||
if (SQLPP11_TESTS_CXX_STD)
|
|
||||||
set_property(TARGET sqlpp11_sqlite3_serialize_tests PROPERTY CXX_STANDARD ${SQLPP11_TESTS_CXX_STD})
|
|
||||||
set_property(TARGET sqlpp11_sqlite3_serialize_tests PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
||||||
set_property(TARGET sqlpp11_sqlite3_serialize_tests PROPERTY CXX_EXTENSIONS OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.sqlite3.serialize.${test}
|
add_test(NAME sqlpp11.sqlite3.serialize.${test}
|
||||||
|
@ -56,13 +56,6 @@ else()
|
|||||||
target_link_libraries(sqlpp11_sqlite3_tests PRIVATE sqlpp11::sqlite3)
|
target_link_libraries(sqlpp11_sqlite3_tests PRIVATE sqlpp11::sqlite3)
|
||||||
endif()
|
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)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(test_file IN LISTS test_files)
|
foreach(test_file IN LISTS test_files)
|
||||||
get_filename_component(test ${test_file} NAME_WLE)
|
get_filename_component(test ${test_file} NAME_WLE)
|
||||||
add_test(NAME sqlpp11.sqlite3.usage.${test}
|
add_test(NAME sqlpp11.sqlite3.usage.${test}
|
||||||
|
Loading…
Reference in New Issue
Block a user