mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
build a combined executable for all tests
This commit is contained in:
parent
036d63e6cf
commit
b99e2f653b
@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
|
||||
int main()
|
||||
int BooleanExpression(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
test::TabBar t;
|
||||
|
@ -1,25 +1,52 @@
|
||||
# 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 ()
|
||||
set(test_names
|
||||
BooleanExpression
|
||||
CustomQuery
|
||||
Interpret
|
||||
Insert
|
||||
Remove
|
||||
Update
|
||||
Select
|
||||
SelectType
|
||||
Function
|
||||
Prepared
|
||||
Minimalistic
|
||||
Result
|
||||
Union
|
||||
With
|
||||
)
|
||||
|
||||
build_and_run(BooleanExpression)
|
||||
build_and_run(CustomQuery)
|
||||
build_and_run(Interpret)
|
||||
build_and_run(Insert)
|
||||
build_and_run(Remove)
|
||||
build_and_run(Update)
|
||||
build_and_run(Select)
|
||||
build_and_run(SelectType)
|
||||
build_and_run(Function)
|
||||
build_and_run(Prepared)
|
||||
build_and_run(Minimalistic)
|
||||
build_and_run(Result)
|
||||
build_and_run(Union)
|
||||
build_and_run(With)
|
||||
create_test_sourcelist(test_sources test_main.cpp ${test_names})
|
||||
add_executable(sqlpp11_tests ${test_sources})
|
||||
|
||||
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)
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
#include <sqlpp11/custom_query.h>
|
||||
|
||||
int main()
|
||||
int CustomQuery(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
SQLPP_ALIAS_PROVIDER(kaesekuchen)
|
||||
|
||||
int main()
|
||||
int Function(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
test::TabFoo f;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
int main()
|
||||
int Insert(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
int Interpret(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
int main()
|
||||
int Minimalistic(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/functions.h>
|
||||
#include <sqlpp11/select.h>
|
||||
|
||||
int main()
|
||||
int Prepared(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
//test::TabFoo f;
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "is_regular.h"
|
||||
|
||||
|
||||
int main()
|
||||
int Remove(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -32,7 +32,7 @@
|
||||
static_assert(not sqlpp::enforce_null_result_treatment_t<MockDb>::value, "MockDb interprets NULL as trivial");
|
||||
static_assert(sqlpp::enforce_null_result_treatment_t<EnforceDb>::value, "MockDb does not interpret NULL as trivial");
|
||||
|
||||
int main()
|
||||
int Result(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
EnforceDb edb {};
|
||||
|
@ -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;
|
||||
|
@ -41,7 +41,7 @@ namespace alias
|
||||
SQLPP_ALIAS_PROVIDER(right)
|
||||
}
|
||||
|
||||
int main()
|
||||
int SelectType(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/alias_provider.h>
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
int Union(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "MockDb.h"
|
||||
#include "is_regular.h"
|
||||
|
||||
int main()
|
||||
int Update(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <sqlpp11/alias_provider.h>
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
int With(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
|
Loading…
Reference in New Issue
Block a user