]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: skip a couple of DWARF tests in short mode
authorThan McIntosh <thanm@google.com>
Fri, 20 Jul 2018 11:38:10 +0000 (07:38 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 20 Jul 2018 18:29:38 +0000 (18:29 +0000)
Rejigger the DWARF tests to ensure that they run in a reasonable
amount of time in short mode, particularly the "abstract origin
sanity" testpoints.

Updates #26470

Change-Id: Idae9763ac20ea999fa394595aacfcd1e271293ae
Reviewed-on: https://go-review.googlesource.com/125295
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/link/internal/ld/dwarf_test.go

index ea89b72cadc52529f3dc94739429589fb892f2f3..12eb1b73f4b920c0633bbfb737691ac40b1599f7 100644 (file)
@@ -24,7 +24,8 @@ import (
 const (
        DefaultOpt = "-gcflags="
        NoOpt      = "-gcflags=-l -N"
-       OptInl4    = "-gcflags=all=-l=4"
+       OptInl4    = "-gcflags=-l=4"
+       OptAllInl4 = "-gcflags=all=-l=4"
 )
 
 func TestRuntimeTypesPresent(t *testing.T) {
@@ -610,7 +611,9 @@ func main() {
 
        // Note: this is a build with "-l=4", as opposed to "-l -N". The
        // test is intended to verify DWARF that is only generated when
-       // the inliner is active.
+       // the inliner is active. We're only going to look at the DWARF for
+       // main.main, however, hence we build with "-gcflags=-l=4" as opposed
+       // to "-gcflags=all=-l=4".
        f := gobuild(t, dir, prog, OptInl4)
 
        d, err := f.DWARF()
@@ -794,6 +797,10 @@ func abstractOriginSanity(t *testing.T, gopathdir string, flags string) {
 func TestAbstractOriginSanity(t *testing.T) {
        testenv.MustHaveGoBuild(t)
 
+       if testing.Short() {
+               t.Skip("skipping test in short mode.")
+       }
+
        if runtime.GOOS == "plan9" {
                t.Skip("skipping on plan9; no DWARF symbol table in executables")
        }
@@ -803,7 +810,7 @@ func TestAbstractOriginSanity(t *testing.T) {
 
        if wd, err := os.Getwd(); err == nil {
                gopathdir := filepath.Join(wd, "testdata", "httptest")
-               abstractOriginSanity(t, gopathdir, OptInl4)
+               abstractOriginSanity(t, gopathdir, OptAllInl4)
        } else {
                t.Fatalf("os.Getwd() failed %v", err)
        }