improve unit tests in benchmark

This commit is contained in:
Paul Gauthier 2025-02-06 16:27:29 -08:00
parent 71ac7efafe
commit 6118d91922

View file

@ -964,9 +964,10 @@ def run_unit_tests(original_dname, testdir, history_fname, test_files):
# Copy test files from original directory
for file_path in test_files:
src = original_dname / testdir.name / file_path
src = original_dname / Path(*testdir.parts[-4:]) / file_path
dst = testdir / file_path
if src.exists():
print("copying", src, dst)
os.makedirs(dst.parent, exist_ok=True)
shutil.copy(src, dst)
@ -988,6 +989,8 @@ def run_unit_tests(original_dname, testdir, history_fname, test_files):
text=True,
timeout=timeout,
cwd=testdir,
encoding="utf-8",
errors="replace",
)
success = result.returncode == 0