OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package os_test | 5 package os_test |
6 | 6 |
7 import ( | 7 import ( |
8 "bytes" | 8 "bytes" |
9 "errors" | 9 "errors" |
10 "flag" | 10 "flag" |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 func TestKillStartProcess(t *testing.T) { | 1287 func TestKillStartProcess(t *testing.T) { |
1288 testKillProcess(t, func(p *Process) { | 1288 testKillProcess(t, func(p *Process) { |
1289 err := p.Kill() | 1289 err := p.Kill() |
1290 if err != nil { | 1290 if err != nil { |
1291 t.Fatalf("Failed to kill test process: %v", err) | 1291 t.Fatalf("Failed to kill test process: %v", err) |
1292 } | 1292 } |
1293 }) | 1293 }) |
1294 } | 1294 } |
1295 | 1295 |
1296 func TestGetppid(t *testing.T) { | 1296 func TestGetppid(t *testing.T) { |
1297 » if runtime.GOOS == "nacl" { | 1297 » switch runtime.GOOS { |
| 1298 » case "nacl": |
1298 t.Skip("skipping on nacl") | 1299 t.Skip("skipping on nacl") |
| 1300 case "plan9": |
| 1301 // TODO: golang.org/issue/8206 |
| 1302 t.Skipf("skipping test on plan9; see issue 8206") |
1299 } | 1303 } |
1300 | 1304 |
1301 if Getenv("GO_WANT_HELPER_PROCESS") == "1" { | 1305 if Getenv("GO_WANT_HELPER_PROCESS") == "1" { |
1302 fmt.Print(Getppid()) | 1306 fmt.Print(Getppid()) |
1303 Exit(0) | 1307 Exit(0) |
1304 } | 1308 } |
1305 | 1309 |
1306 cmd := osexec.Command(Args[0], "-test.run=TestGetppid") | 1310 cmd := osexec.Command(Args[0], "-test.run=TestGetppid") |
1307 cmd.Env = append(Environ(), "GO_WANT_HELPER_PROCESS=1") | 1311 cmd.Env = append(Environ(), "GO_WANT_HELPER_PROCESS=1") |
1308 | 1312 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 // Test that all File methods give ErrInvalid if the receiver is nil. | 1360 // Test that all File methods give ErrInvalid if the receiver is nil. |
1357 func TestNilFileMethods(t *testing.T) { | 1361 func TestNilFileMethods(t *testing.T) { |
1358 for _, tt := range nilFileMethodTests { | 1362 for _, tt := range nilFileMethodTests { |
1359 var file *File | 1363 var file *File |
1360 got := tt.f(file) | 1364 got := tt.f(file) |
1361 if got != ErrInvalid { | 1365 if got != ErrInvalid { |
1362 t.Errorf("%v should fail when f is nil; got %v", tt.name
, got) | 1366 t.Errorf("%v should fail when f is nil; got %v", tt.name
, got) |
1363 } | 1367 } |
1364 } | 1368 } |
1365 } | 1369 } |
OLD | NEW |