test.sh
author Tero Marttila <tero.marttila@aalto.fi>
Mon, 02 Mar 2015 17:58:24 +0200
changeset 689 c258e3ff6d32
parent 683 fcc67f492a02
permissions -rwxr-xr-x
pvl.hosts: update boot= to support split boot.next-server= boot.filename=, which enables inheriting defaults
COVERAGE=opt/bin/coverage
DOCTEST=(
    pvl/dhcp/config.py
    pvl/dns/serial.py
    pvl/dns/labels.py
    pvl/dns/reverse.py
    pvl/dns/generate.py
    pvl/hosts/host.py
)

UNITTEST=(
    pvl.dhcp.tests
    pvl.dns.tests
    pvl.hosts.tests
)

coverage() {
    echo "$ $FUNCNAME $@" >&2

    $COVERAGE "$@"
}

coverage erase

for import in ${UNITTEST[@]}; do
    coverage run -a -m unittest $import
done

for py in ${DOCTEST[@]}; do
    coverage run -a -m doctest $py
done

coverage html \
    --include=pvl/dhcp/*.py,pvl/dns/*.py,pvl/hosts/*.py