summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@golang.org>2010-01-12 15:43:20 -0800
committerAdam Langley <agl@golang.org>2010-01-12 15:43:20 -0800
commitd64f37ef1013eadcbc4b4e73f9f7be0d64b591a5 (patch)
tree012452a02021900d7224677a630832711b6b96c6
parent28ff96d5174e261744d23b5c2cb8b3db07727dd8 (diff)
downloadgolang-d64f37ef1013eadcbc4b4e73f9f7be0d64b591a5.tar.gz
Add 'bench' target to makefiles.
R=rsc, agl, r CC=golang-dev http://codereview.appspot.com/188043
-rw-r--r--src/Make.pkg3
-rw-r--r--src/pkg/Makefile12
2 files changed, 15 insertions, 0 deletions
diff --git a/src/Make.pkg b/src/Make.pkg
index d4196b6e8..3dd57b710 100644
--- a/src/Make.pkg
+++ b/src/Make.pkg
@@ -53,6 +53,9 @@ clean:
test:
$(QUOTED_GOBIN)/gotest
+bench:
+ $(QUOTED_GOBIN)/gotest -benchmarks=. -match="Do not run tests"
+
nuke: clean
rm -f $(pkgdir)/$(TARG).a
diff --git a/src/pkg/Makefile b/src/pkg/Makefile
index 0caa0dd3f..4f001db85 100644
--- a/src/pkg/Makefile
+++ b/src/pkg/Makefile
@@ -134,13 +134,20 @@ NOTEST=\
testing/iotest\
xgb\
+NOBENCH=\
+ container/vector\
+
TEST=\
$(filter-out $(NOTEST),$(DIRS))
+BENCH=\
+ $(filter-out $(NOBENCH),$(TEST))
+
clean.dirs: $(addsuffix .clean, $(DIRS))
install.dirs: $(addsuffix .install, $(DIRS))
nuke.dirs: $(addsuffix .nuke, $(DIRS))
test.dirs: $(addsuffix .test, $(TEST))
+bench.dirs: $(addsuffix .bench, $(BENCH))
%.clean:
+cd $* && $(QUOTED_GOBIN)/gomake clean
@@ -154,12 +161,17 @@ test.dirs: $(addsuffix .test, $(TEST))
%.test:
+cd $* && $(QUOTED_GOBIN)/gomake test
+%.bench:
+ +cd $* && $(QUOTED_GOBIN)/gomake bench
+
clean: clean.dirs
install: install.dirs
test: test.dirs
+bench: bench.dirs
+
nuke: nuke.dirs
rm -rf "$(GOROOT)"/pkg/*