[Libreoffice-commits] dev-tools.git: uitest/mass-testing

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue May 12 11:08:30 UTC 2020


 uitest/mass-testing/run.py |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit deb8069cb7b5110b6eb59e87df8e5b789fabde77
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue May 12 13:03:46 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue May 12 13:03:46 2020 +0200

    mass-uitesting: fix uitest and soffice pathes
    
    so it can be executed without having the whole LibreOffice codebase
    
    Change-Id: I795ac5b9736e1b5ab90bea011f41b01d28f11c4a

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 7f9efab..92cf32e 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -61,7 +61,7 @@ def get_file_names(filesPath):
 
     return auxNames
 
-def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
+def run_tests_and_get_results(sofficePath, listFiles, isDebug, isResume):
 
     results = {
         'pass' : 0,
@@ -69,7 +69,6 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
         'timeout' : 0,
         'skip' : 0}
 
-    sofficePath = liboPath + "instdir/program/soffice"
     process = Popen([sofficePath, "--version"], stdout=PIPE, stderr=PIPE)
     stdout = process.communicate()[0].decode("utf-8")
     sourceHash = stdout.split(" ")[2].strip()
@@ -121,7 +120,7 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
             os.environ["TESTFILENAME"] = fileName
 
             process = Popen(["python3",
-                        liboPath + "uitest/test_main.py",
+                        './uitest/test_main.py',
                         "--debug",
                         "--soffice=path:" + sofficePath,
                         "--userdir=file://" + profilePath,
@@ -225,6 +224,13 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
         print("No test run!")
 
 if __name__ == '__main__':
+    currentPath = os.path.dirname(os.path.realpath(__file__))
+    uitestPath = os.path.join(currentPath, 'uitest/test_main.py')
+    if not os.path.exists(uitestPath):
+        print("ERROR: " + uitestPath + " doesn't exists. " + \
+                "Copy uitest folder from LibreOffice codebase and paste it here")
+        sys.exit(1)
+
     parser = DefaultHelpParser()
 
     parser.add_argument(
@@ -242,12 +248,12 @@ if __name__ == '__main__':
     if not os.path.exists(filesPath):
         parser.error(filesPath + " is an invalid directory path")
 
-    liboPath = os.path.join(argument.soffice, '')
-    if not os.path.exists(liboPath) or not os.path.exists(liboPath + "instdir/program/"):
-        parser.error(liboPath + " is an invalid LibreOffice path")
+    sofficePath = argument.soffice
+    if not os.path.exists(sofficePath) or not sofficePath.endswith('/soffice'):
+        parser.error(sofficePath + " is an invalid LibreOffice path")
 
-    os.environ["PYTHONPATH"] = liboPath + "instdir/program/"
-    os.environ["URE_BOOTSTRAP"] = "file://" + liboPath + "instdir/program/fundamentalrc"
+    os.environ["PYTHONPATH"] = sofficePath.split('/soffice')[0]
+    os.environ["URE_BOOTSTRAP"] = "file://" + sofficePath.split('/soffice')[0] + '/fundamentalrc'
     os.environ["SAL_USE_VCLPLUGIN"] = "gen"
 
     if not os.path.exists('./logs'):
@@ -258,6 +264,6 @@ if __name__ == '__main__':
     listFiles = get_file_names(filesPath)
     listFiles.sort()
 
-    run_tests_and_get_results(liboPath, listFiles, argument.debug, argument.resume)
+    run_tests_and_get_results(sofficePath, listFiles, argument.debug, argument.resume)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list