@@ -1180,6 +1180,7 @@ def test_suite(argv):
11801180 #----------------------------------------------------------------------
11811181 suite .log .log ("archiving the output..." )
11821182 match_count = 0
1183+ archived_file_list = []
11831184 for pfile in os .listdir (output_dir ):
11841185
11851186 if (os .path .isdir (pfile ) and
@@ -1198,9 +1199,11 @@ def test_suite(argv):
11981199 elif suite .archive_output == 1 :
11991200 # tar it up
12001201 try :
1201- tar = tarfile .open (f"{ pfile } .tgz" , "w:gz" )
1202+ tarfilename = f"{ pfile } .tgz"
1203+ tar = tarfile .open (tarfilename , "w:gz" )
12021204 tar .add (f"{ pfile } " )
12031205 tar .close ()
1206+ archived_file_list .append (tarfilename )
12041207
12051208 except :
12061209 suite .log .warn (f"unable to tar output file { pfile } " )
@@ -1228,11 +1231,19 @@ def test_suite(argv):
12281231 test_successful = (test .return_code == 0 and test .analysis_successful and test .compare_successful )
12291232 if (test .ignore_return_code == 1 or test_successful ):
12301233 if args .clean_testdir :
1234+ # remove subdirectories
12311235 suite .log .log ("removing subdirectories from test directory..." )
12321236 for file_name in os .listdir (output_dir ):
12331237 file_path = os .path .join (output_dir , file_name )
12341238 if os .path .isdir (file_path ):
12351239 shutil .rmtree (file_path )
1240+
1241+ # remove archived plotfiles
1242+ suite .log .log ("removing compressed plotfiles from test directory..." )
1243+ for file_name in archived_file_list :
1244+ file_path = os .path .join (output_dir , file_name )
1245+ os .remove (file_path )
1246+
12361247 # switch to the full test directory
12371248 os .chdir (suite .full_test_dir )
12381249
0 commit comments