]> Cypherpunks repositories - gostls13.git/commit
runtime: fix TestFixedGOROOT to properly restore the GOROOT env var after test
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 3 Jun 2015 23:16:32 +0000 (16:16 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 3 Jun 2015 23:33:48 +0000 (23:33 +0000)
commit03410f675808ad51fa1e1fd153fd3d182ebcb217
tree989fe2bc0c2a7ebec35e8ea7bb5fb5936787587b
parent1e48683708876a3ef1961f382943cbd2f88238af
runtime: fix TestFixedGOROOT to properly restore the GOROOT env var after test

Otherwise subsequent tests won't see any modified GOROOT.

With this CL I can move my GOROOT, set GOROOT to the new location, and
the runtime tests pass. Previously the crash_tests would instead look
for the GOROOT baked into the binary, instead of the env var:

--- FAIL: TestGcSys (0.01s)
        crash_test.go:92: building source: exit status 2
                go: cannot find GOROOT directory: /home/bradfitz/go
--- FAIL: TestGCFairness (0.01s)
        crash_test.go:92: building source: exit status 2
                go: cannot find GOROOT directory: /home/bradfitz/go
--- FAIL: TestGdbPython (0.07s)
        runtime-gdb_test.go:64: building source exit status 2
                go: cannot find GOROOT directory: /home/bradfitz/go
--- FAIL: TestLargeStringConcat (0.01s)
        crash_test.go:92: building source: exit status 2
                go: cannot find GOROOT directory: /home/bradfitz/go

Update #10029

Change-Id: If91be0f04d3acdcf39a9e773a4e7905a446bc477
Reviewed-on: https://go-review.googlesource.com/10685
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/env_test.go