From patchwork Thu Sep 28 21:51:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23215 Received: (qmail 60510 invoked by alias); 28 Sep 2017 21:52:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 58908 invoked by uid 89); 28 Sep 2017 21:51:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Sep 2017 21:51:55 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DE9785376 for ; Thu, 28 Sep 2017 21:51:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2DE9785376 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71374179CF for ; Thu, 28 Sep 2017 21:51:53 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Move utils-selftests.c -> gdb/unittests/ Date: Thu, 28 Sep 2017 22:51:52 +0100 Message-Id: <1506635512-25197-1-git-send-email-palves@redhat.com> This file was only under gdb/ currently because it predates the gdb/unittests/ directory. gdb/ChangeLog: 2017-09-28 Pedro Alves * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/common-utils-selftests.c. (SUBDIR_UNITTESTS_OBS): Add common-utils-selftests.o. (COMMON_OBS): Remove utils-selftests.o. * utils-selftests.c: Move to ... * unittests/common-utils-selftests.c: ... here and rename self test to "string_printf". --- gdb/ChangeLog | 10 ++++++++++ gdb/Makefile.in | 3 ++- .../common-utils-selftests.c} | 18 ++++-------------- 3 files changed, 16 insertions(+), 15 deletions(-) rename gdb/{utils-selftests.c => unittests/common-utils-selftests.c} (83%) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2120df6..ab9250c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2017-09-28 Pedro Alves + + * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add + unittests/common-utils-selftests.c. + (SUBDIR_UNITTESTS_OBS): Add common-utils-selftests.o. + (COMMON_OBS): Remove utils-selftests.o. + * utils-selftests.c: Move to ... + * unittests/common-utils-selftests.c: ... here and rename self + test to "string_printf". + 2017-09-28 Alexander Shaposhnikov (tiny patch) * dwarf2read.c (open_and_init_dwp_file): Protect against dwp_file diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 9004b35..f3f1d40 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -527,6 +527,7 @@ SUBDIR_PYTHON_CFLAGS = SUBDIR_UNITTESTS_SRCS = \ unittests/array-view-selftests.c \ + unittests/common-utils-selftests.c \ unittests/environ-selftests.c \ unittests/function-view-selftests.c \ unittests/offset-type-selftests.c \ @@ -537,6 +538,7 @@ SUBDIR_UNITTESTS_SRCS = \ SUBDIR_UNITTESTS_OBS = \ array-view-selftests.o \ + common-utils-selftests.o \ environ-selftests.o \ function-view-selftests.o \ offset-type-selftests.o \ @@ -1842,7 +1844,6 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ ui-out.o \ user-regs.o \ utils.o \ - utils-selftests.o \ valarith.o \ valops.o \ valprint.o \ diff --git a/gdb/utils-selftests.c b/gdb/unittests/common-utils-selftests.c similarity index 83% rename from gdb/utils-selftests.c rename to gdb/unittests/common-utils-selftests.c index 5a30a93..71bc2df 100644 --- a/gdb/utils-selftests.c +++ b/gdb/unittests/common-utils-selftests.c @@ -17,19 +17,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "defs.h" +#include "common-defs.h" #include "selftest.h" -#if GDB_SELF_TEST - namespace selftests { -/* common-utils self tests. Defined here instead of in - common/common-utils.c because that file is shared with - gdbserver. */ - static void -common_utils_tests (void) +string_printf_tests () { SELF_CHECK (string_printf ("%s", "") == ""); SELF_CHECK (string_printf ("%d comes before 2", 1) == "1 comes before 2"); @@ -49,12 +43,8 @@ common_utils_tests (void) } /* namespace selftests */ -#endif - void -_initialize_utils_selftests (void) +_initialize_common_utils_selftests () { -#if GDB_SELF_TEST - selftests::register_test ("common-utils", selftests::common_utils_tests); -#endif + selftests::register_test ("string_printf", selftests::string_printf_tests); }