[Libreoffice-commits] core.git: uitest/test_main.py

Miklos Vajna vmiklos at collabora.co.uk
Tue Feb 6 09:54:23 UTC 2018


 uitest/test_main.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 420b80a7d63f77bec324fae72fa1e3d07954bdfa
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 5 15:33:29 2018 +0100

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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)
 


More information about the Libreoffice-commits mailing list