File tree 1 file changed +11
-1
lines changed
src/go/internal/gcimporter 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -137,14 +137,24 @@ func TestImportTypeparamTests(t *testing.T) {
137
137
t .Skipf ("gc-built packages not available (compiler = %s)" , runtime .Compiler )
138
138
}
139
139
140
+ // cmd/distpack removes the GOROOT/test directory, so skip if it isn't there.
141
+ // cmd/distpack also requires the presence of GOROOT/VERSION, so use that to
142
+ // avoid false-positive skips.
143
+ gorootTest := filepath .Join (testenv .GOROOT (t ), "test" )
144
+ if _ , err := os .Stat (gorootTest ); os .IsNotExist (err ) {
145
+ if _ , err := os .Stat (filepath .Join (testenv .GOROOT (t ), "VERSION" )); err == nil {
146
+ t .Skipf ("skipping: GOROOT/test not present" )
147
+ }
148
+ }
149
+
140
150
testenv .MustHaveGoBuild (t )
141
151
142
152
tmpdir := mktmpdir (t )
143
153
defer os .RemoveAll (tmpdir )
144
154
145
155
// Check go files in test/typeparam, except those that fail for a known
146
156
// reason.
147
- rootDir := filepath .Join (testenv . GOROOT ( t ), "test" , "typeparam" )
157
+ rootDir := filepath .Join (gorootTest , "typeparam" )
148
158
list , err := os .ReadDir (rootDir )
149
159
if err != nil {
150
160
t .Fatal (err )
You can’t perform that action at this time.
0 commit comments