Setting up testing

This commit is contained in:
TriantaTV 2023-09-10 16:29:34 -05:00
parent ce424df021
commit eb4995ee41
3 changed files with 36 additions and 0 deletions

View File

@ -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()

9
test/CMakeLists.txt Normal file
View File

@ -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)

23
test/testing.cpp Normal file
View File

@ -0,0 +1,23 @@
#include <unity/unity.h>
#include <unity/unity_internals.h>
#include <vector>
#include "algorithm.hpp"
// Function is defined here for testing
void setUp(void)
{
;
}
void tearDown(void)
{
;
}
int main(void)
{
UNITY_BEGIN();
return UNITY_END();
}