Skip to content
Permalink
Browse files

Better formatting for unit test outputs

git-svn-id: http://svn.osgeo.org/qgis/trunk@5263 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Apr 11, 2006
1 parent e2d5673 commit 95cff96d0ce27a58d19ed7abfece964f9774f8fb
Showing with 36 additions and 21 deletions.
  1. +36 −21 tests/src/runtests.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#set -x
DIRS=`ls -1F | grep '/$'`
OUTFILE=/tmp/qgistest.`date +%d%h%Y_%H%M`.html
OUTFILE=/tmp/qgistest.`date +%d%h%Y_%Hh%M`.html
TOTALDIRS=0
TOTALEXES=0
TOTALFAILED=0
@@ -10,18 +10,32 @@ TOTALSKIPPED=0
echo "<html>" > ${OUTFILE}
echo "<head>" >> ${OUTFILE}
echo "<style type="text/css">" >> ${OUTFILE}
echo "body {background: #5899DB}" >> ${OUTFILE}
echo "body {background: white}" >> ${OUTFILE}
echo "h1 {text-align: center;}" >> ${OUTFILE}
echo "h2 {text-align: center;}" >> ${OUTFILE}
echo ".module {background: #FF9D4D; width: 32em;}" >> ${OUTFILE}
echo ".suiteSummary {background: #F9E5D5; font-weight: bold; width: 20em; float:left;}" >> ${OUTFILE}
echo ".moduleHeader {background: #EB6E08; font-size: bigger; font-weight: bold; text-align: center; width: 32em; margin-top: 1em; margin-bottom: 0em; }" >> ${OUTFILE}
echo ".moduleSummary {background: #FCBA82; font-weight: bold; width: 20em; float:left;}" >> ${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 ".unitSummaryFailed {background: #EFEFEF; color: crimson; width: 20em; float:left;}" >> ${OUTFILE}
echo ".unitTotalExes {background: #EFEFEF; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".unitTotalPasses {background: #EFEFEF; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".unitTotalFails {background: #EFEFEF; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".unitTotalSkipped {background: #EFEFEF; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".moduleTotalExes {background: #FCBA82; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".moduleTotalPasses {background: #FCBA82; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".moduleTotalFails {background: #FCBA82; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".moduleTotalSkipped {background: #FCBA82; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".suiteTotalExes {background: #FF9946; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".suiteTotalPasses {background: #FF9946; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".suiteTotalFails {background: #FF9946; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo ".suiteTotalSkipped {background: #FF9946; width: 3em; text-align: center; float:left;}" >> ${OUTFILE}
echo "</style>" >> ${OUTFILE}
echo "</head>" >> ${OUTFILE}
echo "<body>" >> ${OUTFILE}
echo "<h1>QGIS Unit Tests : `date +'%d %h %Y : %H%M'`</h1>" >> ${OUTFILE}
echo "<h1>QGIS Unit Tests</h1>" >> ${OUTFILE}
echo "<h2>`date +'%d %h %Y : %H%M'`</h2>" >> ${OUTFILE}
for DIR in $DIRS
do
echo "<div class='module'>" >> ${OUTFILE}
@@ -46,10 +60,10 @@ do
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 "<div class="unitTotalExes">&nbsp;</div>" >> ${OUTFILE}
echo "<div class="unitTotalPasses">$PASSED</div>" >> ${OUTFILE}
echo "<div class="unitTotalFails">$FAILED</div>" >> ${OUTFILE}
echo "<div class="unitTotalSkipped">$SKIPPED</div>" >> ${OUTFILE}
echo "<br/>" >> ${OUTFILE}
done
TOTALDIRS=`expr $TOTALDIRS + 1`
@@ -61,10 +75,10 @@ do
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 "<div class="moduleTotalExes">$TOTALDIREXES</div>" >> ${OUTFILE}
echo "<div class="moduleTotalPasses">$TOTALDIRPASSED</div>" >> ${OUTFILE}
echo "<div class="moduleTotalFails">$TOTALDIRFAILED</div>" >> ${OUTFILE}
echo "<div class="moduleTotalSkipped">$TOTALDIRSKIPPED</div>" >> ${OUTFILE}
echo "<br/>" >> ${OUTFILE}
echo "</div><!--end of module -->" >> ${OUTFILE}
done
@@ -75,11 +89,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='moduleHeader'>Global Summary:</div><br/>" >> ${OUTFILE}
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 "<div class="suiteTotalExes">$TOTALEXES</div>" >> ${OUTFILE}
echo "<div class="suiteTotalPasses">$TOTALPASSED</div>" >> ${OUTFILE}
echo "<div class="suiteTotalFails">$TOTALFAILED</div>" >> ${OUTFILE}
echo "<div class="suiteTotalSkipped">$TOTALSKIPPED</div>" >> ${OUTFILE}
echo "<br/>" >> ${OUTFILE}
echo "</body>" >> ${OUTFILE}
echo "</html>" >> ${OUTFILE}

0 comments on commit 95cff96

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