cvscheck.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. #
  3. # checkout lame
  4. # run python scripts
  5. # mail output
  6. #
  7. CVS_RSH=/home/mt/bin/sshcvs
  8. LAME_DIR=/home/mt/mp3/lame_cvscheck
  9. TESTCASE=/home/mt/mp3/test/castanets.wav
  10. export OUTPUT=/tmp/cvscheck.out
  11. export TO="lame-cvs@lists.sourceforge.net"
  12. cd ${LAME_DIR}
  13. #cvs -z3 -dmarkt@cvs.lame.sourceforge.net:/cvsroot/lame co -d lame_cvscheck lame
  14. cvs update -P -d
  15. if [ $? != 0 ]; then
  16. echo "Error running CVS update. cvscheck script exiting."
  17. exit 1
  18. fi
  19. if [ -f ${OUTPUT} ]; then
  20. mv -f ${OUTPUT} ${OUTPUT}.old
  21. fi
  22. rm -f frontend/lame
  23. rm -f config.cache
  24. ./configure --enable-debug
  25. make clean
  26. make
  27. if [ $? != 0 ]; then
  28. echo "Error compiling code..." > ${OUTPUT}
  29. else
  30. test/lametest.py test/CBRABR.op ${TESTCASE} frontend/lame > ${OUTPUT}
  31. fi
  32. # check if there are failed tests
  33. if grep >/dev/null 2>&1 "Number of tests which failed: 0" ${OUTPUT} ; then
  34. echo "No failed tests."
  35. else
  36. # yes, failed tests, send output
  37. if diff >/dev/null 2>&1 -bBiq ${OUTPUT}.old ${OUTPUT} ; then
  38. export MSG='No change since last failed test(s).'
  39. else
  40. export MSG='Another change since last failed test(s)!'
  41. cat ${OUTPUT}; echo "${MSG}"
  42. fi
  43. ( cat ${OUTPUT}; echo "${MSG}" ) | mail -s "Automated lame test" ${TO}
  44. fi