summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-11-08 06:59:47 +0100
committerVijay Bellur <vbellur@redhat.com>2014-11-13 22:21:03 -0800
commitaa0ba671f3e64858b9c93571383f2a0452eddf26 (patch)
treef9b8d81741fa952cab3680ea69600cc5d54a1f3d
parenta537342633707544c645cba0c3d46f2180c3b570 (diff)
Regression test portability: wc
NetBSD wc displays number with leading spaces, which cause arithmeric operations on values from wc -l to fail. Fix the problem by defining a wrappers that removes spaces. BUG: 1129939 Change-Id: I6fa147cf07772f58d9e19e0efd1dae5dad3a4219 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9076 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--tests/include.rc5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 8b06363894e..000005a4e33 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -83,6 +83,11 @@ wc () {
fi
}
;;
+NetBSD)
+wc() {
+ /usr/bin/wc $@ | sed 's/^ *\([0-9]*\).*$/\1/g'
+}
+;;
esac
testcnt=`egrep '^[[:space:]]*(EXPECT|EXPECT_NOT|TEST|EXPECT_WITHIN|EXPECT_KEYWORD)[[:space:]]' $0 | wc -l`