Fixed Unity

This commit is contained in:
TriantaTV 2023-09-15 16:34:07 -05:00
parent 6ff7c5b43f
commit 9dcfef9dd5
5 changed files with 17 additions and 18 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "test/Unity"]
path = test/Unity
url = https://github.com/ThrowTheSwitch/Unity.git

View File

@ -9,8 +9,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
include_directories(${search-algorithms_SOURCE_DIR}/src)
add_subdirectory(src) add_subdirectory(src)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")

View File

@ -1,7 +1,8 @@
add_subdirectory(Unity) find_package(unity REQUIRED)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}") include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable(testing add_executable(testing
./test.cpp test.cpp
../src/algorithm.cpp
) )
set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(testing unity) target_link_libraries(testing unity)

@ -1 +0,0 @@
Subproject commit 2775e1b05875cf45afce7153e36af76ddbfdba26

View File

@ -1,15 +1,19 @@
#include "unity.h" #include <unity/unity.h>
#include "unity_internals.h" #include <unity/unity_internals.h>
#include "../src/algorithm.hpp"
void setUp() { } void setUp() { ; }
void tearDown() { } 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); TEST_ASSERT_EQUAL_INT(4, 2+3);
} }
@ -17,8 +21,8 @@ void test_FAILURE(void)
int main(void) int main(void)
{ {
UNITY_BEGIN(); UNITY_BEGIN();
RUN_TEST(test_SUCCESS); RUN_TEST(test_AllVerticesAdded);
RUN_TEST(test_FAILURE); RUN_TEST(test_AllEdgesAdded);
return UNITY_END(); return UNITY_END();
} }