Skip to content

Commit

Permalink
Merge branch 'f/integrate_xcpretty/#128293477'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwfriese committed Aug 15, 2016
2 parents bf3a583 + 7c86f96 commit 28ba8ae
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
system
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ osx_image: xcode7.3
before_install:
- export XCODEBUILD_PATH=$(which xcodebuild)
- export PATH=$PATH:$XCODEBUILD_PATH
- export PATH=$PATH:~/bin
install:
- git submodule init
- git submodule update

- gem install xcpretty --user-install -n~/bin
script:
- go run script/tests.go
- go run Testing/tests.go
2 changes: 1 addition & 1 deletion script/tests.go → Testing/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
}

func runUnitTests(stdOut io.Writer, stdErr io.Writer) {
runCommand := exec.Command("go", "run", "script/unittests.go")
runCommand := exec.Command("go", "run", "Testing/unittests.go")
runCommand.Stdout = stdOut
runCommand.Stderr = stdErr

Expand Down
25 changes: 20 additions & 5 deletions script/unittests.go → Testing/unittests.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,26 @@ func main() {
}

unitTestCommand := exec.Command("xcodebuild", "test", "-workspace", "Fleet.xcworkspace", "-scheme", "Fleet", "-destination", "platform=iOS Simulator,OS=9.3,name=iPhone 6")
unitTestCommand.Stdout = stdOut
unitTestCommand.Stderr = stdErr
unitTestErr := unitTestCommand.Run()
if unitTestErr != nil {
log.Fatal(unitTestErr)
xcprettyCommand := exec.Command("xcpretty")
xcprettyCommand.Stdin, err = unitTestCommand.StdoutPipe()
if err != nil {
log.Fatal(err)
}
xcprettyCommand.Stdout = stdOut
xcprettyCommand.Stderr = stdErr
err = xcprettyCommand.Start()
if err != nil {
log.Fatal(err)
}

err = unitTestCommand.Run()
if err != nil {
log.Fatal(err)
}

err = xcprettyCommand.Wait()
if err != nil {
log.Fatal(err)
}

_, err = stdOut.Write([]byte("Fleet unit tests passed...\n"))
Expand Down

0 comments on commit 28ba8ae

Please sign in to comment.