From 3387dbdd674ba28caf5a4a28993bf710a6df9470 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Mon, 16 Dec 2024 12:49:37 -0500 Subject: [PATCH] add option to delete executable if test passes --- regtest.py | 4 ++++ test_util.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/regtest.py b/regtest.py index edb824b..f18a4ed 100755 --- a/regtest.py +++ b/regtest.py @@ -1235,6 +1235,10 @@ def test_suite(argv): shutil.rmtree(file_path) # switch to the full test directory os.chdir(suite.full_test_dir) + if args.delete_exe: + suite.log.log("removing executable from test directory...") + os.remove(executable) + #-------------------------------------------------------------------------- # Clean Cmake build and install directories if needed diff --git a/test_util.py b/test_util.py index d0ba0ab..6c66f8a 100644 --- a/test_util.py +++ b/test_util.py @@ -392,6 +392,8 @@ def get_args(arg_string=None): help="log file to write output to (in addition to stdout") suite_options.add_argument("--clean_testdir", action="store_true", help="remove individual test directory after each passed test") + suite_options.add_argument("--delete_exe", action="store_true", + help="remove executable in test directory after each passed test") comp_options = parser.add_argument_group("comparison options", "options that control how the comparisons are done")