Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Setup Travis CI for testing
Browse files Browse the repository at this point in the history
* Adds Tracis configuration
* Fixes broken tests
* Adds a space after \n in println commands due to newer versions
  of Go complaining about \n to end a println call
  • Loading branch information
mattfarina committed Dec 6, 2017
1 parent c9740af commit d496563
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: go

go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- tip

script:
- go test ./...
5 changes: 4 additions & 1 deletion go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ func TestGoVersion(t *testing.T) {

acceptable := []string{
"devel", "go1.0", "go1.1", "go1.2", "go1.3", "go1.4.2", "go1.5",
"go1.5.1",
"go1.5.1", "go1.5.2", "go1.5.3", "go1.5.4", "go1.6", "go1.6.1",
"go1.6.2", "go1.6.3", "go1.6.4", "go1.7", "go1.7.1", "go1.7.2",
"go1.7.3", "go1.7.4", "go1.7.5", "go1.8", "go1.8.1", "go1.8.2",
"go1.8.3", "go1.8.4", "go1.8.5", "go1.9", "go1.9.1", "go1.9.2",
}
found := false
for _, expected := range acceptable {
Expand Down
2 changes: 1 addition & 1 deletion platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestSupportedPlatforms(t *testing.T) {

// Unknown
ps = SupportedPlatforms("foo")
if !reflect.DeepEqual(ps, Platforms_1_4) {
if !reflect.DeepEqual(ps, Platforms_1_5) {
t.Fatalf("bad: %#v", ps)
}
}
7 changes: 4 additions & 3 deletions toolchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package main
import (
"bytes"
"fmt"
"github.com/mitchellh/iochan"
"io"
"os"
"os/exec"
"path/filepath"
"runtime"
"sync"

"github.com/mitchellh/iochan"
)

// The "main" method for when the toolchain build is requested.
Expand Down Expand Up @@ -48,7 +49,7 @@ func mainBuildToolchain(parallel int, platformFlag PlatformFlag, verbose bool) i

if verbose {
fmt.Println("Verbose mode enabled. Output from building each toolchain will be")
fmt.Println("outputted to stdout as they are built.\n")
fmt.Println("outputted to stdout as they are built.\n ")
}

// Determine the platforms we're building the toolchain for.
Expand All @@ -58,7 +59,7 @@ func mainBuildToolchain(parallel int, platformFlag PlatformFlag, verbose bool) i
if parallel > 1 {
fmt.Println("The toolchain build can't be parallelized because compiling a single")
fmt.Println("Go source directory can only be done for one platform at a time. Therefore,")
fmt.Println("the toolchain for each platform will be built one at a time.\n")
fmt.Println("the toolchain for each platform will be built one at a time.\n ")
}
parallel = 1

Expand Down

0 comments on commit d496563

Please sign in to comment.