Text file src/cmd/go/testdata/script/test_main_compiler_flags.txt

     1  # This is a script test conversion of TestPackageMainTestCompilerFlags
     2  # originally added in CL 86265, which fixed #23180.
     3  # Test that we don't pass the package name 'main' to -p when building the
     4  # test package for a main package.
     5  
     6  go test -c -n p1
     7  # should not have run compile -p main p1.go
     8  ! stdout '([\\/]compile|gccgo).* (-p main|-fgo-pkgpath=main).*p1\.go'
     9  ! stderr '([\\/]compile|gccgo).* (-p main|-fgo-pkgpath=main).*p1\.go'
    10  # should have run compile -p p1 p1.go
    11  stderr '([\\/]compile|gccgo).* (-p p1|-fgo-pkgpath=p1).*p1\.go'
    12  
    13  -- go.mod --
    14  module p1
    15  -- p1.go --
    16  package main
    17  -- p1_test.go --
    18  package main
    19  
    20  import "testing"
    21  
    22  func Test(t *testing.T){}
    23  

View as plain text