Skip to content
Snippets Groups Projects
Commit c84cec4f authored by dh00601's avatar dh00601
Browse files

updated routine to generate the reports

parent 62385ee3
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="110"> <g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="110">
<text x="505" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="890">docstr-coverage</text> <text x="505" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="890">docstr-coverage</text>
<text x="505" y="140" transform="scale(.1)" textLength="890">docstr-coverage</text> <text x="505" y="140" transform="scale(.1)" textLength="890">docstr-coverage</text>
<text x="1195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">98%</text> <text x="1195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">96%</text>
<text x="1195" y="140" transform="scale(.1)">98%</text> <text x="1195" y="140" transform="scale(.1)">96%</text>
</g> </g>
</svg> </svg>
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text> <text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
<text x="31.5" y="14">coverage</text> <text x="31.5" y="14">coverage</text>
<text x="80" y="15" fill="#010101" fill-opacity=".3">73%</text> <text x="80" y="15" fill="#010101" fill-opacity=".3">72%</text>
<text x="80" y="14">73%</text> <text x="80" y="14">72%</text>
</g> </g>
</svg> </svg>
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
## Script to generate the docstring coverage ## Script to generate the docstring coverage
NAME_CURRENT_FILE="`realpath \"$0\"`" NAME_CURRENT_FILE="`realpath \"$0\"`"
DIRNAME_CURRENT_FILE=$(dirname $NAME_CURRENT_FILE) DIRNAME_CURRENT_FILE=$(dirname $NAME_CURRENT_FILE)
TESTS_DIR="$DIRNAME_CURRENT_FILE/binarycpython/tests/" TESTS_DIR="$DIRNAME_CURRENT_FILE/binarycpython/tests"
REPORTS_DIR="$DIRNAME_CURRENT_FILE/reports" REPORTS_DIR="$DIRNAME_CURRENT_FILE/reports"
BADGE_DIR="$DIRNAME_CURRENT_FILE/badges"
# #
# echo "$NAME_CURRENT_FILE" # echo "$NAME_CURRENT_FILE"
...@@ -12,23 +13,40 @@ REPORTS_DIR="$DIRNAME_CURRENT_FILE/reports" ...@@ -12,23 +13,40 @@ REPORTS_DIR="$DIRNAME_CURRENT_FILE/reports"
# echo "$TESTS_DIR" # echo "$TESTS_DIR"
# echo "$REPORTS_DIR" # echo "$REPORTS_DIR"
mkdir -p "$REPORTS_DIR" # Create main reports directory
mkdir -p "$REPORTS_DIR" mkdir -p "$REPORTS_DIR"
# Docstring coverage: ## Docstring coverage:
command -v docstr-coverage >/dev/null 2>&1 || { echo >&2 "docstr-coverage is not installed. Aborting."; exit 1; } command -v docstr-coverage >/dev/null 2>&1 || { echo >&2 "docstr-coverage is not installed. Aborting."; exit 1; }
#
echo "Generating docstring report"
DOCSTRING_COV_DIR="$REPORTS_DIR/docstring_coverage" DOCSTRING_COV_DIR="$REPORTS_DIR/docstring_coverage"
mkdir -p "$DOCSTRING_COV_DIR/" mkdir -p "$DOCSTRING_COV_DIR/"
docstr-coverage binarycpython --exclude="$TESTS_DIR/*" -v 3 --badge "$DOCSTRING_COV_DIR/docstring_coverage.svg" > "$DOCSTRING_COV_DIR/docstring_coverage.txt" 2>&1 docstr-coverage binarycpython --exclude="$TESTS_DIR/*" -v 3 --badge "$DOCSTRING_COV_DIR/docstring_coverage.svg" > "$DOCSTRING_COV_DIR/docstring_coverage.txt" 2>&1
cp "$DOCSTRING_COV_DIR/docstring_coverage.svg" "$BADGE_DIR/docstring_coverage.svg"
echo "Done"
## test coverage
command -v coverage >/dev/null 2>&1 || { echo >&2 "coverage is not installed. Aborting."; exit 1; }
command -v coverage-badge >/dev/null 2>&1 || { echo >&2 "coverage-badge is not installed. Aborting."; exit 1; }
echo "Generating test coverage html report"
TEST_COV_DIR="$REPORTS_DIR/test_coverage"
mkdir -p "$TEST_COV_DIR/"
cd $TEST_COV_DIR
coverage run --source=binarycpython "$TESTS_DIR/main.py"
coverage html
coverage-badge > "$TEST_COV_DIR/test_coverage.svg"
cd $DIRNAME_CURRENT_FILE
cp "$TEST_COV_DIR/test_coverage.svg" "$BADGE_DIR/test_coverage.svg"
echo "Done"
# # Go down to the dir # # Go down to the dir
# cd reports/test_coverage && coverage run --source=binarycpython ../../binary_c-python/binarycpython/tests/main.py && coverage-badge > test_coverage.svg # cd reports/test_coverage && coverage run --source=binarycpython ../../binary_c-python/binarycpython/tests/main.py && coverage-badge > test_coverage.svg
# cd ../../ # cd ../../
# # Copy docstring coverage # # Copy docstring coverage
# cp reports/docstring_coverage/docstring_coverage.svg binary_c-python/badges/docstring_coverage.svg
# cp reports/docstring_coverage/docstring_coverage.svg binary_c-python/docs/source/badges/docstring_coverage.svg # cp reports/docstring_coverage/docstring_coverage.svg binary_c-python/docs/source/badges/docstring_coverage.svg
# # Copy test coverage # # Copy test coverage
......
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