summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-02-05 15:33:29 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-02-06 10:54:00 +0100
commit420b80a7d63f77bec324fae72fa1e3d07954bdfa (patch)
tree24bd5d34270c30ee0ba88b855070b833af66b871 /uitest
parent03cee02464f230a2efa67d131c137f32fe540052 (diff)
uitest: improve conditional test suppression to limit by class and by function
Example: make UITest_writerperfect_epubexport UITEST_TEST_NAME="epubexport.EPUBExportTest.testUIComponent" Change-Id: I7960a71574d8d3d9cb06399813c7370700579c3d Reviewed-on: https://gerrit.libreoffice.org/49246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/test_main.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/uitest/test_main.py b/uitest/test_main.py
index fabb8683d7c6..ec4f2071f102 100644
--- a/uitest/test_main.py
+++ b/uitest/test_main.py
@@ -69,8 +69,6 @@ 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()
@@ -78,6 +76,10 @@ def add_tests_for_file(test_file, test_suite):
for c in classes:
test_names = test_loader.getTestCaseNames(c)
for test_name in test_names:
+ full_name = ".".join([module_name, c.__name__, test_name])
+ if len(test_name_limit) > 0 and not test_name_limit.startswith(full_name):
+ continue
+
obj = c(test_name, opts)
test_suite.addTest(obj)