Commit 548591b7 authored by Robert Griesemer's avatar Robert Griesemer

go cmd: print more than one error when running go test

Fixes #3055.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5683079
parent b05e3f11
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"go/build" "go/build"
"go/doc" "go/doc"
"go/parser" "go/parser"
"go/scanner"
"go/token" "go/token"
"os" "os"
"os/exec" "os/exec"
...@@ -299,6 +300,16 @@ func runTest(cmd *Command, args []string) { ...@@ -299,6 +300,16 @@ func runTest(cmd *Command, args []string) {
for _, p := range pkgs { for _, p := range pkgs {
buildTest, runTest, printTest, err := b.test(p) buildTest, runTest, printTest, err := b.test(p)
if err != nil { if err != nil {
if list, ok := err.(scanner.ErrorList); ok {
const n = 10
if len(list) > n {
list = list[:n]
}
for _, err := range list {
errorf("%s", err)
}
continue
}
errorf("%s", err) errorf("%s", err)
continue continue
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment