2014-01-29 03:53:22 +08:00
|
|
|
|
2013-08-15 19:26:09 +08:00
|
|
|
macro (build_and_run arg)
|
2014-01-19 05:21:20 +08:00
|
|
|
# Add headers to sources to enable file browsing in IDEs
|
2014-09-02 01:17:03 +08:00
|
|
|
include_directories("${CMAKE_BINARY_DIR}/tests")
|
|
|
|
add_executable("${arg}" "${arg}.cpp" ${sqlpp_headers} "${CMAKE_CURRENT_LIST_DIR}/Sample.h")
|
|
|
|
add_test("${arg}" "${arg}")
|
2013-08-15 19:26:09 +08:00
|
|
|
endmacro ()
|
|
|
|
|
2014-08-02 15:18:01 +08:00
|
|
|
build_and_run(BooleanExpressionTest)
|
2014-06-14 23:57:12 +08:00
|
|
|
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)
|
2014-06-14 23:44:22 +08:00
|
|
|
build_and_run(PreparedTest)
|
2014-06-22 22:09:19 +08:00
|
|
|
build_and_run(Minimalistic)
|
2014-07-28 01:40:31 +08:00
|
|
|
build_and_run(ResultTest)
|
2013-08-15 19:26:09 +08:00
|
|
|
|
2014-07-20 17:14:44 +08:00
|
|
|
# if you want to use the generator, you can do something like this:
|
|
|
|
#find_package(PythonInterp REQUIRED)
|
|
|
|
#add_custom_command(
|
2014-09-02 01:17:03 +08:00
|
|
|
# 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)
|