github.com/hbdrawn/golang@v0.0.0-20141214014649-6b835209aba2/misc/cgo/testgodefs/test.bash (about)

     1  # Copyright 2014 The Go Authors. All rights reserved.
     2  # Use of this source code is governed by a BSD-style
     3  # license that can be found in the LICENSE file.
     4  
     5  # We are testing cgo -godefs, which translates Go files that use
     6  # import "C" into Go files with Go definitions of types defined in the
     7  # import "C" block.  Add more tests here.
     8  FILE_PREFIXES="anonunion issue8478"
     9  
    10  RM=
    11  for FP in $FILE_PREFIXES
    12  do
    13    go tool cgo -godefs ${FP}.go > ${FP}_defs.go
    14    RM="${RM} ${FP}_defs.go"
    15  done
    16  
    17  go build . && ./testgodefs
    18  EXIT=$?
    19  rm -rf _obj testgodefs ${RM}
    20  exit $EXIT