Skip to content

Commit

Permalink
Fixes #924
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsAsplund committed Feb 25, 2024
1 parent c16718d commit 8a5fa2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions vunit/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def _add_data_types(self, external=None):

for key in ["string", "integer_vector"]:
self._add_files(
pattern=str(VHDL_PATH / "data_types" / "src" / "api" / f"external_{key!s}_pkg.vhd")
if external is None or key not in external or not external[key] or external[key] is True
else external[key],
pattern=(
str(VHDL_PATH / "data_types" / "src" / "api" / f"external_{key!s}_pkg.vhd")
if external is None or key not in external or not external[key] or external[key] is True
else external[key]
),
allow_empty=False,
)

Expand Down
10 changes: 5 additions & 5 deletions vunit/sim_if/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ def merge_coverage(self, file_name, args=None):
"""
Merge coverage from all test cases
"""
output_dir = file_name
output_dir = Path(file_name)
output_dir.mkdir(parents=True, exist_ok=True)

# Loop over each .gcda output folder and merge them two at a time
first_input = True
Expand All @@ -400,8 +401,8 @@ def merge_coverage(self, file_name, args=None):
"gcov-tool",
"merge",
"-o",
output_dir,
coverage_dir if first_input else output_dir,
str(output_dir),
coverage_dir if first_input else str(output_dir),
coverage_dir,
]
subprocess.call(merge_command)
Expand All @@ -410,8 +411,7 @@ def merge_coverage(self, file_name, args=None):
LOGGER.warning("Missing coverage directory: %s", coverage_dir)

# Find actual output path of the .gcda files (they are deep in hierarchy)
dir_path = Path(output_dir)
gcda_dirs = {x.parent for x in dir_path.glob("**/*.gcda")}
gcda_dirs = {x.parent for x in output_dir.glob("**/*.gcda")}
assert len(gcda_dirs) == 1, "Expected exactly one folder with gcda files"
gcda_dir = gcda_dirs.pop()

Expand Down

0 comments on commit 8a5fa2d

Please sign in to comment.