-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_generate_all
executable file
·47 lines (40 loc) · 1.11 KB
/
test_generate_all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# Generate a full set of output files from the data. This is intended to be
# used to allow testing larger changes to the code or data - a before and an
# after dataset can be generated and diffed.
#
# In order to allow diffing, some files are pretty printed and/or sorted
# (Eg: the json_payments output) which may render that data file unusable
# for any normal use.
#
# An example use:
#
# ./test_generate_all 1
# ## make a lot of changes
# ./test_generate_all 2
# git diff --no-index --word-diff=color 1 2
#
OUTDIR="$1"
if [ -z "$OUTDIR" ]; then
echo Please provide output dir
exit 1
fi
shift
mkdir -p "$OUTDIR"
SIMPLE="topay make_balance grid party sum topay_html stats statstsv csv roundtrip"
NOSPLIT="csv roundtrip report_location"
FUTURE="grid csv roundtrip"
JSON=json_payments
for i in $SIMPLE; do
./balance.py --split $i >$OUTDIR/$i
done
for i in $NOSPLIT; do
./balance.py --nosplit $i >$OUTDIR/$i.nosplit
done
for i in $FUTURE; do
./balance.py --includefuture $i >$OUTDIR/$i.future
done
for i in $JSON; do
./balance.py --split $i |json_pp |sort |sed -e 's/,$//' >$OUTDIR/$i
done