This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] make -j10 check TESTS=gdb.foo/*.exp


Hi.

I couldn't find an easy way to run a subset of tests using the new
parallel machinery.  I find it very convenient from time to time
to be able to specify "run all these tests in this directory in parallel".

gdb 7.6 could let me run a subset of directories in parallel
using TEST_DIRS (hacky, but it worked),
but with the new machinery we can take this further and run
any random set of tests in parallel.

This patch implements this idea.

E.g.,
bash$ make -j10 check TESTS="gdb.server/*.exp gdb.threads/*.exp"

2014-02-12  Doug Evans  <dje@google.com>

	* Makefile.in (TESTS): New variable.
	(check-single): Pass $(TESTS) to runtest.
	(check-parallel): Only run tests in $(TESTS) if non-empty.

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index 7a44660..d48587c 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -160,8 +160,17 @@ DO_RUNTEST = \
 	  export TCL_LIBRARY ; fi ; \
 	$(RUNTEST)
 
+# TESTS exists for the user to pass on the command line to easily
+# say "Only run these tests."  With check-single it's not necessary, but
+# with check-parallel there's no other way to (easily) specify a subset
+# of tests.  For consistency we support it for check-single as well.
+# To specify all tests in a subdirectory, use TESTS=gdb.subdir/*.exp.
+# E.g., make check TESTS="gdb.server/*.exp gdb.threads/*.exp".
+@GMAKE_TRUE@TESTS :=
+@GMAKE_FALSE@TESTS =
+
 check-single:
-	$(DO_RUNTEST) $(RUNTESTFLAGS)
+	$(DO_RUNTEST) $(RUNTESTFLAGS) $(TESTS)
 
 check-parallel:
 	-rm -rf cache
@@ -180,11 +189,16 @@ check-parallel:
 # them to the front of the list to try to lessen the overall time
 # taken by the test suite -- if one of these tests happens to be run
 # late, it will cause the overall time to increase.
+@GMAKE_TRUE@ifeq ($(strip $(TESTS)),)
 slow_tests = gdb.base/break-interp.exp gdb.base/interp.exp \
 	gdb.base/multi-forks.exp
 @GMAKE_TRUE@all_tests := $(shell cd $(srcdir) && find gdb.* -name '*.exp' -print)
 @GMAKE_TRUE@reordered_tests := $(slow_tests) $(filter-out $(slow_tests),$(all_tests))
 @GMAKE_TRUE@TEST_TARGETS := $(addprefix check/,$(reordered_tests))
+@GMAKE_TRUE@else
+@GMAKE_TRUE@all_tests := $(shell cd $(srcdir) && echo $(TESTS))
+@GMAKE_TRUE@TEST_TARGETS := $(addprefix check/,$(all_tests))
+@GMAKE_TRUE@endif
 
 do-check-parallel: $(TEST_TARGETS)
 	@:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]