cmake: add unit testing option and shunit2 tests
[project/uci.git] / CMakeLists.txt
index 578c0212779a78070dd7225335259e88b2ff8906..5720a5f8c024e012014f3307806d93061fc2b33c 100644 (file)
@@ -43,6 +43,11 @@ ADD_LIBRARY(ucimap STATIC ucimap.c)
 
 ADD_SUBDIRECTORY(lua)
 
+IF(UNIT_TESTING)
+  ENABLE_TESTING()
+  ADD_SUBDIRECTORY(tests)
+ENDIF()
+
 INSTALL(FILES uci.h uci_config.h uci_blob.h ucimap.h
        DESTINATION include
 )