mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-06 13:10:34 -06:00
style: Align CMake files with 4 spaces indent
This commit is contained in:
@@ -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