Revision 175
Added by Aaron Marcuse-Kubitza about 13 years ago
map | ||
---|---|---|
7 | 7 |
|
8 | 8 |
shopt -s nullglob |
9 | 9 |
|
10 |
test -n "$n" || export n=2 |
|
10 |
tests_n=2 |
|
11 |
test= |
|
12 |
test -n "$n" || export n="$tests_n" test=1 # not setting n turns on test mode |
|
13 |
|
|
11 | 14 |
. ../util/env_password in_password |
12 | 15 |
|
13 | 16 |
make --directory=../../mappings |
... | ... | |
45 | 48 |
local stem="$orig_src.$table.$out_fmt" |
46 | 49 |
local out="output/$stem${method+.$method}.xml" |
47 | 50 |
local accepted="accepted_output/$stem.xml" |
48 |
( |
|
49 |
set -x |
|
50 |
../map "$map" >"$out" || exit |
|
51 |
diff "$accepted" "$out" || true # ignore exit status |
|
52 |
) || exit # abort tester |
|
51 |
(set -x; ../map "$map" >"$out") || exit # abort tester |
|
52 |
(set -x; ${test:+diff "$accepted" "$out"}) |
|
53 |
true # ignore last command's exit status |
|
53 | 54 |
} |
54 | 55 |
|
55 | 56 |
function toDb() |
... | ... | |
76 | 77 |
table="${table%%.*}" # before second "." |
77 | 78 |
map toXml |
78 | 79 |
done |
79 |
) || exit |
|
80 |
) || exit # subshell error also interrupts main shell
|
|
80 | 81 |
map toDb # source to VegBank db |
81 | 82 |
done |
Also available in: Unified diff
test/map: Turn off test mode (don't run diff) when env var n (for # rows) is set