summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-10-28 13:07:02 -0700
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-02 02:59:35 +0000
commit50962f29295e72bce0c45aef8fb3df9a291f22c0 (patch)
tree88bfc1ddfa951b4209c9d8a7aab905098a048968
parentce17ebb69500530c978767b1389c9e8341acb9bf (diff)
provide a way to limit the UI tests through env
Change-Id: If0af462f20f3541a183e00732944b0650d94639d Reviewed-on: https://gerrit.libreoffice.org/31512 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--uitest/test_main.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/uitest/test_main.py b/uitest/test_main.py
index 498e45d24629..fabb8683d7c6 100644
--- a/uitest/test_main.py
+++ b/uitest/test_main.py
@@ -66,8 +66,12 @@ def get_test_case_classes_of_module(module):
return [ c for c in classes if issubclass(c, UITestCase) ]
def add_tests_for_file(test_file, test_suite):
+ test_name_limit = os.environ.get('UITEST_TEST_NAME', '')
test_loader = unittest.TestLoader()
module_name = os.path.splitext(os.path.split(test_file)[1])[0]
+ if len(test_name_limit) > 0 and not test_name_limit.startswith(module_name):
+ return
+
loader = importlib.machinery.SourceFileLoader(module_name, test_file)
mod = loader.load_module()
classes = get_test_case_classes_of_module(mod)