blob: 6fd5bbe182bfd45d7b42c299d65e1cde11c1e95a [file] [log] [blame]
[short] skip
[!cgo] skip
[!exec:/usr/bin/env] skip
[!exec:bash] skip
[!exec:cat] skip
mkdir $WORK/tmp/cache
env GOCACHE=$WORK/tmp/cache
# Before building our test main.go, ensure that an up-to-date copy of
# runtime/cgo is present in the cache. If it isn't, the 'go build' step below
# will fail with "can't open import". See
# (The fix in didn't completely fix the underlying issue:
# cmd/go/internal/load adds a bunch of implicit dependencies
# based on various heuristics, and, due to a bug described in
# those implicit dependencies are not added early enough during
# loading to properly affect the import graph.)
go build runtime/cgo
go build -x -o main main.go
cp stderr commands.txt
exec cat header.txt commands.txt
cp stdout
exec ./main
cmp stderr hello.txt
rm ./main
exec /usr/bin/env bash -x
exec ./main
cmp stderr hello.txt
grep '^WORK=(.*)\n' commands.txt
-- main.go --
package main
import "C"
func main() {
-- header.txt --
set -e
-- hello.txt --