Index: branches/sc_branches/psps_testing/build.sh
===================================================================
--- branches/sc_branches/psps_testing/build.sh	(revision 29235)
+++ branches/sc_branches/psps_testing/build.sh	(revision 29438)
@@ -7,5 +7,10 @@
 
 PYTHON=/usr/bin/python
+UNITTEST_LOG=unittest.log
 COVERAGE=/usr/bin/python-coverage
+DOCUMENTATION=/usr/bin/epydoc
+DOC_FOLDER=documentation
+# Check epydoc available formats
+DOC_FORMAT=html
 
 FILES="testers/__init__.py \
@@ -19,4 +24,5 @@
   utilities/file_manipulation.py \
   utilities/psps_logger.py \
+  utilities/abstract_test_report.py \
   utilities/test_report.py \
   utilities/test_product.py \
@@ -28,8 +34,23 @@
 case "$1" in
     unittest)
+	something_wrong=0
+	/bin/rm -f $UNITTEST_LOG
 	for file in $FILES; do
-	    echo "Unit test for $file ($PYTHON -m doctest $file)"
-	    $PYTHON -m doctest $file
+	    echo -n "Unit test for $file ($PYTHON -m doctest $file): "
+	    $PYTHON -m doctest $file >> $UNITTEST_LOG 2>> $UNITTEST_LOG
+	    status=$?
+	    if [ "$status" -eq "0" ]; then 
+		echo "OK"
+	    else
+		echo "KO"
+		(( something_wrong= $something_wrong + 1 ))
+	    fi
 	done
+	if [ "$something_wrong" -eq "0" ]; then 
+	    echo "All tests pass"
+	else
+	    echo "!!! $something_wrong tests failed"
+	    echo "!!! Look at $UNITTEST_LOG for details"
+	fi
 	;;
     coverage)
@@ -40,4 +61,9 @@
 	echo "### Coverage results ###"
 	$COVERAGE -r -o /usr,$HOME/local -m
+	;;
+    doc|documentation)
+	$DOCUMENTATION -o $DOC_FOLDER --$DOC_FORMAT `find . -name \*.py | grep -v weirdos | grep -v html | grep -v create_simple_fits` -v
+	echo "Documentation is at:"
+	echo "  file://`pwd`/documentation/index.html"
 	;;
     all)
@@ -51,5 +77,5 @@
 	;;
     *)
-	echo "Usage: $0 [ all | unittest | coverage]"
+	echo "Usage: $0 [ all | unittest | coverage | [doc|documentation]]"
 	exit 1
 	;;
