aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2014-11-05 04:04:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-11-05 04:04:24 +0000
commit350aa528015ff11d78a9aea87b85a9aaed855717 (patch)
tree6fe3eb8b908af8dfa452dfaf290c3943ba91e5df
parentc9bc4e2d2bf5d5967754a16fd93af2c48c0f4533 (diff)
downloadgcc-350aa528015ff11d78a9aea87b85a9aaed855717.zip
gcc-350aa528015ff11d78a9aea87b85a9aaed855717.tar.gz
gcc-350aa528015ff11d78a9aea87b85a9aaed855717.tar.bz2
go-test.exp: In +build lines, require whitespace around expected strings, fix check for negation.
* go.test/go-test.exp: In +build lines, require whitespace around expected strings, fix check for negation. From-SVN: r217111
-rw-r--r--gcc/testsuite/go.test/go-test.exp21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
index fd83722..71272a3 100644
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -449,13 +449,22 @@ proc go-gc-tests { } {
}
if { [ string match "// +build *" $test_line ] } {
- if { [ string match "*[getenv GOARCH]*" $test_line ] } {
- continue
- }
- if { [ string match "*linux*" $test_line ] } {
- continue
+ set matches_pos 0
+ set matches_neg 0
+ if { [ regexp -line "\[ \][getenv GOARCH]\(\[ \]\|\$\)" $test_line ] } {
+ set matches_pos 1
+ } elseif { [ regexp -line "\[ \]\![getenv GOARCH]\(\[ \]\|\$\)" $test_line ] } {
+ set matches_neg 1
+ } elseif { [ regexp -line "\[ \]linux\(\[ \]\|\$\)" $test_line ] } {
+ set matches_pos 1
+ } elseif { [ regexp -line "\[ \]\!linux\(\[ \]\|\$\)" $test_line ] } {
+ set matches_neg 1
+ } elseif { [ regexp -line "\[ \]\!windows\(\[ \]\|\$\)" $test_line ] } {
+ set matches_pos 1
+ } elseif { [ regexp -line "\[ \]windows\(\[ \]\|\$\)" $test_line ] } {
+ set matches_neg 1
}
- if { [ string match "*!windows*" $test_line ] } {
+ if { $matches_pos == 1 && $matches_neg == 0 } {
continue
}
close $fd