diff options
Diffstat (limited to 'cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py')
-rw-r--r-- | cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py b/cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py index 197803b969c7..5d976ea98145 100644 --- a/cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py +++ b/cross-project-tests/debuginfo-tests/dexter/dex/tools/TestToolBase.py @@ -46,10 +46,8 @@ class TestToolBase(ToolBase): '--results-directory', type=str, metavar='<directory>', - default=os.path.abspath( - os.path.join(get_root_directory(), '..', 'results', - datetime.now().strftime('%Y-%m-%d-%H%M-%S'))), - help='directory to save results') + default=None, + help='directory to save results (default: none)') def handle_options(self, defaults): options = self.context.options @@ -86,14 +84,15 @@ class TestToolBase(ToolBase): '<d>could not find test path</> <r>"{}"</>'.format( options.test_path)) - options.results_directory = os.path.abspath(options.results_directory) - if not os.path.isdir(options.results_directory): - try: - os.makedirs(options.results_directory, exist_ok=True) - except OSError as e: - raise Error( - '<d>could not create directory</> <r>"{}"</> <y>({})</>'. - format(options.results_directory, e.strerror)) + if options.results_directory: + options.results_directory = os.path.abspath(options.results_directory) + if not os.path.isdir(options.results_directory): + try: + os.makedirs(options.results_directory, exist_ok=True) + except OSError as e: + raise Error( + '<d>could not create directory</> <r>"{}"</> <y>({})</>'. + format(options.results_directory, e.strerror)) def go(self) -> ReturnCode: # noqa options = self.context.options |