diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-19 16:07:21 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-19 16:07:21 -0600 |
commit | 409041aec6502431dccfa23b04817cbcdd782145 (patch) | |
tree | a43cb2f3dd4e78e1aaa066a30b2913a1ebfb0e41 /tools | |
parent | c99cfc8024d7d457aa89dda02a898e0a638d0f26 (diff) | |
download | fork-ledger-409041aec6502431dccfa23b04817cbcdd782145.tar.gz fork-ledger-409041aec6502431dccfa23b04817cbcdd782145.tar.bz2 fork-ledger-409041aec6502431dccfa23b04817cbcdd782145.zip |
Updated tools/proof
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/proof | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/tools/proof b/tools/proof index 284f4e85..30627d65 100755 --- a/tools/proof +++ b/tools/proof @@ -2,40 +2,41 @@ 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 + rm -fr $DEST/ledger-proof -#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 + time nice -n 20 \ + ./acprep --enable-doxygen --universal -j16 --gcc46 --warn proof 2>&1 | \ + tee $LOGDIR/ledger-proof.log -if egrep -q '(ERROR|CRITICAL)' ~/Desktop/proof.log; then - if [[ "$1" = "--alert" ]]; then - notify "Ledger proof build FAILED" + if egrep -q '(ERROR|CRITICAL)' $LOGDIR/ledger-proof.log; then + if [[ "$1" = "--alert" ]]; then + notify "Ledger proof build FAILED" + else + echo "Ledger proof build FAILED" + exit 1 + fi else - echo "Ledger proof build FAILED" - exit 1 - fi -else - echo $VERSION > ~/Products/last-proofed - mv ~/Desktop/proof.log /tmp + echo $VERSION > $DEST/last-proofed - cd ~/Products/ledger-proof/debug; make docs - cd ~/Products/ledger-proof/gcov; make report + cd $DEST/ledger-proof/debug; make docs + cd $DEST/ledger-proof/gcov; make report - echo "Ledger proof build succeeded" -fi + echo "Ledger proof build succeeded" + fi +} -exit 0 +ledger_proof ${1:-$HOME/src/ledger} \ + ${2:-$HOME/Products) ${3:-$HOME/Library/Logs}
\ No newline at end of file |