mirror of
				https://github.com/golang/go.git
				synced 2025-11-04 02:30:57 +00:00 
			
		
		
		
	testing: do not recover example's panic
So as to give out stack trace for panic in examples.
        This behavior also matches the tests'.
        Fixes #2691.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5554061
			
			
This commit is contained in:
		
							parent
							
								
									e5c1f3870b
								
							
						
					
					
						commit
						d888ab80a3
					
				
					 1 changed files with 0 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -25,13 +25,6 @@ func RunExamples(examples []InternalExample) (ok bool) {
 | 
			
		|||
	var eg InternalExample
 | 
			
		||||
 | 
			
		||||
	stdout, stderr := os.Stdout, os.Stderr
 | 
			
		||||
	defer func() {
 | 
			
		||||
		os.Stdout, os.Stderr = stdout, stderr
 | 
			
		||||
		if e := recover(); e != nil {
 | 
			
		||||
			fmt.Printf("--- FAIL: %s\npanic: %v\n", eg.Name, e)
 | 
			
		||||
			os.Exit(1)
 | 
			
		||||
		}
 | 
			
		||||
	}()
 | 
			
		||||
 | 
			
		||||
	for _, eg = range examples {
 | 
			
		||||
		if *chatty {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue