aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/testing
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-30 21:27:11 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-30 21:27:11 +0000
commit456fba2651cfb0cb67e44b8354668a0b3f5f5182 (patch)
tree9a0dfa827abe382ac0f44768e5365b87f00ac0a9 /libgo/go/testing
parente0be8a5c203451b47fd3da59b0e0f56cc3d42f22 (diff)
downloadgcc-456fba2651cfb0cb67e44b8354668a0b3f5f5182.zip
gcc-456fba2651cfb0cb67e44b8354668a0b3f5f5182.tar.gz
gcc-456fba2651cfb0cb67e44b8354668a0b3f5f5182.tar.bz2
libgo: Update to weekly.2012-03-13.
From-SVN: r186023
Diffstat (limited to 'libgo/go/testing')
-rw-r--r--libgo/go/testing/testing.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/go/testing/testing.go b/libgo/go/testing/testing.go
index 7072262..1cb8a07 100644
--- a/libgo/go/testing/testing.go
+++ b/libgo/go/testing/testing.go
@@ -108,6 +108,8 @@ var (
cpuListStr = flag.String("test.cpu", "", "comma-separated list of number of CPUs to use for each test")
parallel = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "maximum test parallelism")
+ haveExamples bool // are there examples?
+
cpuList []int
)
@@ -280,6 +282,7 @@ func Main(matchString func(pat, str string) (bool, error), tests []InternalTest,
before()
startAlarm()
+ haveExamples = len(examples) > 0
testOk := RunTests(matchString, tests)
exampleOk := RunExamples(matchString, examples)
if !testOk || !exampleOk {
@@ -304,7 +307,7 @@ func (t *T) report() {
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool) {
ok = true
- if len(tests) == 0 {
+ if len(tests) == 0 && !haveExamples {
fmt.Fprintln(os.Stderr, "testing: warning: no tests to run")
return
}