Run integration tests with -race (fixes #1043)

This commit is contained in:
Jakob Borg
2014-11-29 22:17:54 +01:00
parent 7af25c785d
commit 4fdecc9b85
7 changed files with 112 additions and 41 deletions

View File

@@ -44,6 +44,7 @@ var (
goos string
noupgrade bool
version string
race bool
)
const minGoVersion = 1.3
@@ -65,8 +66,9 @@ func main() {
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
flag.BoolVar(&noupgrade, "no-upgrade", false, "Disable upgrade functionality")
flag.BoolVar(&noupgrade, "no-upgrade", noupgrade, "Disable upgrade functionality")
flag.StringVar(&version, "version", getVersion(), "Set compiled in version string")
flag.BoolVar(&race, "race", race, "Use race detector")
flag.Parse()
switch goarch {
@@ -182,6 +184,9 @@ func install(pkg string, tags []string) {
if len(tags) > 0 {
args = append(args, "-tags", strings.Join(tags, ","))
}
if race {
args = append(args, "-race")
}
args = append(args, pkg)
setBuildEnv()
runPrint("go", args...)
@@ -193,6 +198,9 @@ func build(pkg string, tags []string) {
if len(tags) > 0 {
args = append(args, "-tags", strings.Join(tags, ","))
}
if race {
args = append(args, "-race")
}
args = append(args, pkg)
setBuildEnv()
runPrint("go", args...)