LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 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 main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "bytes" | 8 "bytes" |
9 "fmt" | 9 "fmt" |
10 "go/ast" | 10 "go/ast" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 } | 637 } |
638 | 638 |
639 t0 := time.Now() | 639 t0 := time.Now() |
640 err := cmd.Start() | 640 err := cmd.Start() |
641 | 641 |
642 // This is a last-ditch deadline to detect and | 642 // This is a last-ditch deadline to detect and |
643 // stop wedged test binaries, to keep the builders | 643 // stop wedged test binaries, to keep the builders |
644 // running. | 644 // running. |
645 tick := time.NewTimer(testKillTimeout) | 645 tick := time.NewTimer(testKillTimeout) |
646 if err == nil { | 646 if err == nil { |
| 647 startSigHandlers() |
647 done := make(chan error) | 648 done := make(chan error) |
648 go func() { | 649 go func() { |
649 done <- cmd.Wait() | 650 done <- cmd.Wait() |
650 }() | 651 }() |
651 select { | 652 select { |
652 case err = <-done: | 653 case err = <-done: |
653 // ok | 654 // ok |
654 case <-tick.C: | 655 case <-tick.C: |
655 cmd.Process.Kill() | 656 cmd.Process.Kill() |
656 err = <-done | 657 err = <-done |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 } | 848 } |
848 } | 849 } |
849 return matchRe.MatchString(str), nil | 850 return matchRe.MatchString(str), nil |
850 } | 851 } |
851 | 852 |
852 func main() { | 853 func main() { |
853 testing.Main(matchString, tests, benchmarks, examples) | 854 testing.Main(matchString, tests, benchmarks, examples) |
854 } | 855 } |
855 | 856 |
856 `)) | 857 `)) |
LEFT | RIGHT |