mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	mage: Fix mage check on darwin and add debugging output
Darwin no longer supports 386 builds after Catalina. Also add debugging output when running test suites from mage.
This commit is contained in:
		
				
					committed by
					
						
						Bjørn Erik Pedersen
					
				
			
			
				
	
			
			
			
						parent
						
							8a89b8582f
						
					
				
				
					commit
					8beaa4c25e
				
			
							
								
								
									
										22
									
								
								magefile.go
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								magefile.go
									
									
									
									
									
								
							@@ -134,10 +134,10 @@ func Check() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if runtime.GOARCH == "amd64" {
 | 
			
		||||
	if runtime.GOARCH == "amd64" && runtime.GOOS != "darwin" {
 | 
			
		||||
		mg.Deps(Test386)
 | 
			
		||||
	} else {
 | 
			
		||||
		fmt.Printf("Skip Test386 on %s\n", runtime.GOARCH)
 | 
			
		||||
		fmt.Printf("Skip Test386 on %s and/or %s\n", runtime.GOARCH, runtime.GOOS)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	mg.Deps(Fmt, Vet)
 | 
			
		||||
@@ -159,19 +159,31 @@ func testGoFlags() string {
 | 
			
		||||
// Note that we don't run with the extended tag. Currently not supported in 32 bit.
 | 
			
		||||
func Test386() error {
 | 
			
		||||
	env := map[string]string{"GOARCH": "386", "GOFLAGS": testGoFlags()}
 | 
			
		||||
	return sh.RunWith(env, goexe, "test", "./...")
 | 
			
		||||
	output, err := sh.OutputWith(env, goexe, "test", "./...")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Printf(output)
 | 
			
		||||
	}
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Run tests
 | 
			
		||||
func Test() error {
 | 
			
		||||
	env := map[string]string{"GOFLAGS": testGoFlags()}
 | 
			
		||||
	return sh.RunWith(env, goexe, "test", "./...", "-tags", buildTags())
 | 
			
		||||
	output, err := sh.OutputWith(env, goexe, "test", "./...", "-tags", buildTags())
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Printf(output)
 | 
			
		||||
	}
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Run tests with race detector
 | 
			
		||||
func TestRace() error {
 | 
			
		||||
	env := map[string]string{"GOFLAGS": testGoFlags()}
 | 
			
		||||
	return sh.RunWith(env, goexe, "test", "-race", "./...", "-tags", buildTags())
 | 
			
		||||
	output, err := sh.OutputWith(env, goexe, "test", "-race", "./...", "-tags", buildTags())
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Printf(output)
 | 
			
		||||
	}
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Run gofmt linter
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user