try coverage
This commit is contained in:
14
tests/get_coverage_percent.py
Normal file
14
tests/get_coverage_percent.py
Normal file
@@ -0,0 +1,14 @@
|
||||
with open(file="coverage.xml") as file:
|
||||
file_content = file.readlines()
|
||||
|
||||
line_rate = None
|
||||
|
||||
for line in file_content:
|
||||
try:
|
||||
line = line.strip().split("<")[1].split(">")[0].split(" ")
|
||||
if line[0] == "package":
|
||||
line_rate = "Code coverage: " + str(int(round(float(line[2].split("=\"")[1].split("\"")[0])*100, 0))) + "%"
|
||||
except:
|
||||
pass
|
||||
|
||||
print(line_rate)
|
||||
@@ -5,4 +5,5 @@ sh tests/start_tests.sh
|
||||
|
||||
cp tests/coverage/coverage.xml ./coverage.xml
|
||||
cp tests/coverage/report.xml ./report.xml
|
||||
# python3.10 tests/edit_source.py
|
||||
|
||||
python3.10 tests/get_coverage_percent.py
|
||||
|
||||
Reference in New Issue
Block a user