Skip to content

Commit

Permalink
Fixing travis exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotchance committed Jul 23, 2017
1 parent 56e679e commit b1e6191
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ env:

matrix:
include:
- env: SCRIPT=test CLANG=3.8
os: linux
- env: SCRIPT=test CLANG=3.7
- env: SCRIPT=test CLANG=3.4
os: linux
- env: SCRIPT=test CLANG=3.6
os: linux
- env: SCRIPT=test CLANG=3.4
- env: SCRIPT=test CLANG=3.7
os: linux
- env: SCRIPT=test CLANG=3.8
os: linux
- env: SCRIPT=lint CLANG=3.9
os: linux
Expand Down
31 changes: 0 additions & 31 deletions transpiler/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,37 +138,6 @@ func transpileCallExpr(n *ast.CallExpr, p *program.Program) (
}
}

// We cannot use preallocated byte slices as strings in the same way we
// can do it in C. Instead we have to create a temporary string
// variable.
//if functionName == "noarch.Fscanf" && arraySize != -1 {
// tempVariableName := p.GetNextIdentifier("")
//
// // var __temp string
// preStmts = append(preStmts, &goast.DeclStmt{
// Decl: &goast.GenDecl{
// Tok: token.VAR,
// Specs: []goast.Spec{
// &goast.ValueSpec{
// Names: []*goast.Ident{util.NewIdent(tempVariableName)},
// Type: util.NewTypeIdent("string"),
// },
// },
// },
// })
//
// postStmts = append(postStmts, &goast.ExprStmt{
// X: util.NewCallExpr("copy", &goast.SliceExpr{
// X: e,
// }, util.NewIdent(tempVariableName)),
// })
//
// e = &goast.UnaryExpr{
// Op: token.AND,
// X: util.NewIdent(tempVariableName),
// }
//}

args = append(args, e)

i++
Expand Down
12 changes: 8 additions & 4 deletions travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ set -e
OUTFILE=/tmp/out.txt

function cleanup {
if [ $? -ne 0 ]; then
[ ! -f /tmp/filename.pid ] || cat $OUTFILE
EXIT_STATUS=$?

if [ $EXIT_STATUS != 0 ]; then
[ ! -f $OUTFILE ] || cat $OUTFILE
fi

exit $EXIT_STATUS
}
trap cleanup EXIT

Expand All @@ -29,8 +33,8 @@ export PKGS_DELIM=$(echo "$PKGS" | paste -sd "," -)
# with gocovmerge.
#
# Exit code 123 will be returned if any of the tests fail.
rm -f /tmp/out.txt
go list -f 'go test -v -tags=integration -race -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg $PKGS_DELIM {{.ImportPath}}' $PKGS | xargs -I{} bash -c "{} >> $OUTFILE"
rm -f $OUTFILE
go list -f 'go test -v -tags integration -race -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg $PKGS_DELIM {{.ImportPath}}' $PKGS | xargs -I{} bash -c "{} >> $OUTFILE"

# Merge coverage profiles.
COVERAGE_FILES=`ls -1 *.coverprofile 2>/dev/null | wc -l`
Expand Down

0 comments on commit b1e6191

Please sign in to comment.