Skip to content

Commit

Permalink
update scripts/test-cover-html-plugin.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 19, 2024
1 parent ac0548e commit 1f027e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import-analyzer/
/.mypy_cache/
/plugins
/ui
.coverage
*.coverage
*,cover
htmlcov
*.htmlcov
vulture.*
imports_from_set.json
imports_set.json
Expand Down
21 changes: 16 additions & 5 deletions scripts/test-cover-html-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@ fi
rootDir=$(dirname $(realpath $(dirname "$0")))
echo $rootDir

dataFile="$rootDir/pyglossary/plugins/${pluginLname}.coverage"

outDir="$rootDir/pyglossary/plugins/${pluginLname}.htmlcov"
mkdir -p $outDir
# echo "file://$outDir/index.html"

cd "$rootDir/tests"
coverage run -m unittest "g_${pluginLname}_test.py"
coverage html \
--include="$rootDir/pyglossary/plugins/${pluginLname}.py" \
--include="$rootDir/pyglossary/plugins/${pluginLname}/*.py" ||

set -x
coverage run --data-file="$dataFile" -m unittest "g_${pluginLname}_test.py"
coverage html --data-file="$dataFile" \
--include="$rootDir/pyglossary/plugins/${pluginLname}*" \
--directory=$outDir ||
echo "'coverage html' failed with $?"
set +x

echo "file://$rootDir/tests/htmlcov/index.html"
if [ -f "$outDir/index.html" ]; then
echo "file://$outDir/index.html"
fi

0 comments on commit 1f027e8

Please sign in to comment.