summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7e62ec..00c6b71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -142,6 +142,9 @@ set (liblogdiag_HEADERS
liblogdiag/ld-lua-symbol.h
liblogdiag/ld-lua-symbol-private.h)
+set (logdiag_TESTS
+ point-array)
+
set (logdiag_SOURCES
src/ld-window-main.c
src/logdiag.c)
@@ -220,6 +223,20 @@ set_target_properties (liblogdiag PROPERTIES OUTPUT_NAME logdiag)
add_executable (logdiag WIN32 ${logdiag_SOURCES} ${logdiag_HEADERS})
target_link_libraries (logdiag liblogdiag ${logdiag_LIBS})
+# Testing
+option (BUILD_TESTING "Build tests" OFF)
+
+if (BUILD_TESTING)
+ enable_testing ()
+
+ foreach (name ${logdiag_TESTS})
+ add_executable (test-${name} tests/${name}.c)
+ target_link_libraries (test-${name} liblogdiag ${logdiag_LIBS})
+
+ add_test (test-${name} test-${name})
+ endforeach (name)
+endif (BUILD_TESTING)
+
# Generate documentation
if (GTK_DOC_FOUND)
GTK_DOC_RUN (WORKING_DIR ${project_DOC_DIR}