started idea for testing

This commit is contained in:
Jef Roosens 2022-12-04 09:01:32 +01:00
parent 3b4a56bd89
commit c3fc6e6701
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
5 changed files with 38 additions and 2 deletions

8
test/CMakeLists.txt Normal file
View 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
View 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();
}