From 664f09111e0f90cd1c69cbc4f0505a25fb07ca7d Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 17 Dec 2024 20:11:58 -0800 Subject: [PATCH] feat: Pass original_dname to tests, copy test files --- benchmark/benchmark.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index f3d706c00..0792db2c4 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -788,7 +788,7 @@ def run_test_real( break try: - errors = run_unit_tests(testdir, history_fname, test_files) + errors = run_unit_tests(original_dname, testdir, history_fname, test_files) except subprocess.TimeoutExpired: errors = "Tests timed out!" timeouts += 1 @@ -847,7 +847,7 @@ def run_test_real( return results -def run_unit_tests(testdir, history_fname, test_files): +def run_unit_tests(original_dname, testdir, history_fname, test_files): timeout = 60 # Map of file extensions to test commands @@ -871,6 +871,15 @@ def run_unit_tests(testdir, history_fname, test_files): if not command: raise ValueError(f"No test command found for files with extensions: {extensions}") + + # Copy test files from original directory + for file_path in test_files: + src = original_dname / testdir.name / file_path + dst = testdir / file_path + if src.exists(): + os.makedirs(dst.parent, exist_ok=True) + shutil.copy(src, dst) + print(" ".join(command)) result = subprocess.run(