This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
add check// targets to gdb
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 02 Jun 2004 23:31:17 -0300
- Subject: add check// targets to gdb
- Organization: Red Hat Global Engineering Services Compiler Team
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?
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
--
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}