]> Cypherpunks repositories - gostls13.git/commitdiff
Add 'bench' target to makefiles.
authorAdam Langley <agl@golang.org>
Tue, 12 Jan 2010 23:43:20 +0000 (15:43 -0800)
committerAdam Langley <agl@golang.org>
Tue, 12 Jan 2010 23:43:20 +0000 (15:43 -0800)
R=rsc, agl, r
CC=golang-dev
https://golang.org/cl/188043

src/Make.pkg
src/pkg/Makefile

index d4196b6e845780e7f8242170c1ebc40c3f3fb626..3dd57b71046677709a658a4e6917551a6d020ea4 100644 (file)
@@ -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
 
index 0caa0dd3fd837b4136e41339967ccde7f73ba417..4f001db855c2e0b8b9e3556ae965e25cc03f86a9 100644 (file)
@@ -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/*