Revision 181
Added by Aaron Marcuse-Kubitza about 13 years ago
map | ||
---|---|---|
1 |
#!/bin/bash
|
|
1 |
#!/bin/sh |
|
2 | 2 |
# Tests map on all input/*.csv |
3 | 3 |
# Usage: env [n=<num-rows>] self |
4 | 4 |
|
... | ... | |
8 | 8 |
shopt -s nullglob |
9 | 9 |
|
10 | 10 |
tests_n=2 |
11 |
test= |
|
12 |
test -n "$n" || export n="$tests_n" test=1 # not setting n turns on test mode
|
|
11 |
testMode=
|
|
12 |
test -n "$n" || export n="$tests_n" testMode=1
|
|
13 | 13 |
|
14 | 14 |
. ../util/env_password in_password |
15 | 15 |
|
... | ... | |
18 | 18 |
function trace() |
19 | 19 |
{ |
20 | 20 |
( |
21 |
echo -n "$PS4"
|
|
21 |
env echo -n "$PS4" # bug in sh's built-in echo prints the -n
|
|
22 | 22 |
for arg in "$@"; do printf "%q " "$arg"; done |
23 | 23 |
echo "${_in+<$_in}" "${_out+>$_out}" |
24 | 24 |
) >&2 |
... | ... | |
49 | 49 |
local out="output/$stem${method+.$method}.xml" |
50 | 50 |
local accepted="accepted_output/$stem.xml" |
51 | 51 |
(set -x; ../map "$map" >"$out") || exit # abort tester |
52 |
(set -x; ${test:+diff "$accepted" "$out"}) |
|
52 |
(set -x; ${testMode:+diff "$accepted" "$out"})
|
|
53 | 53 |
true # ignore last command's exit status |
54 | 54 |
} |
55 | 55 |
|
Also available in: Unified diff
Replaced /bin/bash with /bin/sh