diff --git a/.travis.yml b/.travis.yml index 24420177..4b221096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,39 +2,46 @@ language: cpp os: - linux + - osx compiler: - # - clang # disabled clang due to missing libc++ + - clang - gcc +env: + - CONFIG=Release + - CONFIG=Debug + notifications: email: on_success: change on_failure: always -before_install: - # install boost 1.50 (headers only), travis currently offers 1.46 and 1.48 - - wget http://sourceforge.net/projects/boost/files/boost/1.50.0/boost_1_50_0.tar.bz2/download -O /tmp/boost.tar.bz2 - - mkdir -p temp - - cd temp - - tar jxf /tmp/boost.tar.bz2 boost_1_50_0/boost # extract headers only - - sudo mkdir -p /usr/local/include/ - - sudo ln -s $PWD/boost_1_50_0/boost /usr/local/include - - cd .. - #install g++-4.8 - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - - sudo apt-get update - - if [ "$CXX" = "g++" ]; then sudo apt-get install g++-4.8; fi - - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - install: - - "mkdir -p $TRAVIS_BUILD_DIR/build/scripts" - - "cd $TRAVIS_BUILD_DIR/build/scripts" - - "cmake $TRAVIS_BUILD_DIR" + - CMAKE_VERSION_MM=3.2 + - CMAKE_VERSION_FULL=$CMAKE_VERSION_MM.2 + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + && sudo add-apt-repository -y ppa:apokluda/boost1.53 + && sudo apt-get update -qq + && sudo apt-get install -qq g++-4.8 libboost1.53-dev --no-install-recommends + && sudo update-alternatives --quiet --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.6 + && sudo update-alternatives --quiet --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.8 + && sudo update-alternatives --quiet --set gcc /usr/bin/gcc-4.8 + && wget http://www.cmake.org/files/v${CMAKE_VERSION_MM}/cmake-${CMAKE_VERSION_FULL}-Linux-x86_64.sh + && sudo sh cmake-${CMAKE_VERSION_FULL}-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; + fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install boost cmake; fi + +before_script: + - mkdir build + - cd build + - if [[ "$CXX" = "g++" && "$CONFIG" = "Debug" ]]; then export CXXFLAGS="--coverage"; fi + - cmake .. -DCMAKE_BUILD_TYPE=$CONFIG script: - - "cd $TRAVIS_BUILD_DIR/build/scripts" - - "make -j3" - # test compile-time constraints - - "make test_sqlpp_constraints" + - cmake --build . --config $CONFIG + - ctest --output-on-failure +after_script: + - ../coveralls diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f5266c2..5ceae772 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,25 +22,21 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +project(sqlpp11 VERSION 0.1 LANGUAGES CXX) -# Cygwin does not define WIN32 and warn if not use with this flag -set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required - -project (sqlpp11) enable_testing() -message(STATUS "Using ${CMAKE_CXX_COMPILER} (compiler id: ${CMAKE_CXX_COMPILER_ID})") -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall ${CMAKE_CXX_FLAGS}") -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "-std=c++11 -Wall ${CMAKE_CXX_FLAGS}") -endif () -set(CMAKE_CXX_FLAGS "-Wconversion -Wpedantic -Wshadow ${CMAKE_CXX_FLAGS}") +add_library(sqlpp11 INTERFACE) + +target_include_directories(sqlpp11 INTERFACE + $ + ) + +target_compile_features(sqlpp11 INTERFACE + cxx_variadic_templates + ) -set(include_dir "${PROJECT_SOURCE_DIR}/include") -file(GLOB_RECURSE sqlpp_headers "${include_dir}/*.h") -include_directories("${include_dir}") add_subdirectory(tests) add_subdirectory(test_constraints) add_subdirectory(examples) diff --git a/CREDITS b/CREDITS index 3675cef0..fdfc9b58 100644 --- a/CREDITS +++ b/CREDITS @@ -3,14 +3,15 @@ Credits: This library evolved through several stages and would probably not exist without input from other people: * Michael Gmelin: Interface and requirements discussions - * Paul Körbitz: Feedback and extensions - * Peter Knoblach: Initial ideas - * Ulrich Küttler: Feedback and extensions + * Paul Körbitz: Feedback and extensions + * Peter Knoblach: Initial ideas + * Ulrich Küttler: Feedback and extensions + * Daniel Pfeifer: Buildsystem, Travis, Coveralls - * Metafeed GmbH: Production code using a forerunner version - * PPRO Financial Ltd: Production code using sqlpp11 and a forerunner version - * The boost community: Invaluable suggestions and critiques + * Metafeed GmbH: Production code using a forerunner version + * PPRO Financial Ltd: Production code using sqlpp11 and a forerunner version + * The boost community: Invaluable suggestions and critiques * Meeting C++ Munich: Hosted the first talk about sqlpp11 diff --git a/README.md b/README.md index 7e3020ed..57411d8f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ sqlpp11 ======= +[![Build Status](https://travis-ci.org/purpleKarrot/sqlpp11.svg?branch=develop)](https://travis-ci.org/purpleKarrot/sqlpp11) +[![Coverage Status](https://coveralls.io/repos/purpleKarrot/sqlpp11/badge.svg?branch=develop)](https://coveralls.io/r/purpleKarrot/sqlpp11?branch=develop) + A type safe embedded domain specific language for SQL queries and results in C++ Extensive documentation is found in the wiki, https://github.com/rbock/sqlpp11/wiki diff --git a/coveralls b/coveralls new file mode 100755 index 00000000..301d67f7 --- /dev/null +++ b/coveralls @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ 0 -eq $(find -iname *.gcda | wc -l) ] +then + exit 0 +fi + +gcov --source-prefix ${TRAVIS_BUILD_DIR} --preserve-paths --relative-only $(find -iname *.gcda) 1>/dev/null || exit 0 + +cat >coverage.json <>coverage.json <coverage.json <(head -n -1 coverage.json.tmp) <(echo -e " }\n ]\n}") +curl -F json_file=@coverage.json https://coveralls.io/api/v1/jobs diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 33b8e65f..3f6e46b5 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,23 +1,50 @@ +# Copyright (c) 2013-2015, Roland Bock +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# 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. -macro (build arg) - # Add headers to sources to enable file browsing in IDEs - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../tests") - add_executable("Sqlpp11Example${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_SOURCE_DIR}/../tests/MockDb.h" "${CMAKE_CURRENT_LIST_DIR}/Sample.h") - add_test("${arg}" "Sqlpp11Example${arg}") -endmacro () +set(example_names + #sample + insert + update + remove + select + ) -#build(sample) -build(insert) -build(update) -build(remove) -build(select) find_package(Boost 1.50) if(Boost_FOUND) - MESSAGE(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) - build(ppgen) + list(APPEND example_names ppgen) endif() +create_test_sourcelist(example_sources example_main.cpp ${example_names}) +add_executable(sqlpp11_examples ${example_sources}) +target_link_libraries(sqlpp11_examples PRIVATE sqlpp11 sqlpp11_testing) + +foreach(example IN LISTS example_names) + add_test(NAME sqlpp11.examples.${example} + COMMAND sqlpp11_examples ${example} + ) +endforeach() #find_package(PythonInterp REQUIRED) diff --git a/examples/insert.cpp b/examples/insert.cpp index 2cf32f68..6aa85f9c 100644 --- a/examples/insert.cpp +++ b/examples/insert.cpp @@ -27,7 +27,7 @@ #include "MockDb.h" #include -int main() +int insert(int, char**) { MockDb db; @@ -64,4 +64,5 @@ int main() pi.params.feature = true; db(pi); + return 0; } diff --git a/examples/ppgen.cpp b/examples/ppgen.cpp index d865f4e8..48ca5610 100644 --- a/examples/ppgen.cpp +++ b/examples/ppgen.cpp @@ -61,7 +61,7 @@ SQLPP_DECLARE_TABLE( (fatal, bool , SQLPP_NOT_NULL ) ) -int main() +int ppgen(int, char**) { MockDb db; tab_person::tab_person p; @@ -97,4 +97,5 @@ int main() pi.params.feature = true; db(pi); + return 0; } diff --git a/examples/remove.cpp b/examples/remove.cpp index 8bec39c3..3788e7e8 100644 --- a/examples/remove.cpp +++ b/examples/remove.cpp @@ -27,7 +27,7 @@ #include "MockDb.h" #include -int main() +int remove(int, char**) { MockDb db; @@ -37,4 +37,5 @@ int main() db(remove_from(p) .using_(p, q) .where(p.feature == q.id and q.fatal == true)); + return 0; } diff --git a/examples/select.cpp b/examples/select.cpp index 10d756bb..8607f7a1 100644 --- a/examples/select.cpp +++ b/examples/select.cpp @@ -36,7 +36,7 @@ SQLPP_ALIAS_PROVIDER(cheesecake) -int main() +int select(int, char**) { static constexpr bool some_condition = true; static constexpr bool some_other_condition = false; @@ -153,4 +153,5 @@ int main() + return 0; } diff --git a/examples/update.cpp b/examples/update.cpp index e9bad556..ed3de0a2 100644 --- a/examples/update.cpp +++ b/examples/update.cpp @@ -27,7 +27,7 @@ #include "MockDb.h" #include -int main() +int update(int, char**) { MockDb db; @@ -35,4 +35,5 @@ int main() //test::TabFeature q; db(update(p).set(p.feature = 7).where(p.id == 23)); + return 0; } diff --git a/test_constraints/CMakeLists.txt b/test_constraints/CMakeLists.txt index 20e699d9..87e7d197 100644 --- a/test_constraints/CMakeLists.txt +++ b/test_constraints/CMakeLists.txt @@ -1,31 +1,40 @@ -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../tests") - -add_custom_target(test_sqlpp_constraints COMMAND true) +# Copyright (c) 2013-2015, Roland Bock +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# 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. function(test_constraint name pattern) + set(test sqlpp11.test_constraints.${name}) + set(target sqlpp11_${name}) + add_executable(${target} EXCLUDE_FROM_ALL ${name}.cpp) + target_link_libraries(${target} PRIVATE 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}) +endfunction() - add_executable( - "${name}" - EXCLUDE_FROM_ALL - "${name}.cpp" - ) - - add_custom_command(OUTPUT "${name}.out" - COMMAND "${CMAKE_MAKE_PROGRAM}" "${name}" > "${CMAKE_CURRENT_BINARY_DIR}/${name}.out" 2>&1 || true - COMMAND grep "${pattern}" "${CMAKE_CURRENT_BINARY_DIR}/${name}.out" > /dev/null - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp" - COMMENT "${name}" - VERBATIM) - - add_custom_target("test_${name}" DEPENDS "${name}.out" COMMAND true) - - - add_dependencies(test_sqlpp_constraints "test_${name}") - -endfunction(test_constraint) - -test_constraint(count_of_count "count() cannot be used on an aggregate function") -test_constraint(max_of_max "max() cannot be used on an aggregate function") +test_constraint(count_of_count "count\\(\\) cannot be used on an aggregate function") +test_constraint(max_of_max "max\\(\\) cannot be used on an aggregate function") test_constraint(no_conversion_operator_if_null_not_trivial "int i = row.alpha") test_constraint(require_insert "required column is missing") test_constraint(must_not_insert "one assignment is prohibited") diff --git a/tests/BooleanExpressionTest.cpp b/tests/BooleanExpression.cpp similarity index 98% rename from tests/BooleanExpressionTest.cpp rename to tests/BooleanExpression.cpp index c8b5c20e..5f55d2e3 100644 --- a/tests/BooleanExpressionTest.cpp +++ b/tests/BooleanExpression.cpp @@ -29,7 +29,7 @@ #include -int main() +int BooleanExpression(int, char**) { MockDb db = {}; test::TabBar t; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4461ce0d..669b2b9f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,25 +1,57 @@ +# Copyright (c) 2013-2015, Roland Bock +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# 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. -macro (build_and_run arg) - # Add headers to sources to enable file browsing in IDEs - include_directories("${CMAKE_BINARY_DIR}/tests") - add_executable("${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_LIST_DIR}/Sample.h") - add_test("${arg}" "${CMAKE_BINARY_DIR}/tests/${arg}") -endmacro () +add_library(sqlpp11_testing INTERFACE) +target_include_directories(sqlpp11_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic) -build_and_run(BooleanExpressionTest) -build_and_run(CustomQueryTest) -build_and_run(InterpretTest) -build_and_run(InsertTest) -build_and_run(RemoveTest) -build_and_run(UpdateTest) -build_and_run(SelectTest) -build_and_run(SelectTypeTest) -build_and_run(FunctionTest) -build_and_run(PreparedTest) -build_and_run(Minimalistic) -build_and_run(ResultTest) -build_and_run(UnionTest) -build_and_run(WithTest) +set(test_names + BooleanExpression + CustomQuery + Interpret + Insert + Remove + Update + Select + SelectType + Function + Prepared + Minimalistic + Result + Union + With + ) + +create_test_sourcelist(test_sources test_main.cpp ${test_names}) +add_executable(sqlpp11_tests ${test_sources}) +target_link_libraries(sqlpp11_tests PRIVATE sqlpp11 sqlpp11_testing) + +foreach(test IN LISTS test_names) + add_test(NAME sqlpp11.tests.${test} + COMMAND sqlpp11_tests ${test} + ) +endforeach() # if you want to use the generator, you can do something like this: #find_package(PythonInterp REQUIRED) diff --git a/tests/CustomQueryTest.cpp b/tests/CustomQuery.cpp similarity index 98% rename from tests/CustomQueryTest.cpp rename to tests/CustomQuery.cpp index 73ef6b77..f8781145 100644 --- a/tests/CustomQueryTest.cpp +++ b/tests/CustomQuery.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int CustomQuery(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/FunctionTest.cpp b/tests/Function.cpp similarity index 99% rename from tests/FunctionTest.cpp rename to tests/Function.cpp index 8d694c83..a899a40d 100644 --- a/tests/FunctionTest.cpp +++ b/tests/Function.cpp @@ -34,7 +34,7 @@ SQLPP_ALIAS_PROVIDER(kaesekuchen) -int main() +int Function(int, char**) { MockDb db = {}; test::TabFoo f; diff --git a/tests/InsertTest.cpp b/tests/Insert.cpp similarity index 99% rename from tests/InsertTest.cpp rename to tests/Insert.cpp index 5f7e849a..76dafa4b 100644 --- a/tests/InsertTest.cpp +++ b/tests/Insert.cpp @@ -31,7 +31,7 @@ #include -int main() +int Insert(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/InterpretTest.cpp b/tests/Interpret.cpp similarity index 99% rename from tests/InterpretTest.cpp rename to tests/Interpret.cpp index 715e2822..d2a597f6 100644 --- a/tests/InterpretTest.cpp +++ b/tests/Interpret.cpp @@ -29,7 +29,7 @@ #include -int main() +int Interpret(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/Minimalistic.cpp b/tests/Minimalistic.cpp index c30384c0..78b086a5 100644 --- a/tests/Minimalistic.cpp +++ b/tests/Minimalistic.cpp @@ -1,5 +1,6 @@ #include -int main() +int Minimalistic(int, char**) { + return 0; } diff --git a/tests/PreparedTest.cpp b/tests/Prepared.cpp similarity index 99% rename from tests/PreparedTest.cpp rename to tests/Prepared.cpp index 4e391a53..af5eadfd 100644 --- a/tests/PreparedTest.cpp +++ b/tests/Prepared.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int Prepared(int, char**) { MockDb db = {}; //test::TabFoo f; diff --git a/tests/RemoveTest.cpp b/tests/Remove.cpp similarity index 99% rename from tests/RemoveTest.cpp rename to tests/Remove.cpp index 4fe220d9..e8092462 100644 --- a/tests/RemoveTest.cpp +++ b/tests/Remove.cpp @@ -30,7 +30,7 @@ #include "is_regular.h" -int main() +int Remove(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/ResultTest.cpp b/tests/Result.cpp similarity index 99% rename from tests/ResultTest.cpp rename to tests/Result.cpp index daa918df..3bee2429 100644 --- a/tests/ResultTest.cpp +++ b/tests/Result.cpp @@ -32,7 +32,7 @@ static_assert(not sqlpp::enforce_null_result_treatment_t::value, "MockDb interprets NULL as trivial"); static_assert(sqlpp::enforce_null_result_treatment_t::value, "MockDb does not interpret NULL as trivial"); -int main() +int Result(int, char**) { MockDb db = {}; EnforceDb edb {}; diff --git a/tests/SelectTest.cpp b/tests/Select.cpp similarity index 99% rename from tests/SelectTest.cpp rename to tests/Select.cpp index 8d82c1b2..460a85b3 100644 --- a/tests/SelectTest.cpp +++ b/tests/Select.cpp @@ -43,7 +43,7 @@ int64_t getColumn(Db&& db, const Column& column) return 0; } -int main() +int Select(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/SelectTypeTest.cpp b/tests/SelectType.cpp similarity index 99% rename from tests/SelectTypeTest.cpp rename to tests/SelectType.cpp index 67b3f689..4afc20b7 100644 --- a/tests/SelectTypeTest.cpp +++ b/tests/SelectType.cpp @@ -41,7 +41,7 @@ namespace alias SQLPP_ALIAS_PROVIDER(right) } -int main() +int SelectType(int, char**) { MockDb db = {}; MockDb::_serializer_context_t printer; diff --git a/tests/UnionTest.cpp b/tests/Union.cpp similarity index 99% rename from tests/UnionTest.cpp rename to tests/Union.cpp index 4a3d54ad..caa7f9ff 100644 --- a/tests/UnionTest.cpp +++ b/tests/Union.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int Union(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/UpdateTest.cpp b/tests/Update.cpp similarity index 99% rename from tests/UpdateTest.cpp rename to tests/Update.cpp index 4cc7f455..da93415a 100644 --- a/tests/UpdateTest.cpp +++ b/tests/Update.cpp @@ -29,7 +29,7 @@ #include "MockDb.h" #include "is_regular.h" -int main() +int Update(int, char**) { MockDb db; MockDb::_serializer_context_t printer; diff --git a/tests/WithTest.cpp b/tests/With.cpp similarity index 98% rename from tests/WithTest.cpp rename to tests/With.cpp index cde6b262..5c251293 100644 --- a/tests/WithTest.cpp +++ b/tests/With.cpp @@ -29,7 +29,7 @@ #include #include -int main() +int With(int, char**) { MockDb db; MockDb::_serializer_context_t printer;