From patchwork Thu Feb 11 16:18:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 10826 Received: (qmail 64557 invoked by alias); 11 Feb 2016 16:18:27 -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 64540 invoked by uid 89); 11 Feb 2016 16:18:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Parallel, natively, sk:ec2af52, 25, 6 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 11 Feb 2016 16:18:25 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 03DF891EAF for ; Thu, 11 Feb 2016 16:18:24 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1BGIN6N024918 for ; Thu, 11 Feb 2016 11:18:23 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH] Support 'make check-parallel' in gdb's build dir Date: Thu, 11 Feb 2016 16:18:22 +0000 Message-Id: <1455207502-11058-1-git-send-email-palves@redhat.com> Currently, you can cd to the gdb/testsuite/ dir and use make check-parallel, instead of using FORCE_PARALLEL: $ make -j8 check-parallel RUNTESTFLAGS="--target_board=native-gdbserver" $ make -j8 check RUNTESTFLAGS="--target_board=native-gdbserver" FORCE_PARALLEL=1 But you can't do that in the build/gdb/ dir: $ make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver" make: *** No rule to make target `check-parallel'. Stop. I find check-parallel a bit more convenient, and more typo-proof, so this patch makes it work from the gdb build dir too. While documenting this in testsuite/README, I found that the parallel testing mode would better be pulled out to its own section and extended. gdb/ChangeLog: 2016-02-11 Pedro Alves * Makefile.in (check-parallel): New rule. gdb/testsuite/ChangeLog: 2016-02-11 Pedro Alves * README (Parallel testing): New section. (GDB_PARALLEL): Rewrite. (FORCE_PARALLEL): Document. --- gdb/Makefile.in | 8 ++++++++ gdb/testsuite/README | 50 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index ec2af52..602ef43 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1158,6 +1158,14 @@ check-read1: force $(MAKE) $(TARGET_FLAGS_TO_PASS) check-read1; \ else true; fi +check-parallel: force + @if [ -f testsuite/Makefile ]; then \ + rootme=`pwd`; export rootme; \ + rootsrc=`cd $(srcdir); pwd`; export rootsrc; \ + cd testsuite; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \ + else true; fi + # The idea is to parallelize testing of multilibs, for example: # make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu} # will run 3 concurrent sessions of check, eventually testing all 10 diff --git a/gdb/testsuite/README b/gdb/testsuite/README index 77ac74e..1903e9e 100644 --- a/gdb/testsuite/README +++ b/gdb/testsuite/README @@ -25,6 +25,31 @@ The second is to cd to the testsuite directory and invoke the DejaGnu (The `site.exp' file contains a handful of useful variables like host and target triplets, and pathnames.) +Parallel testing +**************** + +When testing natively (that is, not with a remote host), you can run +the GDB test suite in a fully parallel mode. In this mode, each .exp +file runs separately and maybe simultaneously. The test suite ensures +that all the temporary files created by the test suite do not clash, +by putting them into separate directories. This mode is primarily +intended for use by the Makefile. + +For GNU make, the Makefile tries to run the tests in parallel mode if +any -j option is given. For a non-GNU make, tests are not +parallelized. + +If RUNTESTFLAGS is not empty, then by default the tests are +serialized. This can be overridden by either using the +`check-parallel' target in the Makefile, or by setting FORCE_PARALLEL +to any non-empty value: + + make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver + make check RUNTESTFLAGS="--target_board=native-gdbserver FORCE_PARALLEL=1 + +If you want to use runtest directly instead of using the Makefile, see +the description of GDB_PARALLEL below. + Running the Performance Tests ***************************** @@ -125,19 +150,18 @@ a .gdbinit. For example: GDB_PARALLEL -When testing natively (that is, not with a remote host), you can run -the GDB test suite in a fully parallel mode. In this mode, each .exp -file runs separately and maybe simultaneously. The test suite will -ensure that all the temporary files created by the test suite do not -clash, by putting them into separate directories. This mode is -primarily intended for use by the Makefile. - -To use this mode, set the GDB_PARALLEL on the runtest command line. -Before starting the tests, you must ensure that the directories cache, -outputs, and temp in the test suite build directory are either empty -or have been deleted. cache in particular is used to share data -across invocations of runtest, and files there may affect the test -results. Note that the Makefile automatically does these deletions. +To use parallel testing mode without using the the Makefile, set +GDB_PARALLEL on the runtest command line to "yes". Before starting +the tests, you must ensure that the directories cache, outputs, and +temp in the test suite build directory are either empty or have been +deleted. cache in particular is used to share data across invocations +of runtest, and files there may affect the test results. The Makefile +automatically does these deletions. + +FORCE_PARALLEL + +Setting FORCE_PARALLEL to any non-empty value forces parallel testing +mode even if RUNTESTFLAGS is not empty. GDB_INOTIFY