We have plenty real unit test that can be used as examples, so the example tests are no longer needed. Let's get rid of them.
Signed-off-by: Steffan Karger <steffan.kar...@fox-it.com> --- tests/unit_tests/Makefile.am | 2 +- tests/unit_tests/example_test/Makefile.am | 13 -------- tests/unit_tests/example_test/README.md | 3 -- tests/unit_tests/example_test/test.c | 52 ------------------------------- tests/unit_tests/example_test/test2.c | 23 -------------- 5 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 tests/unit_tests/example_test/Makefile.am delete mode 100644 tests/unit_tests/example_test/README.md delete mode 100644 tests/unit_tests/example_test/test.c delete mode 100644 tests/unit_tests/example_test/test2.c diff --git a/tests/unit_tests/Makefile.am b/tests/unit_tests/Makefile.am index 31d37b8..cb3d63a 100644 --- a/tests/unit_tests/Makefile.am +++ b/tests/unit_tests/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = foreign if CMOCKA_INITIALIZED -SUBDIRS = example_test openvpn plugins +SUBDIRS = openvpn plugins endif diff --git a/tests/unit_tests/example_test/Makefile.am b/tests/unit_tests/example_test/Makefile.am deleted file mode 100644 index 04a5ad3..0000000 --- a/tests/unit_tests/example_test/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -check_PROGRAMS = example_testdriver example2_testdriver - -TESTS = $(check_PROGRAMS) - -example_testdriver_CFLAGS = @TEST_CFLAGS@ -example_testdriver_LDFLAGS = @TEST_LDFLAGS@ -example_testdriver_SOURCES = test.c - -example2_testdriver_CFLAGS = @TEST_CFLAGS@ -example2_testdriver_LDFLAGS = @TEST_LDFLAGS@ -example2_testdriver_SOURCES = test2.c diff --git a/tests/unit_tests/example_test/README.md b/tests/unit_tests/example_test/README.md deleted file mode 100644 index cb75d68..0000000 --- a/tests/unit_tests/example_test/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This test only checks that test compilation works. This example contains two test executables. - -These tests can be used as template for 'real' tests. diff --git a/tests/unit_tests/example_test/test.c b/tests/unit_tests/example_test/test.c deleted file mode 100644 index d48e5f5..0000000 --- a/tests/unit_tests/example_test/test.c +++ /dev/null @@ -1,52 +0,0 @@ -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <setjmp.h> -#include <cmocka.h> - -static int -setup(void **state) { - int *answer = malloc(sizeof(int)); - - *answer = 42; - *state = answer; - - return 0; -} - -static int -teardown(void **state) { - free(*state); - - return 0; -} - -static void -null_test_success(void **state) { - (void) state; -} - -static void -int_test_success(void **state) { - int *answer = *state; - assert_int_equal(*answer, 42); -} - -static void -failing_test(void **state) { - /* This tests fails to test that make check fails */ - assert_int_equal(0, 42); -} - -int -main(void) { - const struct CMUnitTest tests[] = { - cmocka_unit_test(null_test_success), - cmocka_unit_test_setup_teardown(int_test_success, setup, teardown), -/* cmocka_unit_test(failing_test), */ - }; - - return cmocka_run_group_tests_name("success_test", tests, NULL, NULL); -} diff --git a/tests/unit_tests/example_test/test2.c b/tests/unit_tests/example_test/test2.c deleted file mode 100644 index b5d4fa6..0000000 --- a/tests/unit_tests/example_test/test2.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <setjmp.h> -#include <cmocka.h> - - -static void -test_true(void **state) { - (void) state; -} - - -int -main(void) { - const struct CMUnitTest tests[] = { - cmocka_unit_test(test_true), - }; - - return cmocka_run_group_tests_name("success_test2", tests, NULL, NULL); -} -- 2.7.4 _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel