go-test.exp: In +build lines, require whitespace around expected strings, fix check...
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 5 Nov 2014 04:04:24 +0000 (04:04 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 5 Nov 2014 04:04:24 +0000 (04:04 +0000)
* go.test/go-test.exp: In +build lines, require whitespace around
expected strings, fix check for negation.

From-SVN: r217111

gcc/testsuite/go.test/go-test.exp

index fd837227d07ce524c91758487b2edaecbf233c7f..71272a3aa90f0618f0619f77e99605237e961819 100644 (file)
@@ -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