From patchwork Tue Oct 9 19:51:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffan Karger X-Patchwork-Id: 526 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.27.255.52]) by backend30.mail.ord1d.rsapps.net with LMTP id YAVXJcmhvVuJZgAAIUCqbw for ; Wed, 10 Oct 2018 02:52:57 -0400 Received: from proxy15.mail.iad3a.rsapps.net ([172.27.255.52]) by director8.mail.ord1d.rsapps.net with LMTP id mAyJIsmhvVs9VAAAfY0hYg ; Wed, 10 Oct 2018 02:52:57 -0400 Received: from smtp10.gate.iad3a ([172.27.255.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3a.rsapps.net with LMTP id MFfUHMmhvVsoEAAAHi9b9g ; Wed, 10 Oct 2018 02:52:57 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp10.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=fox-it.com X-Suspicious-Flag: YES X-Classification-ID: 1e173404-cc59-11e8-8608-525400a8203f-1-1 Received: from [216.105.38.7] ([216.105.38.7:62742] helo=lists.sourceforge.net) by smtp10.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 48/1F-01630-9C1ADBB5; Wed, 10 Oct 2018 02:52:57 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1gA8M0-0003Zw-VZ; Wed, 10 Oct 2018 06:52:20 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gA8Lz-0003Zq-N2 for openvpn-devel@lists.sourceforge.net; Wed, 10 Oct 2018 06:52:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject: CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OEznGbwdGld2thsv4SHUlGFknchEfA+53XzF+3KeCD4=; b=HbYh7qTLP5W2wkXo5kzHAwaEOH 7yLDpzBwmaKvgtx7E921+0NE6AezPkS9zqM4yelLzZTLNoOprWyQgEF0DwWUha9itX+KCr8L7mByl K5M7yRPYia87W2nmnFFY/wB4K41rrJwH4I9iE0ZZnxQ+i7obFCvUKeCT/I0nsrJEb06g=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=OEznGbwdGld2thsv4SHUlGFknchEfA+53XzF+3KeCD4=; b=W I2RTxuYsIj1HvLVjXUisUJKk5cxr6x482ini6lrPYn03pJ86sA5voUf5Y6NYHehNiYaTPnwYpelf6 ohDtQG8PPGRmKBK5L3B9SPQcCdQbEMk3xiNm6IpckQiT1AzVe3IkvrWys9ixcyT4KolcQpNipicv7 ah17JgdJMsCil2DY=; Received: from ns2.fox-it.com ([178.250.144.131]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.90_1) id 1gA8Ly-00GS7b-1U for openvpn-devel@lists.sourceforge.net; Wed, 10 Oct 2018 06:52:19 +0000 Received: from FOXDFT52.FOX.local (unknown [10.0.0.129]) by ns2.fox-it.com (Postfix) with ESMTPS id D22C11AF89C for ; Wed, 10 Oct 2018 08:52:10 +0200 (CEST) Received: from steffan-fox.fox.local (172.16.5.179) by FOXDFT52.FOX.local (10.0.0.129) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 10 Oct 2018 08:52:10 +0200 From: Steffan Karger To: Date: Wed, 10 Oct 2018 08:51:46 +0200 Message-ID: <1539154306-27462-1-git-send-email-steffan.karger@fox-it.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-ClientProxiedBy: FOXDFT52.FOX.local (10.0.0.129) To FOXDFT52.FOX.local (10.0.0.129) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1gA8Ly-00GS7b-1U Subject: [Openvpn-devel] [PATCH] Remove example unit tests X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 --- 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 -#include -#include -#include -#include -#include -#include - -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 -#include -#include -#include -#include -#include -#include - - -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); -}