From 34b02fde809bca37c76630986c08ea910c547a69 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 5 Mar 2020 11:28:22 -0800 Subject: Add a simple mechanism to skip tests on targets. (#251) --- debug/targets.py | 7 +++++++ debug/testlib.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debug/targets.py b/debug/targets.py index d797f64..f4192b6 100644 --- a/debug/targets.py +++ b/debug/targets.py @@ -84,6 +84,13 @@ class Target: # Supports simultaneous resume through hasel. support_hasel = True + # Tests whose names are mentioned in this list will be skipped and marked + # as not applicable. This is a crude mechanism that can be handy, but in + # general it's better to define some property like those above that + # describe behavior of this target, and tests can use that to decide + # whether they are applicable or not. + skip_tests = [] + # Internal variables: directory = None temporary_files = [] diff --git a/debug/testlib.py b/debug/testlib.py index 6f5c9d5..8a6e402 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -980,7 +980,8 @@ class BaseTest: sys.stdout.flush() - if not self.early_applicable(): + if self.__class__.__name__ in self.target.skip_tests or \ + not self.early_applicable(): return "not_applicable" self.start = time.time() -- cgit v1.1