diff --git a/.gitignore b/.gitignore index 48f8a0cb..1ba87a37 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ install_manifest.txt *.o *.a bin/ -test/ build/ .lvimrc config-debug diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 00000000..e4717b2d --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(common) diff --git a/test/common/CMakeLists.txt b/test/common/CMakeLists.txt new file mode 100644 index 00000000..1487548d --- /dev/null +++ b/test/common/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(list) diff --git a/test/common/list/CMakeLists.txt b/test/common/list/CMakeLists.txt new file mode 100644 index 00000000..a9b8043b --- /dev/null +++ b/test/common/list/CMakeLists.txt @@ -0,0 +1,7 @@ +configure_test( + SUBPROJECT common + NAME list + SOURCES + ${PROJECT_SOURCE_DIR}/common/list.c + list.c +) diff --git a/test/common/list/list.c b/test/common/list/list.c new file mode 100644 index 00000000..dd66dec7 --- /dev/null +++ b/test/common/list/list.c @@ -0,0 +1,19 @@ +#define _POSIX_C_SOURCE 200809L +#include +#include +#include +#include "tests.h" +#include "list.h" + +static void test_test(void **state) { + list_t *list = create_list(); + free(list); + assert_true(true); +} + +int main() { + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_test), + }; + return cmocka_run_group_tests(tests, NULL, NULL); +}