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-01-29 03:53:22 +08:00
|
|
|
include_directories(${CMAKE_BINARY_DIR}/tests)
|
|
|
|
add_executable(${arg} ${arg}.cpp ${sqlpp_headers} ${CMAKE_CURRENT_LIST_DIR}/Sample.h)
|
2013-08-15 19:26:09 +08:00
|
|
|
add_test(${arg} ${arg})
|
|
|
|
endmacro ()
|
|
|
|
|
2014-05-16 05:47:16 +08:00
|
|
|
#build_and_run(InterpretTest)
|
2014-06-03 05:57:21 +08:00
|
|
|
build_and_run(InsertTest)
|
2014-05-24 03:42:27 +08:00
|
|
|
#build_and_run(RemoveTest)
|
2014-05-27 15:16:29 +08:00
|
|
|
#build_and_run(UpdateTest)
|
2014-06-02 13:48:05 +08:00
|
|
|
#build_and_run(SelectTest)
|
2014-06-03 05:57:21 +08:00
|
|
|
#build_and_run(SelectTypeTest)
|
2014-05-23 04:53:08 +08:00
|
|
|
#build_and_run(FunctionTest)
|
2014-05-16 05:47:16 +08:00
|
|
|
#build_and_run(PreparedTest)
|
2013-08-15 19:26:09 +08:00
|
|
|
|
2014-02-03 02:10:14 +08:00
|
|
|
find_package(PythonInterp REQUIRED)
|
|
|
|
|
2014-01-29 03:53:22 +08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Sample.h
|
2014-02-03 02:10:14 +08:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/ddl2cpp ${CMAKE_CURRENT_LIST_DIR}/sample.sql Sample test
|
2014-02-13 15:44:09 +08:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/sample.sql
|
2014-01-29 03:53:22 +08:00
|
|
|
)
|
|
|
|
|