]> git.openstreetmap.org Git - nominatim.git/blobdiff - CMakeLists.txt
enable test execution using ctest
[nominatim.git] / CMakeLists.txt
index ceffb6fccd217d39e5594694ddc963f8b93afc50..a561e020d30a87edc5ce7bea7f1f2de79f73d091 100644 (file)
@@ -32,6 +32,7 @@ add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
 #
 #-----------------------------------------------------------------------------
 
+set(BUILD_TESTS on)
 add_subdirectory(osm2pgsql)
 
 find_package(Threads REQUIRED)
@@ -73,6 +74,28 @@ execute_process(
     COMMAND ln -s -t ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/utils
 )
 
+#-----------------------------------------------------------------------------
+#
+# Tests
+#
+#-----------------------------------------------------------------------------
+
+include(CTest)
+
+set(TEST_BDD db osm2pgsql api)
+
+foreach (test ${TEST_BDD})
+    add_test(NAME bdd_${test}
+             COMMAND lettuce features/${test}
+             WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests)
+    set_tests_properties(bdd_${test}
+        PROPERTIES ENVIRONMENT "NOMINATIM_DIR=${PROJECT_BINARY_DIR}")
+endforeach()
+
+add_test(NAME php
+         COMMAND phpunit ./
+         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests-php)
+
 #-----------------------------------------------------------------------------
 
 add_subdirectory(module)