Debian Codegraph @

test/cvscheck.sh

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