diff options
author | Simon Glass <sjg@chromium.org> | 2025-04-29 07:22:10 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2025-05-27 10:07:41 +0100 |
commit | eca46538358a6e75f1d82bff81720a09050c09f9 (patch) | |
tree | e274b129c3fdcbca032673855fd63583cbace839 /tools/patman/func_test.py | |
parent | 6e64ae22c2bbb540a8c84193578b8cf0d03f42b9 (diff) |
patman: Support extra test features
Provide support for the -X flag, which preserves the working directory
used by tests. Also support -N which shows captured output for tests.
Finally, allow selection of a particular test to run.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/func_test.py')
-rw-r--r-- | tools/patman/func_test.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 161b5ad4288..85e7b475d90 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -53,6 +53,25 @@ class TestFunctional(unittest.TestCase): mary = 'Mary Bloggs <mary@napierwallies.co.nz>' commits = None patches = None + verbosity = False + preserve_outdirs = False + + @classmethod + def setup_test_args(cls, preserve_indir=False, preserve_outdirs=False, + toolpath=None, verbosity=None, no_capture=False): + """Accept arguments controlling test execution + + Args: + preserve_indir: not used + preserve_outdir: Preserve the output directories used by tests. + Each test has its own, so this is normally only useful when + running a single test. + toolpath: not used + """ + cls.preserve_outdirs = preserve_outdirs + cls.toolpath = toolpath + cls.verbosity = verbosity + cls.no_capture = no_capture def setUp(self): self.tmpdir = tempfile.mkdtemp(prefix='patman.') @@ -60,7 +79,10 @@ class TestFunctional(unittest.TestCase): self.repo = None def tearDown(self): - shutil.rmtree(self.tmpdir) + if self.preserve_outdirs: + print(f'Output dir: {self.tmpdir}') + else: + shutil.rmtree(self.tmpdir) terminal.set_print_test_mode(False) @staticmethod |