Commit 859c2948 authored by Taddeus Kroes's avatar Taddeus Kroes

Fixed coverage in Makefile.

parent a350c6f1
TESTS=$(wildcard tests/test_*.py)
COVERAGE_OUTPUT_DIR := coverage
OMIT := --omit /usr/share/pyshared/*
OMIT := /usr/share/pyshared/*
RM=rm -rf
ifeq ($(findstring python-coverage,$(wildcard /usr/bin/*)), python-coverage)
COVERAGE=/usr/bin/python-coverage
......@@ -12,15 +13,28 @@ endif
test: $(TESTS) build
ifeq ($(findstring python-coverage,$(wildcard /usr/bin/*)), python-coverage)
coverage: ${COVERAGE} build
${COVERAGE} erase
${RM} ${COVERAGE_OUTPUT_DIR}/*
mkdir ${COVERAGE_OUTPUT_DIR} 2>/dev/null || true
for t in ${TESTS}; do \
echo $$t; \
${COVERAGE} -x test.py $$t; \
${COVERAGE} combine; \
done
${COVERAGE} html --omit=${OMIT} -d ${COVERAGE_OUTPUT_DIR}
else
coverage: ${COVERAGE} build
mkdir ${COVERAGE_OUTPUT_DIR} 2>/dev/null || true
${COVERAGE} erase
for t in ${TESTS}; do \
echo $$t; \
${COVERAGE} ${OMIT} -x test.py $$t; \
${COVERAGE} ${OMIT} -c; \
${COVERAGE} --omit ${OMIT} -x test.py $$t; \
${COVERAGE} --omit ${OMIT} -c; \
done
${COVERAGE} html ${OMIT} --dir ${COVERAGE_OUTPUT_DIR}
${COVERAGE} html --omit ${OMIT} --dir ${COVERAGE_OUTPUT_DIR}
endif
${COVERAGE}:
@echo "Install package 'python-coverage' to generate a coverage report."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment