diff --git a/.gitmodules b/.gitmodules index ed6c586..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "test/Unity"] - path = test/Unity - url = https://github.com/ThrowTheSwitch/Unity.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 45d418c..0834132 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -include_directories(${search-algorithms_SOURCE_DIR}/src) - add_subdirectory(src) if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bb1f7c7..c244cbe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,8 @@ -add_subdirectory(Unity) -include_directories("${CMAKE_CURRENT_SOURCE_DIR}") +find_package(unity REQUIRED) +include_directories(${CMAKE_SOURCE_DIR}/src) add_executable(testing - ./test.cpp + test.cpp + ../src/algorithm.cpp ) set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries(testing unity) diff --git a/test/Unity b/test/Unity deleted file mode 160000 index 2775e1b..0000000 --- a/test/Unity +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2775e1b05875cf45afce7153e36af76ddbfdba26 diff --git a/test/test.cpp b/test/test.cpp index 7ec7771..ebb78dd 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,15 +1,19 @@ -#include "unity.h" -#include "unity_internals.h" +#include +#include +#include "../src/algorithm.hpp" -void setUp() { } -void tearDown() { } +void setUp() { ; } +void tearDown() { ; } -void test_SUCCESS(void) +Graph testGraph; + +void test_AllVerticesAdded(void) { - TEST_ASSERT_EQUAL_INT(4, 2+2); + testGraph = ReadInGraph("test/input/graphPosLittle"); + TEST_ASSERT_EQUAL_INT(10, testGraph.nodeCount); } -void test_FAILURE(void) +void test_AllEdgesAdded(void) { TEST_ASSERT_EQUAL_INT(4, 2+3); } @@ -17,8 +21,8 @@ void test_FAILURE(void) int main(void) { UNITY_BEGIN(); - RUN_TEST(test_SUCCESS); - RUN_TEST(test_FAILURE); + RUN_TEST(test_AllVerticesAdded); + RUN_TEST(test_AllEdgesAdded); return UNITY_END(); }