aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2022-07-22 20:17:29 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2022-07-22 20:17:29 -0400
commita70733d9a64320eac8038d733df67467cd97976c (patch)
tree767c0edc76bafc42e27a23ddad7ff9054d7e5728 /CMakeLists.txt
parent4a196857e13bd65ef982fe90dae1a1865985ee94 (diff)
downloadversion_compare-a70733d9a64320eac8038d733df67467cd97976c.tar.gz
Implement test harnass
* Fix various memory leaks * Fix off by one error in rsplit * main program is a wrapper for the vcmp library entry() function * Implement basic CI
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ccb593..f780fe9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,4 +11,16 @@ else()
add_compile_options(-Wall -Wextra -pedantic)
endif()
-add_executable(version_compare main.c)
+include(CTest)
+
+add_library(vcmp STATIC version_compare.c version_compare.h)
+target_compile_definitions(vcmp PUBLIC ENABLE_TESTING=1)
+
+add_executable(test_version_compare tests.c version_compare.h)
+target_link_libraries(test_version_compare vcmp)
+
+add_test(test test_version_compare)
+add_executable(version_compare main.c version_compare.h)
+target_link_libraries(version_compare vcmp)
+
+