aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-08-05 10:11:59 -0400
committerRuss Cox <rsc@golang.org>2015-08-05 16:13:25 +0000
commit7721ac053599ff0f7e5db6ab5f0caa77a7ff4bf9 (patch)
tree0a2798cf5b1885131ca94bfcd112320735da4dbd
parent43a404cf5fe8ec3dea4f0015bc1c63d3c51e23af (diff)
downloadgo-7721ac053599ff0f7e5db6ab5f0caa77a7ff4bf9.tar.gz
go-7721ac053599ff0f7e5db6ab5f0caa77a7ff4bf9.zip
internal/testenv: add Builder, to report builder name
This works after golang.org/cl/13120 is running on the coordinator (maybe it already is). Change-Id: I4053d8e2f32fafd47b927203a6f66d5858e23376 Reviewed-on: https://go-review.googlesource.com/13165 Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/internal/testenv/testenv.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go
index ef5cfcbcd3..110af3d97a 100644
--- a/src/internal/testenv/testenv.go
+++ b/src/internal/testenv/testenv.go
@@ -11,11 +11,20 @@
package testenv
import (
+ "os"
"runtime"
"strings"
"testing"
)
+// Builder reports the name of the builder running this test
+// (for example, "linux-amd64" or "windows-386-gce").
+// If the test is not running on the build infrastructure,
+// Builder returns the empty string.
+func Builder() string {
+ return os.Getenv("GO_BUILDER_NAME")
+}
+
// HasGoBuild reports whether the current system can build programs with ``go build''
// and then run them with os.StartProcess or exec.Command.
func HasGoBuild() bool {