Skip to content

Commit

Permalink
Fix the reference directory to update
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetown committed Mar 3, 2024
1 parent bbb50a4 commit d6e3ab8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_gcovr.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,10 @@ def generate_reference_data(output_pattern): # pragma: no cover


def update_reference_data(reference_file, content, encoding): # pragma: no cover
if CC_REFERENCE in reference_file:
reference_dir = os.path.dirname(reference_file)
else:
reference_dir = os.path.join("reference", CC_REFERENCE)
os.makedirs(reference_dir, exist_ok=True)
reference_file = os.path.join(reference_dir, os.path.basename(reference_file))
reference_dir = REFERENCE_DIRS[0]
os.makedirs(reference_dir, exist_ok=True)
reference_file = os.path.join(reference_dir, os.path.basename(reference_file))

with open(reference_file, "w", newline="", encoding=encoding) as out:
out.write(content)

Expand Down

0 comments on commit d6e3ab8

Please sign in to comment.