proof 1.8 KB

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