2015-09-17 00:38:52 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# script/test: Run test suite for application. Optionallly pass in a path to an
|
|
|
|
# individual test file to run a single test.
|
|
|
|
|
2015-09-17 00:35:26 -07:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2015-09-17 09:08:58 -07:00
|
|
|
script/lint
|
|
|
|
|
2015-09-20 11:00:35 -07:00
|
|
|
LINT_STATUS=$?
|
2015-09-19 12:29:23 -07:00
|
|
|
|
2015-09-17 00:35:26 -07:00
|
|
|
echo "Running tests..."
|
2015-01-17 14:32:33 -08:00
|
|
|
|
2015-04-28 19:12:05 -07:00
|
|
|
if [ "$1" = "coverage" ]; then
|
2015-09-19 12:29:23 -07:00
|
|
|
py.test --cov --cov-report=
|
2015-09-20 11:00:35 -07:00
|
|
|
TEST_STATUS=$?
|
2015-09-19 12:29:23 -07:00
|
|
|
else
|
|
|
|
py.test
|
2015-09-20 11:00:35 -07:00
|
|
|
TEST_STATUS=$?
|
2015-09-19 12:29:23 -07:00
|
|
|
fi
|
|
|
|
|
2015-09-20 11:00:35 -07:00
|
|
|
if [ $LINT_STATUS -eq 0 ]
|
2015-09-19 12:29:23 -07:00
|
|
|
then
|
2015-09-20 11:00:35 -07:00
|
|
|
exit $TEST_STATUS
|
2015-04-28 19:12:05 -07:00
|
|
|
else
|
2015-09-20 11:00:35 -07:00
|
|
|
exit $LINT_STATUS
|
2015-04-28 19:12:05 -07:00
|
|
|
fi
|