Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* add check// targets to gdb
@ 2004-06-03  2:31 Alexandre Oliva
  2004-06-03  3:17 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2004-06-03  2:31 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

When testing targets for multiple multilibs, it's nice to be able to
run tests in parallel, on a single box or even on multiple boxes that
share the build tree.  This patch introduces check//% targets, similar
to check-gcc//% targets in GCC, that enable tests to be run in
parallel, each one using a separate testsuite directory for the
binaries and logs.

Such pattern rules require GNU make to work, and are silently ignored
by other makes (unless you happen to run check//%, which will still
work, but run the testsuite with --target_board=% :-)

Ok to install?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-check-parallel.patch --]
[-- Type: text/x-patch, Size: 1712 bytes --]

Index: gdb/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.in (check//%): New.

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.581
diff -u -p -r1.581 Makefile.in
--- gdb/Makefile.in 26 May 2004 05:31:39 -0000 1.581
+++ gdb/Makefile.in 3 Jun 2004 02:18:13 -0000
@@ -956,6 +956,31 @@ check: force
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
 	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
+# combinations.  GNU make is required for the % pattern to work, as is
+# a shell that expands alternations within braces.  If GNU make is not
+# used, this rule will harmlessly fail to match.
+check//%: force
+	@if [ -f testsuite/config.status ]; then \
+	  rootme=`pwd`; export rootme; \
+	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
+	  target=`echo "$@" | sed 's,//.*,,'`; \
+	  variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
+	  vardots=`echo "$$variant" | sed 's,/,.,g'`; \
+	  testdir=testsuite.$$vardots; \
+	  if [ ! -f $$testdir/Makefile ]; then \
+	    $(SHELL) $(srcdir)/../mkinstalldirs $$testdir && \
+	    cd $$testdir && \
+	    $(SHELL) ../testsuite/config.status --recheck && \
+	    $(SHELL) ./config.status; \
+	  else cd $$testdir; fi && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+	    RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
+	    "$$target"; \
+	else true; fi
+
 info dvi install-info clean-info html install-html: force
 	@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: add check// targets to gdb
  2004-06-03  2:31 add check// targets to gdb Alexandre Oliva
@ 2004-06-03  3:17 ` Daniel Jacobowitz
  2004-06-03  6:08   ` Alexandre Oliva
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2004-06-03  3:17 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gdb-patches

On Wed, Jun 02, 2004 at 11:31:17PM -0300, Alexandre Oliva wrote:
> When testing targets for multiple multilibs, it's nice to be able to
> run tests in parallel, on a single box or even on multiple boxes that
> share the build tree.  This patch introduces check//% targets, similar
> to check-gcc//% targets in GCC, that enable tests to be run in
> parallel, each one using a separate testsuite directory for the
> binaries and logs.
> 
> Such pattern rules require GNU make to work, and are silently ignored
> by other makes (unless you happen to run check//%, which will still
> work, but run the testsuite with --target_board=% :-)
> 
> Ok to install?

Is there some particular reason this should be in each target tool's
directory rather than at the top level (make check-gdb//{a,b}) ?


-- 
Daniel Jacobowitz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: add check// targets to gdb
  2004-06-03  3:17 ` Daniel Jacobowitz
@ 2004-06-03  6:08   ` Alexandre Oliva
  2004-06-03 11:22     ` Alexandre Oliva
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2004-06-03  6:08 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Jun  3, 2004, Daniel Jacobowitz <drow@false.org> wrote:

> Is there some particular reason this should be in each target tool's
> directory rather than at the top level (make check-gdb//{a,b}) ?

Top level could support it as well, but each directory runs its
testsuite in a slightly different way.  For example, gdb must run
configure within the testsuite dir, while gcc only requires site.exp
in there.

BTW, I just found out the patch didn't quite work.  There are some
sub-subdirectories of testsuite that have to be configured as well.
I'll post an update later.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: add check// targets to gdb
  2004-06-03  6:08   ` Alexandre Oliva
@ 2004-06-03 11:22     ` Alexandre Oliva
  2004-06-07 15:23       ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2004-06-03 11:22 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

On Jun  3, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:

> BTW, I just found out the patch didn't quite work.  There are some
> sub-subdirectories of testsuite that have to be configured as well.
> I'll post an update later.

Here's a fixed patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-check-parallel.patch --]
[-- Type: text/x-patch, Size: 1893 bytes --]

Index: gdb/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.in (check//%): New.

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.581
diff -u -p -r1.581 Makefile.in
--- gdb/Makefile.in 26 May 2004 05:31:39 -0000 1.581
+++ gdb/Makefile.in 3 Jun 2004 11:21:20 -0000
@@ -956,6 +956,34 @@ check: force
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
 	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
+# combinations.  GNU make is required for the % pattern to work, as is
+# a shell that expands alternations within braces.  If GNU make is not
+# used, this rule will harmlessly fail to match.
+check//%: force
+	@if [ -f testsuite/config.status ]; then \
+	  rootme=`pwd`; export rootme; \
+	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
+	  target=`echo "$@" | sed 's,//.*,,'`; \
+	  variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
+	  vardots=`echo "$$variant" | sed 's,/,.,g'`; \
+	  testdir=testsuite.$$vardots; \
+	  if [ ! -f $$testdir/Makefile ]; then \
+	    (cd testsuite && find . -name config.status) | \
+	    sed s,/config.status$$,, | sort | while read subdir; do \
+	      $(SHELL) $(srcdir)/../mkinstalldirs $$testdir/$$subdir && \
+	      (cd $$testdir/$$subdir && \
+	       $(SHELL) $$rootme/testsuite/$$subdir/config.status \
+		 --recheck && \
+	       $(SHELL) ./config.status); done; \
+	  else :; fi && cd $$testdir && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+	    RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
+	    "$$target"; \
+	else true; fi
+
 info dvi install-info clean-info html install-html: force
 	@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: add check// targets to gdb
  2004-06-03 11:22     ` Alexandre Oliva
@ 2004-06-07 15:23       ` Daniel Jacobowitz
  2004-06-07 20:08         ` Alexandre Oliva
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2004-06-07 15:23 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gdb-patches

On Thu, Jun 03, 2004 at 08:22:24AM -0300, Alexandre Oliva wrote:
> On Jun  3, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:
> 
> > BTW, I just found out the patch didn't quite work.  There are some
> > sub-subdirectories of testsuite that have to be configured as well.
> > I'll post an update later.

Configure can be run in the testsuite directory directly; I do this
when testing an installed GDB.  I think that would be substantially
simpler than the search for config.status, which may blow up (for
instance) when a directory is removed...

-- 
Daniel Jacobowitz


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: add check// targets to gdb
  2004-06-07 15:23       ` Daniel Jacobowitz
@ 2004-06-07 20:08         ` Alexandre Oliva
  2004-06-07 20:11           ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2004-06-07 20:08 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Jun  7, 2004, Daniel Jacobowitz <drow@false.org> wrote:

> On Thu, Jun 03, 2004 at 08:22:24AM -0300, Alexandre Oliva wrote:
>> On Jun  3, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:
>> 
>> > BTW, I just found out the patch didn't quite work.  There are some
>> > sub-subdirectories of testsuite that have to be configured as well.
>> > I'll post an update later.

> Configure can be run in the testsuite directory directly

But you'd have to somehow find out which flags to use to run
configure.  And where would you get them from?  From config.status.
Might as well just copy it and run it, which is what I do.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: add check// targets to gdb
  2004-06-07 20:08         ` Alexandre Oliva
@ 2004-06-07 20:11           ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2004-06-07 20:11 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gdb-patches

On Mon, Jun 07, 2004 at 05:08:54PM -0300, Alexandre Oliva wrote:
> On Jun  7, 2004, Daniel Jacobowitz <drow@false.org> wrote:
> 
> > On Thu, Jun 03, 2004 at 08:22:24AM -0300, Alexandre Oliva wrote:
> >> On Jun  3, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:
> >> 
> >> > BTW, I just found out the patch didn't quite work.  There are some
> >> > sub-subdirectories of testsuite that have to be configured as well.
> >> > I'll post an update later.
> 
> > Configure can be run in the testsuite directory directly
> 
> But you'd have to somehow find out which flags to use to run
> configure.  And where would you get them from?  From config.status.
> Might as well just copy it and run it, which is what I do.

OK to commit then.

-- 
Daniel Jacobowitz


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-07 20:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-03  2:31 add check// targets to gdb Alexandre Oliva
2004-06-03  3:17 ` Daniel Jacobowitz
2004-06-03  6:08   ` Alexandre Oliva
2004-06-03 11:22     ` Alexandre Oliva
2004-06-07 15:23       ` Daniel Jacobowitz
2004-06-07 20:08         ` Alexandre Oliva
2004-06-07 20:11           ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox