Skip to content

Commit

Permalink
Add tests for go
Browse files Browse the repository at this point in the history
  • Loading branch information
scenee committed May 10, 2018
1 parent 0baa5c1 commit d985a1e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
.PHONY: build
build:
@export GOPATH=$$PWD/go; \
>/dev/null pushd go; \
go get github.com/DHowett/go-plist; \
go get gopkg.in/yaml.v2; \
go install -a relparser; \
go install -a lspp; \
popd > /dev/null;

.PHONY: test
test: bats
@PATH="/bin:$$PWD/bats/bin:$$PWD/bin:$$PATH" test/run.sh ${keychain}

.PHONY: version
version:
@PATH="$$PWD/bin:$$PATH" relax --version

.PHONY: bats
bats:
git clone --depth 1 https://github.com/sstephenson/bats.git

.PHONY: build
build:
@export GOPATH=$$PWD/go; \
>/dev/null pushd go; \
go get -d ./src/...; \
go install -a relparser; \
go install -a lspp; \
popd > /dev/null;

.PHONY: man
man:
@pushd share/man/man1 && ronn relax.1.ronn && popd
Expand Down
Binary file modified go/bin/lspp
Binary file not shown.
Binary file modified go/bin/relparser
Binary file not shown.
2 changes: 1 addition & 1 deletion go/src/lspp/lspp.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func findProvisioningProfile(pattern string, team string, isLatest bool, isVerbo
}
names += "\t" + info.Pp.Name
var s string
teamId := info.Pp.TeamIdentifier()
teamId := info.Pp.TeamID()
if isVerbose {
s = fmt.Sprintf("%v -- %v %v %v %v", info.Name, info.Pp.CreationDate.Local().Format("2006-01-02 15:04:05"), teamId, info.Pp.TeamName, info.Pp.Name)
} else {
Expand Down
13 changes: 13 additions & 0 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ relax profile add sample/certificates/Relax_AdHoc.mobileprovision
############

export NOCOLOR=true

# Go builds are not available on the OS X environment in Travis CI
if [[ $TRAVIS_CI != true ]]; then
export GOPATH="$PWD/go"
>/dev/null pushd go/src

go get ./...;
go test -v relparser/relfile
go test -v lspp

>/dev/null popd
fi

bats test

#############
Expand Down
2 changes: 2 additions & 0 deletions test/travis_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ shell_session_update() { :; }

set -ue

export TRAVIS_CI=true

make test

0 comments on commit d985a1e

Please sign in to comment.