started idea for testing
This commit is contained in:
parent
3b4a56bd89
commit
c3fc6e6701
5 changed files with 38 additions and 2 deletions
8
test/CMakeLists.txt
Normal file
8
test/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
file(GLOB TEST_SRCS **.c)
|
||||
|
||||
foreach(TEST_SRC ${TEST_SRCS})
|
||||
get_filename_component(EXEC_NAME ${TEST_SRC} NAME_WLE)
|
||||
add_executable(${EXEC_NAME} ${TEST_SRC})
|
||||
add_test(NAME ${EXEC_NAME} COMMAND ${EXEC_NAME})
|
||||
target_link_libraries(${EXEC_NAME} cieter unity)
|
||||
endforeach()
|
||||
17
test/test_dynarray.c
Normal file
17
test/test_dynarray.c
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "unity.h"
|
||||
#include "cieter_dynarray.h"
|
||||
|
||||
void setUp(void) {}
|
||||
void tearDown(void) {}
|
||||
|
||||
void test_init() {
|
||||
CieterDynArray *arr = cieter_dynarray_init(2);
|
||||
|
||||
TEST_ASSERT_NOT_NULL(arr);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_init);
|
||||
return UNITY_END();
|
||||
}
|
||||
Reference in a new issue