2018-06-05 13:09:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
err=0
|
|
|
|
|
|
|
|
PYTEST_COV_OPTIONS=
|
|
|
|
BRITNEY=./britney.py
|
|
|
|
|
|
|
|
git clone https://salsa.debian.org/debian/britney2-tests.git britney2-tests
|
|
|
|
|
|
|
|
if [ "x$1" = "x--with-coverage" ]; then
|
|
|
|
PYTEST_COV_OPTIONS="--cov-branch --cov --cov-report="
|
|
|
|
BRITNEY=./ci/britney-coverage.sh
|
2019-01-19 12:37:04 +00:00
|
|
|
TEST_FLAGS=
|
|
|
|
else
|
|
|
|
TEST_FLAGS=nocodestyle
|
2018-06-05 13:09:22 +00:00
|
|
|
fi
|
2019-01-19 12:37:04 +00:00
|
|
|
|
|
|
|
export TEST_FLAGS
|
|
|
|
|
2018-06-05 13:09:22 +00:00
|
|
|
py.test-3 -v $PYTEST_COV_OPTIONS || err=$?
|
2019-01-19 12:37:04 +00:00
|
|
|
|
2018-06-05 13:09:22 +00:00
|
|
|
echo
|
|
|
|
britney2-tests/bin/runtests "$BRITNEY" britney2-tests/t test-out || err=$?
|
|
|
|
|
|
|
|
if [ $err = 0 ] && [ "x$1" = "x--with-coverage" ]; then
|
|
|
|
python3-coverage report -m
|
|
|
|
echo
|
|
|
|
python3-coverage html -d coverage
|
2019-01-05 14:11:19 +00:00
|
|
|
mkdir codestyle
|
2019-01-05 14:52:17 +00:00
|
|
|
pycodestyle --config=setup.cfg britney.py britney2 --show-source --count > codestyle/codestyle.txt || :
|
2018-06-05 13:09:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit $err
|