diff --git a/vunit/sim_if/ghdl.py b/vunit/sim_if/ghdl.py index 8222efe2d..dff45d4f2 100644 --- a/vunit/sim_if/ghdl.py +++ b/vunit/sim_if/ghdl.py @@ -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 @@ -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) @@ -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()