2015-03-02 17:07:11 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2014-08-05 17:10:15 -07:00
|
|
|
# Copyright 2014 The Go Authors. All rights reserved.
|
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
# We are testing cgo -godefs, which translates Go files that use
|
|
|
|
|
# import "C" into Go files with Go definitions of types defined in the
|
|
|
|
|
# import "C" block. Add more tests here.
|
2018-07-25 15:24:27 -07:00
|
|
|
FILE_PREFIXES="anonunion issue8478 fieldtypedef"
|
2014-08-05 17:10:15 -07:00
|
|
|
|
2019-02-21 15:11:16 -05:00
|
|
|
cd testdata
|
|
|
|
|
|
2014-08-05 17:10:15 -07:00
|
|
|
RM=
|
|
|
|
|
for FP in $FILE_PREFIXES
|
|
|
|
|
do
|
2016-10-30 12:30:47 -04:00
|
|
|
go tool cgo -godefs -srcdir . ${FP}.go > ${FP}_defs.go
|
2014-08-05 17:10:15 -07:00
|
|
|
RM="${RM} ${FP}_defs.go"
|
|
|
|
|
done
|
|
|
|
|
|
2019-02-21 15:11:16 -05:00
|
|
|
go build -o testgodefs . && ./testgodefs
|
2014-08-05 17:10:15 -07:00
|
|
|
EXIT=$?
|
|
|
|
|
rm -rf _obj testgodefs ${RM}
|
|
|
|
|
exit $EXIT
|