diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-02-18 18:52:22 +0400 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-03-04 12:24:36 +0400 |
commit | ee9c0d1aa474214f3bc638b6ef88aba66a7f0b67 (patch) | |
tree | 9ee5f48c894a0b34e3eccf457cb6bffa5d92111c | |
parent | 95cbf2012ef273b13a494a2c66cef61c334d442f (diff) |
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
-rwxr-xr-x | runtests.sh | 7 |
1 files 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 .. } |