summaryrefslogtreecommitdiff
path: root/libgo/testsuite/gotest
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/testsuite/gotest')
-rwxr-xr-xlibgo/testsuite/gotest94
1 files changed, 49 insertions, 45 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 79e02e2a1ea..1f19bb5809c 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -313,56 +313,60 @@ x)
esac
if test x$tag1 != xnonmatchingtag -a x$tag2 != xnonmatchingtag; then
- taglines=`sed '/^package /q' < $f | fgrep '// +build '`
- if test "$taglines" = ""; then
- omatch=true
- else
- omatch=false
- fi
- for tags in $taglines; do
- match=false
- for tag in $tags; do
- reverse=false
- case $tag in
- "!"*)
- reverse=true
- tag=`echo $tag | sed -e 's/^!//'`
- ;;
- esac
-
- case $tag in
- "//" | "+build")
- ;;
- $goos | $goarch | cgo)
- match=true
- ;;
- *,*)
- match=true
- for ctag in `echo $tag | sed -e 's/,/ /g'`; do
- case $ctag in
- $goos | $goarch | cgo)
- ;;
- *)
- match=false
- ;;
- esac
- done
- ;;
- esac
-
- if test "$reverse" = true; then
- if test "$match" = true; then
+ tags=`sed '/^package /q' < $f | fgrep '// +build '`
+ omatch=true
+ first=true
+ match=false
+ for tag in $tags; do
+ reverse=false
+ case $tag in
+ "!"*)
+ reverse=true
+ tag=`echo $tag | sed -e 's/^!//'`
+ ;;
+ esac
+
+ case $tag in
+ "//")
+ ;;
+ "+build")
+ if test "$first" = "true"; then
+ first=false
+ elif test "$match" = "false"; then
+ omatch=false
+ fi
+ match=false
+ ;;
+ $goos | $goarch | cgo)
+ match=true
+ ;;
+ *,*)
+ match=true
+ for ctag in `echo $tag | sed -e 's/,/ /g'`; do
+ case $ctag in
+ $goos | $goarch | cgo)
+ ;;
+ *)
match=false
- else
- match=true
- fi
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ if test "$reverse" = true; then
+ if test "$match" = true; then
+ match=false
+ else
+ match=true
fi
- done
- if test "$match" = "true"; then
- omatch=true
fi
done
+ if test "$match" = "false" -a "$first" = "false"; then
+ omatch=false
+ fi
+
if test "$omatch" = "true"; then
gofiles="$gofiles $f"
fi