forked from Ezhil-Language-Foundation/open-tamil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unittest2.6
executable file
·49 lines (42 loc) · 887 Bytes
/
unittest2.6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# run unit tests when previous bits passed
cd tests/
if [ -e success26.txt ];
then
rm success26.txt
fi
if [ -e failed26.txt ];
then
rm failed26.txt
fi
touch success26.txt
touch failed26.txt
for i in `ls *.py`
do
echo Running test $i
sleep 1
python2.6 $i
if [ $? -eq 0 ]
then
echo $i >> success26.txt
else
echo $i >> failed26.txt
fi
done
NFAIL=0 #ideally no unittests should fail
TOTFAIL=`wc -l failed26.txt | cut -d'f' -f1`
echo "from sys import exit; exit( $TOTFAIL != $NFAIL )" | python
if [ $? -eq 0 ]
then
echo "Testing Successful!"
exitcode=0 # success
else
echo "Expecting $NFAIL failures, but found $TOTFAIL failures"
echo "Too few/many failures; some negative tests may have failed"
exitcode=255 #failed failures != $NFAIL
fi
# cleanup
rm failed26.txt
rm success26.txt
cd ../
exit $exitcode