Skip to content
Permalink
Browse files

Tidy ups to unit test reporting, first pass at making html report (st…

…ill under construction)

git-svn-id: http://svn.osgeo.org/qgis/trunk@5262 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Apr 11, 2006
1 parent e58150e commit e2d5673e1a975ed9f0db9ef5e0a733fecd60d34f
Showing with 41 additions and 2 deletions.
  1. +41 −2 tests/src/runtests.sh
@@ -1,19 +1,36 @@
#!/bin/bash
#set -x
DIRS=`ls -1F | grep '/$'`

OUTFILE=/tmp/qgistest.`date +%d%h%Y_%H%M`.html
TOTALDIRS=0
TOTALEXES=0
TOTALFAILED=0
TOTALPASSED=0
TOTALSKIPPED=0
echo "<html>" > ${OUTFILE}
echo "<head>" >> ${OUTFILE}
echo "<style type="text/css">" >> ${OUTFILE}
echo "body {background: #5899DB}" >> ${OUTFILE}
echo ".unitSummary {background: #EFEFEF; width: 20em; float:left;}" >> ${OUTFILE}
echo ".moduleSummary {background: #EFEFEF; font-weight: bold; width: 20em; float:left;}" >> ${OUTFILE}
echo ".totalExes {background: #EFEFEF; width: 5em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".totalPasses {background: #EFEFEF; width: 5em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".totalFails {background: #EFEFEF; width: 5em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".totalSkipped {background: #EFEFEF; width: 5em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".{background: #EFEFEF; width: 15em;}" >> ${OUTFILE}
echo "</style>" >> ${OUTFILE}
echo "</head>" >> ${OUTFILE}
echo "<body>" >> ${OUTFILE}
echo "<h1>QGIS Unit Tests : `date +'%d %h %Y : %H%M'`</h1>" >> ${OUTFILE}
for DIR in $DIRS
do
echo "<div class='module'>" >> ${OUTFILE}
echo "<div class='moduleHeader'>Module : ${DIR}</div><br/>" >> ${OUTFILE}
TOTALDIREXES=0
TOTALDIRFAILED=0
TOTALDIRPASSED=0
TOTALDIRSKIPPED=0
LIST=`find $DIR -type f -perm +111 -maxdepth 1 | egrep -v '(\.sh$|\.pl$)'`
LIST=`find $DIR -maxdepth 1 -type f -perm +111 | egrep -v '(\.sh$|\.pl$)'`
for FILE in $LIST
do
RESULT=`${FILE} | grep '^Totals:'`
@@ -28,6 +45,12 @@ do
TOTALPASSED=`expr $TOTALPASSED + $PASSED`
TOTALSKIPPED=`expr $TOTALSKIPPED + $SKIPPED`
TOTALEXES=`expr $TOTALEXES + 1`
echo "<div class="unitSummary">$FILE</div>" >> ${OUTFILE}
echo "<div class="totalExes">&nbsp;</div>" >> ${OUTFILE}
echo "<div class="totalPasses">$PASSED</div>" >> ${OUTFILE}
echo "<div class="totalFails">$FAILED</div>" >> ${OUTFILE}
echo "<div class="totalSkipped">$SKIPPED</div>" >> ${OUTFILE}
echo "<br/>" >> ${OUTFILE}
done
TOTALDIRS=`expr $TOTALDIRS + 1`
echo "-------------------------------"
@@ -37,6 +60,13 @@ do
echo "MODULE TEST CASES PASSED : ${TOTALDIRPASSED}"
echo "MODULE TEST CASES FAILED : ${TOTALDIRFAILED}"
echo "MODULE TEST CASES SKIPPED : ${TOTALDIRSKIPPED}"
echo "<div class="moduleSummary">Totals:</div>" >> ${OUTFILE}
echo "<div class="totalExes">$TOTALDIREXES</div>" >> ${OUTFILE}
echo "<div class="totalPasses">$TOTALDIRPASSED</div>" >> ${OUTFILE}
echo "<div class="totalFails">$TOTALDIRFAILED</div>" >> ${OUTFILE}
echo "<div class="totalSkipped">$TOTALDIRSKIPPED</div>" >> ${OUTFILE}
echo "<br/>" >> ${OUTFILE}
echo "</div><!--end of module -->" >> ${OUTFILE}
done
echo "-------------------------------"
echo " TOTALS :"
@@ -45,3 +75,12 @@ echo "TOTAL TESTS : ${TOTALEXES}"
echo "TOTAL TEST CASES PASSED : ${TOTALPASSED}"
echo "TOTAL TEST CASES FAILED : ${TOTALFAILED}"
echo "TOTAL TEST CASES SKIPPED : ${TOTALSKIPPED}"
echo "<div class="suiteSummary">Totals:</div>" >> ${OUTFILE}
echo "<div class="totalExes">$TOTALEXES</div>" >> ${OUTFILE}
echo "<div class="totalPasses">$TOTALPASSED</div>" >> ${OUTFILE}
echo "<div class="totalFails">$TOTALFAILED</div>" >> ${OUTFILE}
echo "<div class="totalSkipped">$TOTALSKIPPED</div>" >> ${OUTFILE}
echo "<br/>" >> ${OUTFILE}
echo "</body>" >> ${OUTFILE}
echo "</html>" >> ${OUTFILE}
firefox ${OUTFILE}

0 comments on commit e2d5673

Please sign in to comment.
You can’t perform that action at this time.