From 3062ce32ef2c2c8d0a04d94f36e6cb5831395ec4 Mon Sep 17 00:00:00 2001 From: dh00601 <dh00601@surrey.ac.uk> Date: Fri, 3 Jun 2022 14:56:53 +0100 Subject: [PATCH] updated test coverage script --- badges/docstring_coverage.svg | 6 +++--- badges/test_coverage.svg | 4 ++-- commands/generate_docs.sh | 7 +++++-- commands/generate_reports.sh | 17 +++++++++++------ 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/badges/docstring_coverage.svg b/badges/docstring_coverage.svg index ede195758..ea63cd22b 100644 --- a/badges/docstring_coverage.svg +++ b/badges/docstring_coverage.svg @@ -8,13 +8,13 @@ </clipPath> <g clip-path="url(#r)"> <rect width="99" height="20" fill="#555"/> - <rect x="99" width="43" height="20" fill="#4c1"/> + <rect x="99" width="43" height="20" fill="#97CA00"/> <rect width="142" height="20" fill="url(#s)"/> </g> <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="140" transform="scale(.1)" textLength="890">docstr-coverage</text> - <text x="1195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">100%</text> - <text x="1195" y="140" transform="scale(.1)">100%</text> + <text x="1195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">91%</text> + <text x="1195" y="140" transform="scale(.1)">91%</text> </g> </svg> \ No newline at end of file diff --git a/badges/test_coverage.svg b/badges/test_coverage.svg index ffd257bde..a4262d340 100644 --- a/badges/test_coverage.svg +++ b/badges/test_coverage.svg @@ -15,7 +15,7 @@ <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="14">coverage</text> - <text x="80" y="15" fill="#010101" fill-opacity=".3">71%</text> - <text x="80" y="14">71%</text> + <text x="80" y="15" fill="#010101" fill-opacity=".3">69%</text> + <text x="80" y="14">69%</text> </g> </svg> diff --git a/commands/generate_docs.sh b/commands/generate_docs.sh index 22b832eee..af952955d 100755 --- a/commands/generate_docs.sh +++ b/commands/generate_docs.sh @@ -1,12 +1,15 @@ #!/bin/bash - # Script to generate the docs + +# NAME_CURRENT_FILE="`realpath \"$0\"`" DIRNAME_CURRENT_FILE=$(dirname $NAME_CURRENT_FILE) DIRNAME_PROJECT_ROOT=$(dirname $DIRNAME_CURRENT_FILE) -DOCS_DIR="$DIRNAME_PROJECT_ROOT/docs/" +# +DOCS_DIR="$DIRNAME_PROJECT_ROOT/docs/" +# # echo "$NAME_CURRENT_FILE" # echo "$DIRNAME_CURRENT_FILE" # echo "$DIRNAME_PROJECT_ROOT" diff --git a/commands/generate_reports.sh b/commands/generate_reports.sh index 627b6867a..5c3e7ef86 100755 --- a/commands/generate_reports.sh +++ b/commands/generate_reports.sh @@ -1,15 +1,20 @@ #!/bin/bash - # Script to generate the docstring coverage + +# NAME_CURRENT_FILE="`realpath \"$0\"`" DIRNAME_CURRENT_FILE=$(dirname $NAME_CURRENT_FILE) -TESTS_DIR="$DIRNAME_CURRENT_FILE/binarycpython/tests" -REPORTS_DIR="$DIRNAME_CURRENT_FILE/reports" -BADGE_DIR="$DIRNAME_CURRENT_FILE/badges" +DIRNAME_PROJECT_ROOT=$(dirname $DIRNAME_CURRENT_FILE) # +TESTS_DIR="$DIRNAME_PROJECT_ROOT/binarycpython/tests" +REPORTS_DIR="$DIRNAME_PROJECT_ROOT/reports" +BADGE_DIR="$DIRNAME_PROJECT_ROOT/badges" + + # echo "$NAME_CURRENT_FILE" # echo "$DIRNAME_CURRENT_FILE" +# echo "$DIRNAME_PROJECT_ROOT" # echo "$TESTS_DIR" # echo "$REPORTS_DIR" # echo "$BADGE_DIR" @@ -39,6 +44,6 @@ 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 +cd $DIRNAME_PROJECT_ROOT cp "$TEST_COV_DIR/test_coverage.svg" "$BADGE_DIR/test_coverage.svg" -echo "Done" \ No newline at end of file +echo "Done" -- GitLab