64 bit build fix
[csql.git] / test / genReport.ksh
blob946107bbef6e051a722a69096b1f83833f5d77bc
1 #!/bin/ksh
2 ##################Test Report Generator main starts here##############
3 FILE=TestModules
4 #FILE=CacheTestModules
5 if [ $1 = "Cache" ]
6 then
7 FILE=CacheTestModules
8 fi
10 #TEST_RUN_DIR should be set before running this
11 if [ ! "$TEST_RUN_ROOT" ]
12 then
13 echo "TEST_RUN_ROOT should be set before running the tests"
14 exit 1
16 #if [ -s "$TEST_RUN_ROOT" ]
17 #then
18 # echo "TEST_RUN_ROOT directory does not exist. Create it and try again."
19 # exit 1
20 #fi
21 ROOT_DIR=`pwd`
22 TOTALPASSED=0
23 TOTALFAILED=0
24 echo "===================================================================="
25 echo " MODULE TESTPASSED TESTFAILED "
26 echo "===================================================================="
27 while read MODULE
29 echo $MODULE | grep "#" >/dev/null 2>/dev/null
30 if [ $? -eq 0 ]
31 then
32 continue
34 TEST_RUN_DIR=${TEST_RUN_ROOT}/${MODULE}
35 TEST_LOG=$TEST_RUN_DIR/testlog
36 TESTPASSED=`grep PASSED $TEST_LOG 2>/dev/null | wc -l `
37 TESTFAILED=`grep FAILED $TEST_LOG 2>/dev/null | wc -l `
38 printf "%25s\t\t %5d\t\t %5d\t\t\n" $MODULE $TESTPASSED $TESTFAILED
39 (( TOTALPASSED = TOTALPASSED + TESTPASSED ))
40 (( TOTALFAILED = TOTALFAILED + TESTFAILED ))
42 done < $FILE
44 TOTSTRING=TOTAL
45 echo "===================================================================="
46 printf "%25s\t\t %5d\t\t %5d\t\t\n" $TOTSTRING $TOTALPASSED $TOTALFAILED
47 echo "===================================================================="
48 (( TOTALEXECUTED= TOTALPASSED + TOTALFAILED ))
49 echo "TOTAL Executed: $TOTALEXECUTED"
50 exit 0