-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathregression-test.sh
More file actions
51 lines (45 loc) · 1.12 KB
/
Copy pathregression-test.sh
File metadata and controls
51 lines (45 loc) · 1.12 KB
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
48
49
50
51
#!/bin/bash
CONTRACTS="$@"
if test "${CONTRACTS}" = ""
then
echo "Usage: ./regression-test [contract...]"
echo "One or more .contract files, for example:"
echo "$ ./regression-test examples/*.contract"
exit
fi
for CONTRACT in ${CONTRACTS}; do
echo -n "${CONTRACT}: "
CONTRACT_DIR="$(dirname ${CONTRACT})"
CONTRACT_BASE=${CONTRACT%%.contract}
if test -f ${CONTRACT_BASE}.obsdb.xml
then
OBSDB="--obs-db=${CONTRACT_BASE}.obsdb.xml"
else
OBSDB=;
fi
if test -f "${CONTRACT_DIR}/Units.db.xml"
then
UNITSDB="--units-db=${CONTRACT_DIR}/Units.db.xml"
else
UNITSDB=
fi
if normalise ${UNITSDB} ${OBSDB} ${CONTRACT} ${CONTRACT}.xml --fast \
> normalise-out.log 2>&1
then
echo -n "compiled OK"
if simulate ${CONTRACT}.xml ${CONTRACT_BASE}.timeseries.xml ${CONTRACT_BASE}.out \
> simulate-out.log 2>&1
then
echo ", simulate OK"
cat normalise-out.log
cat simulate-out.log
else
echo ", simulate FAILED:"
cat simulate-out.log
fi
else
echo "compile FAILED:"
cat normalise-out.log
fi
done
rm -f normalise-out.log simulate-out.log