ledger/tools/proof
2011-03-30 14:50:18 -04:00

38 lines
824 B
Bash
Executable file

#!/bin/bash
set -e
cd ~/src/ledger
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
rm -fr ~/Products/ledger-proof
time nice -n 20 \
./acprep --enable-doxygen --universal -j16 --gcc45 --warn proof 2>&1 | \
tee ~/Desktop/proof.log
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
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
exit 0