]> Cypherpunks repositories - gostls13.git/commitdiff
run.bat: do not unset GOROOT_FINAL before running tests
authorBryan C. Mills <bcmills@google.com>
Wed, 10 Jun 2020 02:00:18 +0000 (22:00 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 10 Jun 2020 03:27:28 +0000 (03:27 +0000)
This removes the same logic from run.bat that was removed from
cmd/dist in CL 236819.

The duplicated logic was removed from run.bash and run.rc in CL 6531,
but that part of run.bat was apparently missed (and not noticed
because its effect was redundant).

Also fix a path-separator bug in cmd/addr2line.TestAddr2Line that was
exposed as a result.

Fixes #39478
Updates #39385

Change-Id: I00054966cf92ef92a03681bf23de7f45f46fbb5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/237359
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/addr2line/addr2line_test.go
src/run.bat

index e12f0ae81453e9cc3c2ac5f630399a0024bc8a6f..578d88e432a8a9313826059f6c181c63d458a359 100644 (file)
@@ -73,6 +73,8 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
        if err != nil {
                t.Fatalf("Stat failed: %v", err)
        }
+       // Debug paths are stored slash-separated, so convert to system-native.
+       srcPath = filepath.FromSlash(srcPath)
        fi2, err := os.Stat(srcPath)
        if gorootFinal := os.Getenv("GOROOT_FINAL"); gorootFinal != "" && strings.HasPrefix(srcPath, gorootFinal) {
                if os.IsNotExist(err) || (err == nil && !os.SameFile(fi1, fi2)) {
@@ -88,12 +90,12 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
        if !os.SameFile(fi1, fi2) {
                t.Fatalf("addr2line_test.go and %s are not same file", srcPath)
        }
-       if srcLineNo != "97" {
-               t.Fatalf("line number = %v; want 97", srcLineNo)
+       if srcLineNo != "99" {
+               t.Fatalf("line number = %v; want 99", srcLineNo)
        }
 }
 
-// This is line 96. The test depends on that.
+// This is line 98. The test depends on that.
 func TestAddr2Line(t *testing.T) {
        testenv.MustHaveGoBuild(t)
 
index 90602b68cb4cbb81be958778fafd1107873f93f1..c299671c13f31381f997ce1c059d93f94db39369 100644 (file)
@@ -35,11 +35,6 @@ if errorlevel 1 goto fail
 echo.\r
 :norebuild\r
 \r
-:: we must unset GOROOT_FINAL before tests, because runtime/debug requires\r
-:: correct access to source code, so if we have GOROOT_FINAL in effect,\r
-:: at least runtime/debug test will fail.\r
-set GOROOT_FINAL=\r
-\r
 :: get CGO_ENABLED\r
 ..\bin\go env > env.bat\r
 if errorlevel 1 goto fail\r