aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/Makefile.in
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2014-02-18 16:11:02 -0800
committerDoug Evans <dje@google.com>2014-02-18 16:11:02 -0800
commitc17ef0d5d26a5374b70f33689042ec2f6a77e4fa (patch)
tree9a334378ba1fa7b83cd3baeea68479d856c23324 /gdb/testsuite/Makefile.in
parent5dd3176fb78ffa11ff37234d62a953d124d1e8aa (diff)
downloadgdb-c17ef0d5d26a5374b70f33689042ec2f6a77e4fa.zip
gdb-c17ef0d5d26a5374b70f33689042ec2f6a77e4fa.tar.gz
gdb-c17ef0d5d26a5374b70f33689042ec2f6a77e4fa.tar.bz2
New TESTS variable to run a subset of tests in parallel.
* Makefile.in (TESTS): New variable. (expanded_tests, expanded_tests_or_none): New variables (check-single): Pass $(expanded_tests_or_none) to runtest. (check-parallel): Only run tests in $(TESTS) if non-empty. (check/no-matching-tests-found): New rule. * README: Document TESTS makefile variable.
Diffstat (limited to 'gdb/testsuite/Makefile.in')
-rw-r--r--gdb/testsuite/Makefile.in28
1 files changed, 27 insertions, 1 deletions
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index 5d8fcc1..0020a0f 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -160,8 +160,25 @@ 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 =
+
+@GMAKE_TRUE@ifeq ($(strip $(TESTS)),)
+@GMAKE_TRUE@expanded_tests_or_none :=
+@GMAKE_TRUE@else
+@GMAKE_TRUE@expanded_tests := $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(TESTS))))
+@GMAKE_TRUE@expanded_tests_or_none := $(or $(expanded_tests),no-matching-tests-found)
+@GMAKE_TRUE@endif
+@GMAKE_FALSE@expanded_tests_or_none = $(TESTS)
+
check-single:
- $(DO_RUNTEST) $(RUNTESTFLAGS)
+ $(DO_RUNTEST) $(RUNTESTFLAGS) $(expanded_tests_or_none)
check-parallel:
-rm -rf cache outputs temp
@@ -180,11 +197,15 @@ 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@TEST_TARGETS := $(addprefix check/,$(expanded_tests_or_none))
+@GMAKE_TRUE@endif
do-check-parallel: $(TEST_TARGETS)
@:
@@ -193,6 +214,11 @@ do-check-parallel: $(TEST_TARGETS)
@GMAKE_TRUE@ -mkdir -p outputs/$*
@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=yes --outdir=outputs/$* $*.exp $(RUNTESTFLAGS)
+check/no-matching-tests-found:
+ @echo ""
+ @echo "No matching tests found."
+ @echo ""
+
check-perf: all $(abs_builddir)/site.exp
@if test ! -d gdb.perf; then mkdir gdb.perf; fi
$(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PERFTEST_MODE=both $(RUNTESTFLAGS)