Skip to content

Commit a600f0c

Browse files
authored
Issue253 coverage (#564)
* add coverage script from Mans with changes based on review in #315 #243 * add unit-test and fix minor bug * Catch case for no examples
1 parent eb44eaa commit a600f0c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

buildingspy/CHANGES.txt

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ BuildingsPy Changelog
44
Version 5.2.0, xxxx
55
^^^^^^^^^^^^^^^^^^^
66

7+
- In buildingspy/development/regressiontest.py, add option to get the coverage
8+
rate, i.e., what percentage of examples are covered by regression tests.
9+
(https://github.com/lbl-srg/BuildingsPy/issues/253)
710
- In buildingspy/development/regressiontest.py, add option to create reference
811
results in batch mode.
912
(https://github.com/lbl-srg/BuildingsPy/issues/560)

buildingspy/development/regressiontest.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ def getModelicaCommand(self):
597597
elif self._modelica_tool != 'dymola':
598598
return 'jm_ipython.sh'
599599
else:
600-
return "C://Program Files//Dymola 2023x//bin64//Dymola"
601600
return self._modelica_tool
602601

603602
def isExecutable(self, program):
@@ -4355,7 +4354,7 @@ def getCoverage(self):
43554354
) and not filepath.endswith(('package.mo', '.order')):
43564355
all_examples.append(filepath)
43574356

4358-
n_tested_examples = len(temp_data)
4357+
n_tested_examples = len(self._data)
43594358
n_examples = len(all_examples)
43604359
if n_examples > 0:
43614360
coverage = round(n_tested_examples / n_examples, 2) * 100

0 commit comments

Comments
 (0)