Debian Codegraph @

tools/proof

raw
1 #!/bin/bash
2
3 set -e
4
5 ledger_proof() {
6 SRC="$1"
7 DEST="$2"
8 LOGDIR="$3"
9
10 cd "$SRC"
11 VERSION=$(git describe --all --long)
12
13 if [[ -f $DEST/last-proofed && $(< $DEST/last-proofed) = $VERSION ]]; then
14 echo "No need to run tools/proof again"
15 exit 0
16 fi
17
18 sudo rm -fr $DEST/ledger-proof
19 date > $LOGDIR/ledger-proof.log
20
21 time nice -n 20 \
22 ./acprep --debug --doxygen --compiler=g++-4.7 proof -j16 2>&1 | \
23 tee -a $LOGDIR/ledger-proof-g++-4.7.log
24
25 time nice -n 20 \
26 ./acprep --debug --doxygen --python --compiler=g++-4.7 proof -j16 2>&1 | \
27 tee -a $LOGDIR/ledger-proof-g++-4.7-python.log
28
29 time nice -n 20 \
30 ./acprep --debug --doxygen --compiler=clang-3.1 proof -j16 2>&1 | \
31 tee -a $LOGDIR/ledger-proof-clang-3.1.log
32
33 time nice -n 20 \
34 ./acprep --debug --doxygen --python --compiler=clang-3.1 proof -j16 2>&1 | \
35 tee -a $LOGDIR/ledger-proof-clang-3.1-python.log
36
37 if egrep -q '(ERROR|CRITICAL)' $LOGDIR/ledger-proof.log; then
38 mutt -a $LOGDIR/ledger-proof.log \
39 -s '[ledger] Proof build FAILED' [email protected] <<EOF
40 Ledger proof build FAILED, at commit $VERSION.
41 EOF
42 if [[ "$1" = "--alert" ]]; then
43 notify "Ledger proof build FAILED"
44 else
45 echo "Ledger proof build FAILED"
46 exit 1
47 fi
48 else
49 echo $VERSION > $DEST/last-proofed
50
51 cd $DEST/ledger-proof-python-g++-4.7/debug; make docs
52 cd $DEST/ledger-proof-python-g++-4.7/gcov; make report
53
54 mutt -s '[ledger] Proof build succeeded' [email protected] <<EOF
55 Ledger proof build succeeded! at commit $VERSION.
56 EOF
57 echo "Ledger proof build succeeded"
58 fi
59 }
60
61 ledger_proof ${1:-$HOME/src/ledger} ${2:-$HOME/Products} ${3:-$HOME/Library/Logs}
62
63 exit 0