IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 15, 2010, 2:51:13 PM (16 years ago)
Author:
Serge CHASTEL
Message:

Test report now in xml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sc_branches/psps_testing/build.sh

    r29235 r29438  
    77
    88PYTHON=/usr/bin/python
     9UNITTEST_LOG=unittest.log
    910COVERAGE=/usr/bin/python-coverage
     11DOCUMENTATION=/usr/bin/epydoc
     12DOC_FOLDER=documentation
     13# Check epydoc available formats
     14DOC_FORMAT=html
    1015
    1116FILES="testers/__init__.py \
     
    1924  utilities/file_manipulation.py \
    2025  utilities/psps_logger.py \
     26  utilities/abstract_test_report.py \
    2127  utilities/test_report.py \
    2228  utilities/test_product.py \
     
    2834case "$1" in
    2935    unittest)
     36        something_wrong=0
     37        /bin/rm -f $UNITTEST_LOG
    3038        for file in $FILES; do
    31             echo "Unit test for $file ($PYTHON -m doctest $file)"
    32             $PYTHON -m doctest $file
     39            echo -n "Unit test for $file ($PYTHON -m doctest $file): "
     40            $PYTHON -m doctest $file >> $UNITTEST_LOG 2>> $UNITTEST_LOG
     41            status=$?
     42            if [ "$status" -eq "0" ]; then
     43                echo "OK"
     44            else
     45                echo "KO"
     46                (( something_wrong= $something_wrong + 1 ))
     47            fi
    3348        done
     49        if [ "$something_wrong" -eq "0" ]; then
     50            echo "All tests pass"
     51        else
     52            echo "!!! $something_wrong tests failed"
     53            echo "!!! Look at $UNITTEST_LOG for details"
     54        fi
    3455        ;;
    3556    coverage)
     
    4061        echo "### Coverage results ###"
    4162        $COVERAGE -r -o /usr,$HOME/local -m
     63        ;;
     64    doc|documentation)
     65        $DOCUMENTATION -o $DOC_FOLDER --$DOC_FORMAT `find . -name \*.py | grep -v weirdos | grep -v html | grep -v create_simple_fits` -v
     66        echo "Documentation is at:"
     67        echo "  file://`pwd`/documentation/index.html"
    4268        ;;
    4369    all)
     
    5177        ;;
    5278    *)
    53         echo "Usage: $0 [ all | unittest | coverage]"
     79        echo "Usage: $0 [ all | unittest | coverage | [doc|documentation]]"
    5480        exit 1
    5581        ;;
Note: See TracChangeset for help on using the changeset viewer.