diff --git a/.travis.yml b/.travis.yml index d24d59096..220ec8648 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/transpiler/call.go b/transpiler/call.go index c8583462b..ceaf9c908 100644 --- a/transpiler/call.go +++ b/transpiler/call.go @@ -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++ diff --git a/travis/test.sh b/travis/test.sh index 3821b2023..36b9590c7 100755 --- a/travis/test.sh +++ b/travis/test.sh @@ -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 @@ -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`