Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(443)

Delta Between Two Patch Sets: src/cmd/go/test.go

Issue 6903061: code review 6903061: cmd/go: handle os signals (Closed)
Left Patch Set: diff -r 3c932286e5f5 https://go.googlecode.com/hg/ Created 11 years, 3 months ago
Right Patch Set: diff -r b1822aac85b7 https://go.googlecode.com/hg/ Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/go/signal_unix.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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
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
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 `))
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b