diff --git a/regtest.py b/regtest.py index a5acf26..b1a629b 100755 --- a/regtest.py +++ b/regtest.py @@ -1225,15 +1225,12 @@ def test_suite(argv): #---------------------------------------------------------------------- # if test ran and passed, remove test directory if requested #---------------------------------------------------------------------- - if (test.ignore_return_code == 1 or test.return_code == 0): + test_successful = (test.return_code == 0 and test.analysis_successful and test.compare_successful) + if (test.ignore_return_code == 1 or test_successful): if args.rm_testdir: - suite.log.log("removing subdirectories in test directory...") + suite.log.log("removing subdirectories from test directory...") for file_name in os.listdir(output_dir): file_path = os.path.join(output_dir, file_name) - #if os.path.isfile(file_path) or os.path.islink(file_path): - # os.unlink(file_path) - #elif os.path.isdir(file_path): - # shutil.rmtree(file_path) if os.path.isdir(file_path): shutil.rmtree(file_path) # switch to the full test directory