From 698ba55860ece9f0065ded257b5ac04531f75f2a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 17 Jun 2016 07:38:32 -0400 Subject: [PATCH] Apparently test/ was gitignored --- .gitignore | 1 - test/CMakeLists.txt | 1 + test/common/CMakeLists.txt | 1 + test/common/list/CMakeLists.txt | 7 +++++++ test/common/list/list.c | 19 +++++++++++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test/CMakeLists.txt create mode 100644 test/common/CMakeLists.txt create mode 100644 test/common/list/CMakeLists.txt create mode 100644 test/common/list/list.c 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); +}