From 12f9861253b1c9b8758b5356daedad98bfc044c4 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 4 Nov 2014 10:13:39 +0100
Subject: [PATCH 3/4] go.test: Add handling of "// +build" to go-test.exp.
---
gcc/testsuite/go.test/go-test.exp | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
@@ -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
--
1.8.4.2