diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-02-19 01:22:22 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-03-04 18:54:36 +1030 |
commit | ee9c0d1aa474214f3bc638b6ef88aba66a7f0b67 (patch) | |
tree | 9ee5f48c894a0b34e3eccf457cb6bffa5d92111c | |
parent | 95cbf2012ef273b13a494a2c66cef61c334d442f (diff) | |
download | lua-cjson-ee9c0d1aa474214f3bc638b6ef88aba66a7f0b67.tar.gz lua-cjson-ee9c0d1aa474214f3bc638b6ef88aba66a7f0b67.tar.bz2 lua-cjson-ee9c0d1aa474214f3bc638b6ef88aba66a7f0b67.zip |
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`" | |||
5 | 5 | ||
6 | set -e | 6 | set -e |
7 | 7 | ||
8 | # Portable "ggrep -A" replacement | 8 | # Portable "ggrep -A" replacement. |
9 | # Work around Solaris awk record limit of 2559 bytes. | ||
9 | # contextgrep PATTERN POST_MATCH_LINES | 10 | # contextgrep PATTERN POST_MATCH_LINES |
10 | contextgrep() { | 11 | contextgrep() { |
11 | awk "/$1/ { count = ($2 + 1) } count { count--; print }" | 12 | cut -c -2500 | awk "/$1/ { count = ($2 + 1) } count > 0 { count--; print }" |
12 | } | 13 | } |
13 | 14 | ||
14 | do_tests() { | 15 | do_tests() { |
15 | echo | 16 | echo |
16 | cd tests | 17 | cd tests |
17 | lua -e 'print("Testing Lua CJSON version " .. require("cjson")._VERSION)' | 18 | lua -e 'print("Testing Lua CJSON version " .. require("cjson")._VERSION)' |
18 | ./test.lua | contextgrep 'FAIL|Summary' 3 | grep -v PASS | cut -c -70 | 19 | ./test.lua | contextgrep 'FAIL|Summary' 3 | grep -v PASS | cut -c -150 |
19 | cd .. | 20 | cd .. |
20 | } | 21 | } |
21 | 22 | ||