]> Cypherpunks repositories - gostls13.git/commit
testing: add argument to list tests, benchmarks, and examples
authorBrandon Bennett <bbennett@fb.com>
Thu, 20 Apr 2017 16:26:10 +0000 (10:26 -0600)
committerMarcel van Lohuizen <mpvl@golang.org>
Wed, 26 Apr 2017 15:53:32 +0000 (15:53 +0000)
commitba8ff87dbeb87813a4604e36adb609b1e8fcb7be
tree515161a914c3b7a841bd095a1ed9300470466a65
parent6e2c4bc012f8cc262db25d3fee414c5231fea03a
testing: add argument to list tests, benchmarks, and examples

Some large testing/build systems require some form of test discovery before
running tests.  This usually allows for analytics, history, and stats on a per
tests basis.  Typically these systems are meant used in multi-language
environments and the original source code is not known or available.

This adds a -test.list option which takes a regular expression as an
argument. Any tests, benchmarks, or examples that match that regular
expression will be printed, one per line, to stdout and then the program
will exit.

Since subtests are named/discovered at run time this will only show
top-level tests names and is a known limitation.

Fixes #17209

Change-Id: I7e607f5f4f084d623a1cae88a1f70e7d92b7f13e
Reviewed-on: https://go-review.googlesource.com/41195
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/internal/test/test.go
src/cmd/go/internal/test/testflag.go
src/testing/testing.go