Setting up testing
This commit is contained in:
parent
ce424df021
commit
eb4995ee41
@ -12,3 +12,7 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
|||||||
include_directories(${search-algorithms_SOURCE_DIR}/src)
|
include_directories(${search-algorithms_SOURCE_DIR}/src)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
|
add_subdirectory(test)
|
||||||
|
endif()
|
||||||
|
9
test/CMakeLists.txt
Normal file
9
test/CMakeLists.txt
Normal 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
23
test/testing.cpp
Normal 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();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user