From ee9c0d1aa474214f3bc638b6ef88aba66a7f0b67 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Sun, 19 Feb 2012 01:22:22 +1030 Subject: Work around Solaris awk limitations Work around Solaris awk limitations: - Limit line lengths to 2500 bytes - Use "count > 0" instead of "count" for test expression --- runtests.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtests.sh b/runtests.sh index cdc33e6..e660db9 100755 --- a/runtests.sh +++ b/runtests.sh @@ -5,17 +5,18 @@ PLATFORM="`uname -s`" set -e -# Portable "ggrep -A" replacement +# Portable "ggrep -A" replacement. +# Work around Solaris awk record limit of 2559 bytes. # contextgrep PATTERN POST_MATCH_LINES contextgrep() { - awk "/$1/ { count = ($2 + 1) } count { count--; print }" + cut -c -2500 | awk "/$1/ { count = ($2 + 1) } count > 0 { count--; print }" } do_tests() { echo cd tests lua -e 'print("Testing Lua CJSON version " .. require("cjson")._VERSION)' - ./test.lua | contextgrep 'FAIL|Summary' 3 | grep -v PASS | cut -c -70 + ./test.lua | contextgrep 'FAIL|Summary' 3 | grep -v PASS | cut -c -150 cd .. } -- cgit v1.2.3-55-g6feb