Skip to content
Snippets Groups Projects
Commit a210c97c authored by Evili del Rio i Silvan's avatar Evili del Rio i Silvan
Browse files

Add coverage support

parent 345242cb
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,14 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath}
#sp-grep -s django && DJANGO_INSTALLED=1
DJANGO_INSTALLED=1
coverage=$(which coverage 2> /dev/null)
if [ -x "${coverage}" ]
then
test_cmd=${coverage}
else
test_cmd=python
fi
if [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALLED" ]; then
set +e
......@@ -38,7 +46,7 @@ if [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALLED" ]; then
python "$MANAGE_FILE" dbshell <<EOF 2>&1 | tee "$TEST_LOG"
CREATE ROLE postgres SUPERUSER;
EOF
python "$MANAGE_FILE" test 2>&1 | tee "$TEST_LOG"
${test_cmd} "$MANAGE_FILE" test 2>&1 | tee "$TEST_LOG"
TEST_STATUS="${PIPESTATUS[0]}"
set -e
......@@ -53,6 +61,10 @@ EOF
exit 1
}
if [ -x "${coverage}" ]
then
${coverage} report 2>&1 | tee "$TEST_LOG"
fi
echo
else
exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment