@@ -35,17 +35,22 @@ def get_generated_tests(self):
35
35
if not ingen_exists (self .task_id ):
36
36
return []
37
37
38
- working_dir = paths .get_cache_path ('export' , 'tests' )
39
- if os .path .exists (working_dir ):
40
- shutil .rmtree (working_dir )
41
- os .makedirs (working_dir )
38
+ temp_package = paths .get_cache_path ('export' , 'tests' )
39
+ if os .path .exists (temp_package ):
40
+ shutil .rmtree (temp_package )
41
+ os .makedirs (temp_package )
42
+ in_dir = os .path .join (temp_package , 'in' )
43
+ prog_dir = os .path .join (temp_package , 'prog' )
44
+ os .makedirs (in_dir )
45
+ shutil .copytree (os .path .join (os .getcwd (), 'prog' ), prog_dir )
42
46
43
47
ingen_path = get_ingen (self .task_id )
48
+ ingen_path = os .path .join (prog_dir , os .path .basename (ingen_path ))
44
49
ingen_exe = compile_ingen (ingen_path , self .args , self .args .weak_compilation_flags )
45
- if not run_ingen (ingen_exe , working_dir ):
50
+ if not run_ingen (ingen_exe , in_dir ):
46
51
util .exit_with_error ('Failed to run ingen.' )
47
52
48
- tests = glob .glob (os .path .join (working_dir , f'{ self .task_id } *.in' ))
53
+ tests = glob .glob (os .path .join (in_dir , f'{ self .task_id } *.in' ))
49
54
return [package_util .extract_test_id (test , self .task_id ) for test in tests ]
50
55
51
56
def copy_package_required_files (self , target_dir : str ):
@@ -85,7 +90,7 @@ def copy_package_required_files(self, target_dir: str):
85
90
if len (tests_to_copy ) > 0 :
86
91
print (util .warning (f'Found { len (tests_to_copy )} tests that are not generated by ingen.' ))
87
92
for test in tests_to_copy :
88
- print (util .warning (f'Coping { os .path .basename (test [1 ])} ...' ))
93
+ print (util .warning (f'Copying { os .path .basename (test [1 ])} ...' ))
89
94
shutil .copy (test [1 ], os .path .join (target_dir , test [0 ], os .path .basename (test [1 ])))
90
95
91
96
def clear_files (self , target_dir : str ):
0 commit comments