#!/bin/bash
#
# Copyright 2010-2012 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

set -e -x

# Run the tests
python ./setup.py build test clean

# Only run the python3 tests if available
if [ -x "`which python3`" ]; then
    python3 ./setup.py build test clean
else
    echo "Python 3 not found. Not running Python 3 tests."
fi

# Run the style checks
pyflakes dirspec setup.py
pep8 --repeat . setup.py

