diff --git a/CMakeLists.txt b/CMakeLists.txt index e9dd0d7..45d418c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,3 +12,7 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) include_directories(${search-algorithms_SOURCE_DIR}/src) add_subdirectory(src) + +if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + add_subdirectory(test) +endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..4786b92 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,9 @@ +find_package(unity REQUIRED) +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") +add_executable(testing + ./testing.cpp + ../src/main.cpp + ../src/algorithm.cpp +) +set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX) +target_link_libraries(testing unity) diff --git a/test/testing.cpp b/test/testing.cpp new file mode 100644 index 0000000..f0e94c0 --- /dev/null +++ b/test/testing.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include "algorithm.hpp" + +// Function is defined here for testing + +void setUp(void) +{ + ; +} + +void tearDown(void) +{ + ; +} + +int main(void) +{ + UNITY_BEGIN(); + return UNITY_END(); +} +