aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist/test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/dist/test.go')
-rw-r--r--src/cmd/dist/test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 50a2e5936c..fed83120ed 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -218,6 +218,15 @@ func (t *tester) run() {
}
}
+ if err := t.maybeLogMetadata(); err != nil {
+ t.failed = true
+ if t.keepGoing {
+ log.Printf("Failed logging metadata: %v", err)
+ } else {
+ fatalf("Failed logging metadata: %v", err)
+ }
+ }
+
for _, dt := range t.tests {
if !t.shouldRunTest(dt.name) {
t.partial = true
@@ -268,6 +277,16 @@ func (t *tester) shouldRunTest(name string) bool {
return false
}
+func (t *tester) maybeLogMetadata() error {
+ if t.compileOnly {
+ // We need to run a subprocess to log metadata. Don't do that
+ // on compile-only runs.
+ return nil
+ }
+ t.out("Test execution environment.")
+ return logMetadata()
+}
+
// short returns a -short flag value to use with 'go test'
// or a test binary for tests intended to run in short mode.
// It returns "true", unless the environment variable