add_definitions("-std=c++0x -O0 -Wall -Wno-long-long -DNDEBUG")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../src")

enable_testing()

foreach(TEST compile connect optional placeholders query)
	add_executable(test_${TEST} ${CMAKE_CURRENT_SOURCE_DIR}/${TEST}.cpp)
	target_link_libraries(test_${TEST} rusql)
	add_test(test_${TEST} test_${TEST})
endforeach()

add_definitions("-std=c++0x -O0 -Wall -Wno-long-long -DNDEBUG")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../src")

add_custom_target(check COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tests.pl"
COMMENT "\nTo run the tests against a live database, call:\n${CMAKE_CURRENT_SOURCE_DIR}/tests.pl <host> <user> <pass> <emptydb>")

foreach(TEST compile connect optional placeholders query)
	add_executable(test_${TEST} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/${TEST}.cpp)
	target_link_libraries(test_${TEST} rusql)
	add_test(test_${TEST} test_${TEST})
	add_dependencies(check test_${TEST})
endforeach()

Make test compilation optional. On "make check", compile all tests and run them. with the tests.pl script.
Make test compilation optional. On "make check", compile all tests and run them. with the tests.pl script.
