test case 4 from wiki page for csqldump tool
[csql.git] / test / genReport.ksh
blob70165f569f44c207e93dc4d593908f3d50cc2c10
1 #!/bin/sh
2 ##################Test Report Generator main starts here##############
4 #TEST_RUN_DIR should be set before running this
5 if [ ! "$TEST_RUN_ROOT" ]
6 then
7 echo "TEST_RUN_ROOT should be set before running the tests"
8 exit 1
9 fi
10 #if [ -s "$TEST_RUN_ROOT" ]
11 #then
12 # echo "TEST_RUN_ROOT directory does not exist. Create it and try again."
13 # exit 1
14 #fi
15 ROOT_DIR=`pwd`
16 TOTALPASSED=0
17 TOTALFAILED=0
18 echo "===================================================================="
19 echo " MODULE TESTPASSED TESTFAILED "
20 echo "===================================================================="
21 while read MODULE
23 echo $MODULE | grep "#" >/dev/null
24 if [ $? -eq 0 ]
25 then
26 continue
28 TEST_RUN_DIR=${TEST_RUN_ROOT}/${MODULE}
29 TEST_LOG=$TEST_RUN_DIR/testlog
30 TESTPASSED=`grep PASSED $TEST_LOG | wc -l`
31 TESTFAILED=`grep FAILED $TEST_LOG | wc -l`
32 printf "%25s\t\t %5d\t\t %5d\t\t\n" $MODULE $TESTPASSED $TESTFAILED
33 (( TOTALPASSED = TOTALPASSED + TESTPASSED ))
34 (( TOTALFAILED = TOTALFAILED + TESTFAILED ))
36 done < TestModules
38 TOTSTRING=TOTAL
39 echo "===================================================================="
40 printf "%25s\t\t %5d\t\t %5d\t\t\n" $TOTSTRING $TOTALPASSED $TOTALFAILED
41 echo "===================================================================="
42 (( TOTALEXECUTED= TOTALPASSED + TOTALFAILED ))
43 echo "TOTAL Executed: $TOTALEXECUTED"
44 exit 0