summaryrefslogtreecommitdiff
path: root/tools/proof
diff options
context:
space:
mode:
Diffstat (limited to 'tools/proof')
-rwxr-xr-xtools/proof78
1 files changed, 50 insertions, 28 deletions
diff --git a/tools/proof b/tools/proof
index 284f4e85..00c7f7d1 100755
--- a/tools/proof
+++ b/tools/proof
@@ -2,40 +2,62 @@
set -e
-cd ~/src/ledger
+ledger_proof() {
+ SRC="$1"
+ DEST="$2"
+ LOGDIR="$3"
-VERSION=$(git describe --all --long)
+ cd "$SRC"
+ VERSION=$(git describe --all --long)
-if [[ -f ~/Products/last-proofed && \
- $(< ~/Products/last-proofed) = $VERSION ]]; then
- echo "No need to run tools/proof again"
- exit 0
-fi
+ if [[ -f $DEST/last-proofed && $(< $DEST/last-proofed) = $VERSION ]]; then
+ echo "No need to run tools/proof again"
+ exit 0
+ fi
-rm -fr ~/Products/ledger-proof
+ sudo rm -fr $DEST/ledger-proof
+ date > $LOGDIR/ledger-proof.log
+
+ time nice -n 20 \
+ ./acprep --debug --enable-doxygen --universal --gcc47 -j16 proof 2>&1 | \
+ tee -a $LOGDIR/ledger-proof.log
+
+ time nice -n 20 \
+ ./acprep --debug --enable-doxygen --universal --python --gcc47 -j16 proof 2>&1 | \
+ tee -a $LOGDIR/ledger-proof.log
+
+ time nice -n 20 \
+ ./acprep --debug --enable-doxygen --universal --clang -j16 proof 2>&1 | \
+ tee -a $LOGDIR/ledger-proof.log
+
+ time nice -n 20 \
+ ./acprep --debug --enable-doxygen --universal --python --clang -j16 proof 2>&1 | \
+ tee -a $LOGDIR/ledger-proof.log
+
+ if egrep -q '(ERROR|CRITICAL)' $LOGDIR/ledger-proof.log; then
+ mutt -a $LOGDIR/ledger-proof.log \
+ -s '[ledger] Proof build FAILED' johnw@newartisans.com <<EOF
+Ledger proof build FAILED, at commit $VERSION.
+EOF
+ if [[ "$1" = "--alert" ]]; then
+ notify "Ledger proof build FAILED"
+ else
+ echo "Ledger proof build FAILED"
+ exit 1
+ fi
+ else
+ echo $VERSION > $DEST/last-proofed
-#time nice -n 20 \
-# ./acprep --enable-doxygen --universal -j16 --gcc46 --warn proof 2>&1 | \
-# tee ~/Desktop/proof.log
-time nice -n 20 \
- ./acprep --universal -j16 --gcc46 --warn proof 2>&1 | \
- tee ~/Desktop/proof.log
+ cd $DEST/ledger-proof/debug; make docs
+ cd $DEST/ledger-proof/gcov; make report
-if egrep -q '(ERROR|CRITICAL)' ~/Desktop/proof.log; then
- if [[ "$1" = "--alert" ]]; then
- notify "Ledger proof build FAILED"
- else
- echo "Ledger proof build FAILED"
- exit 1
+ mutt -s '[ledger] Proof build succeeded' johnw@newartisans.com <<EOF
+Ledger proof build succeeded! at commit $VERSION.
+EOF
+ echo "Ledger proof build succeeded"
fi
-else
- echo $VERSION > ~/Products/last-proofed
- mv ~/Desktop/proof.log /tmp
-
- cd ~/Products/ledger-proof/debug; make docs
- cd ~/Products/ledger-proof/gcov; make report
+}
- echo "Ledger proof build succeeded"
-fi
+ledger_proof ${1:-$HOME/src/ledger} ${2:-$HOME/Products} ${3:-$HOME/Library/Logs}
exit 0