From: Hyang-Ah Hana Kim Date: Fri, 24 Apr 2015 18:11:29 +0000 (-0400) Subject: misc/cgo/testcshared: make test.bash resilient against noise. X-Git-Tag: go1.5beta1~922 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e9a89b80b69eb977697455c0a45044b12fc9a197;p=gostls13.git misc/cgo/testcshared: make test.bash resilient against noise. Instead of comparing against the entire output that may include verbose warning messages, use the last line of the output and check it includes the expected success message (PASS). Change-Id: Iafd583ee5529a8aef5439b9f1f6ce0185e4b1331 Reviewed-on: https://go-review.googlesource.com/9304 Reviewed-by: David Crawshaw --- diff --git a/misc/cgo/testcshared/test.bash b/misc/cgo/testcshared/test.bash index ef8229542d..9a078e6485 100755 --- a/misc/cgo/testcshared/test.bash +++ b/misc/cgo/testcshared/test.bash @@ -40,7 +40,11 @@ function run() { args[$i]=${args[$i]//.\//${androidpath}\/} args[$i]=${args[$i]//=./=${androidpath}} done - echo $(adb shell ${args} | tr -d '\r') + output=$(adb shell ${args} | tr -d '\r') + case $output in + *PASS) echo "PASS";; + *) echo "$output";; + esac ;; *) echo $(env $@)