[Libreoffice-commits] dev-tools.git: test-bugzilla-files/execute.sh test-bugzilla-files/new-control.py test-bugzilla-files/test-bugzilla-files.py

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Nov 3 08:22:34 PST 2014


 test-bugzilla-files/execute.sh             |    7 ++++---
 test-bugzilla-files/new-control.py         |   14 +++++++++-----
 test-bugzilla-files/test-bugzilla-files.py |    8 ++++----
 3 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit 4c29a00b1877479af42c17e17041189b8852426b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Nov 3 11:19:54 2014 -0500

    fix errors in new version of the script

diff --git a/test-bugzilla-files/execute.sh b/test-bugzilla-files/execute.sh
index e2c6076..46c1bd9 100755
--- a/test-bugzilla-files/execute.sh
+++ b/test-bugzilla-files/execute.sh
@@ -1,4 +1,5 @@
-mkdir /srv/crashtestdata/control/$1
-cd /srv/crashtestdata/control/$1
-TMPDIR=/srv/crashtestdata/tmpdir /home/buildslave/build/instdir/program/python /home/buildslave/source/dev-tools/test-bugzilla-files/test-bugzilla-files.py --soffice=path:/home/buildslave/build/instdir/program/soffice --userdir=file:///home/buildslave/.config/libreoffice_$1/4 $1 2>&1 | tee /srv/crashtestdata/console_$i.log
+dir_name=$(basename $1)
+mkdir /srv/crashtestdata/control/$dir_name
+cd /srv/crashtestdata/control/$dir_name
+TMPDIR=/srv/crashtestdata/tmpdir /home/buildslave/build/instdir/program/python /home/buildslave/source/dev-tools/test-bugzilla-files/test-bugzilla-files.py --soffice=path:/home/buildslave/build/instdir/program/soffice --userdir=file:///home/buildslave/.config/libreoffice_$dir_name/4 $1 2>&1 | tee /srv/crashtestdata/console_$dir_name.log
 rm core*
diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py
index c27cb5f..c278a2a 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -39,12 +39,13 @@ def get_tasks(directory, files_per_task):
         task_file = open(filename, "w")
         for item in list_item:
             task_file.write("%s\n" % item)
-        task_files.append(filename)
+        task_files.append(os.path.join(os.getcwd(),filename))
         i += 1
+    print("number of tasks: " + str(len(task_files)))
     return task_files
 
 def execute_task(task_file):
-    # subprocess.call("./execute.sh " + task_file, shell=True)
+    subprocess.call("./execute.sh " + task_file, shell=True)
     time.sleep(1)
 
 def usage():
@@ -62,12 +63,15 @@ if __name__ == "__main__":
         usage()
         sys.exit()
 
-    for opt, arg in opts:
-        if opt in ("-d", "--directory"):
-            directory = arg
+    if len(args) == 0:
+        usage()
+        sys.exit(1)
+
+    directory = args[0]
 
     print(directory)
     if not os.path.isdir(directory):
+        print("no valid directory")
         sys.exit(1)
 
     task_size = 100
diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index e43e847..e4a5f36 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -72,7 +72,7 @@ def partition(list, pred):
 def getFiles(file_list_name):
     file_list = open(file_list_name, "r")
     files = file_list.readlines()
-    return files
+    return [file.rstrip() for file in files]
 
 ### UNO utilities ###
 
@@ -235,7 +235,7 @@ def mkPropertyValue(name, value):
             name, 0, value, 0)
     de
 
-def getComponent(xDoc)
+def getComponent(xDoc):
     if not xDoc:
         return "None"
 
@@ -393,7 +393,7 @@ def exportDoc(xDoc, filterName, validationCommand, filename, connection):
             
 
 class ExportFileTest:
-    def __init__(self, xDoc, component, filename):
+    def __init__(self, xDoc, filename):
         self.xDoc = xDoc
         self.filename = filename
     def run(self, connection):
@@ -576,7 +576,7 @@ def runLoadFileTests(opts, file_list_name):
         state = State()
 #        print("before map")
         files = []
-        files.extend(getFiles(file_list_name))
+        files.extend(getFiles(file_list_name[0]))
         files.sort()
         tests.extend( (LoadFileTest(file, state) for file in files) )
         runConnectionTests(connection, simpleInvoke, tests)


More information about the Libreoffice-commits mailing list