mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 02:36:18 +08:00 
			
		
		
		
	tests: check presence of gcc for cgo tests (#2644)
The install of gcc sometimes fails on our CI, it is not an error if the tests for cgo can not run because there's no C compiler.
This commit is contained in:
		 Alessandro Arzilli
					Alessandro Arzilli
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							f95340ae1b
						
					
				
				
					commit
					4e242098f8
				
			| @ -367,7 +367,11 @@ var hasCgo = func() bool { | |||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		panic(err) | 		panic(err) | ||||||
| 	} | 	} | ||||||
| 	return strings.TrimSpace(string(out)) == "1" | 	if strings.TrimSpace(string(out)) != "1" { | ||||||
|  | 		return false | ||||||
|  | 	} | ||||||
|  | 	_, err = exec.LookPath("gcc") | ||||||
|  | 	return err == nil | ||||||
| }() | }() | ||||||
|  |  | ||||||
| func MustHaveCgo(t *testing.T) { | func MustHaveCgo(t *testing.T) { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user