@@ -77,6 +77,7 @@ def __init__(self, case_name, command_file = "", command_text = "", log_file = "
7777 self .test_status = "SKIPPED"
7878 self .out_root = ""
7979 self .run_flag = False
80+ self .case_workspace = ""
8081
8182
8283def parse_suite_cfg (suite_name , root_path ):
@@ -206,7 +207,8 @@ def run_test_driver(module, single_case_text):
206207 # with open(test_config.command_file, "a+") as f:
207208 # f.write("================= " + single_case_text.name + " ==================\n")
208209 single_case_text .command_text += "================= " + single_case_text .name + " ==================\n "
209- case_workspace = os .path .join (os .path .dirname (single_case_text .result_text ), single_case_text .name )
210+
211+ case_workspace = single_case_text .case_workspace
210212 single_case_text .test_status = ""
211213 ret_val = True
212214 specific_module = ""
@@ -293,7 +295,7 @@ def is_option_supported(option_rule_list):
293295
294296def test_single_case (current_test , single_case_config , workspace , suite_root_path ):
295297 single_case_text = case_text (current_test , os .path .join (workspace , "command.tst" ),"" ,
296- os .path .join (workspace , current_test , current_test + ".lf" ), "" ,
298+ os .path .join (workspace , current_test + ".lf" ), "" ,
297299 os .path .join (workspace , "result.md" ), "" , "" )
298300 module = import_test_driver (suite_root_path )
299301 if single_case_config .platform_rule_list and not is_platform_supported (single_case_config .platform_rule_list ):
@@ -309,6 +311,7 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa
309311 return single_case_text
310312
311313 case_workspace = os .path .join (workspace , current_test )
314+ single_case_text .case_workspace = case_workspace
312315 if not os .path .exists (case_workspace ):
313316 os .makedirs (case_workspace )
314317 os .chdir (workspace )
@@ -320,7 +323,6 @@ def test_single_case(current_test, single_case_config, workspace, suite_root_pa
320323
321324def prepare_test_workspace (root_path , suite_name , opt , case = "" ):
322325 suite_workspace = os .path .join (os .path .abspath (root_path ), suite_name , opt )
323- case_workspace = os .path .join (suite_workspace , case )
324326
325327 if os .path .isdir (suite_workspace ) and not case :
326328 shutil .rmtree (suite_workspace )
0 commit comments