Skip to content

Commit

Permalink
tests: Add coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer committed May 14, 2019
1 parent b93f971 commit 2ff415c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ version
*.swn
*.swp
*.pyc
.coverage
6 changes: 5 additions & 1 deletion Makefile
@@ -1,4 +1,4 @@
.PHONY: lint test install uninstall clean version
.PHONY: lint test coverage install uninstall clean version

# major.minor part of version of this release
# TODO inject it into .vdf files, so manual tweak won't be
Expand All @@ -21,12 +21,16 @@ steam_dir = ${HOME}/.local/share/Steam
install_dir = $(steam_dir)/compatibilitytools.d/$(tool_dir)

lint:
shellcheck $(shell find . -name *.sh)
pycodestyle-3 run_dosbox *.py tests/*.py
pylint run_dosbox *.py tests/*.py

test:
python3 -m unittest discover -v -s tests

coverage:
./tests/coverage-report.sh

version:
git describe --tags --dirty --long > version

Expand Down
8 changes: 8 additions & 0 deletions tests/coverage-report.sh
@@ -0,0 +1,8 @@
#!/bin/env bash

cd "$(git rev-parse --show-toplevel)" || exit
coverage3 erase
for tfile in tests/test_*.py ; do
PYTHONPATH=. coverage3 run "$tfile"
done
coverage3 report --fail-under=25 "$@"

0 comments on commit 2ff415c

Please sign in to comment.