Commit 9c26dfd0 by Ian Lance Taylor

gotest: multiple +build lines must all be true

    
    The code that handled +build lines did not correctly require them to all
    be true.  While looking into this I discovered that multiple +build
    lines were mishandled in a different way, because the shell does not
    preseve line breaks in backquoted data.  Look for the +build token to
    tell us when we are switching from one +build line to another.
    
    Reviewed-on: https://go-review.googlesource.com/25460

From-SVN: r239100
parent ac2c96ab
0fb416a7bed076bdfef168480789bb2994a58de3 3096ac81185edacbf800783f0f803d1c419dccdd
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -313,56 +313,60 @@ x) ...@@ -313,56 +313,60 @@ x)
esac esac
if test x$tag1 != xnonmatchingtag -a x$tag2 != xnonmatchingtag; then if test x$tag1 != xnonmatchingtag -a x$tag2 != xnonmatchingtag; then
taglines=`sed '/^package /q' < $f | fgrep '// +build '` tags=`sed '/^package /q' < $f | fgrep '// +build '`
if test "$taglines" = ""; then omatch=true
omatch=true first=true
else match=false
omatch=false for tag in $tags; do
fi reverse=false
for tags in $taglines; do case $tag in
match=false "!"*)
for tag in $tags; do reverse=true
reverse=false tag=`echo $tag | sed -e 's/^!//'`
case $tag in ;;
"!"*) esac
reverse=true
tag=`echo $tag | sed -e 's/^!//'` case $tag in
;; "//")
esac ;;
"+build")
case $tag in if test "$first" = "true"; then
"//" | "+build") first=false
;; elif test "$match" = "false"; then
$goos | $goarch | cgo) omatch=false
match=true fi
;; match=false
*,*) ;;
match=true $goos | $goarch | cgo)
for ctag in `echo $tag | sed -e 's/,/ /g'`; do match=true
case $ctag in ;;
$goos | $goarch | cgo) *,*)
;; match=true
*) for ctag in `echo $tag | sed -e 's/,/ /g'`; do
match=false case $ctag in
;; $goos | $goarch | cgo)
esac ;;
done *)
;;
esac
if test "$reverse" = true; then
if test "$match" = true; then
match=false match=false
else ;;
match=true esac
fi done
;;
esac
if test "$reverse" = true; then
if test "$match" = true; then
match=false
else
match=true
fi fi
done
if test "$match" = "true"; then
omatch=true
fi fi
done done
if test "$match" = "false" -a "$first" = "false"; then
omatch=false
fi
if test "$omatch" = "true"; then if test "$omatch" = "true"; then
gofiles="$gofiles $f" gofiles="$gofiles $f"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment