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

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Jun 1 18:18:54 PDT 2014


 test-bugzilla-files/control.py     |    3 +-
 test-bugzilla-files/execute.sh     |    4 +++
 test-bugzilla-files/new-control.py |   47 +++++++++++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+), 1 deletion(-)

New commits:
commit d3627e1c062bcc4456bc55d2189d2917ad569bf7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 2 03:16:33 2014 +0200

    extract output for all directories to own file

diff --git a/test-bugzilla-files/control.py b/test-bugzilla-files/control.py
index 05a6df9..8c2c90c 100755
--- a/test-bugzilla-files/control.py
+++ b/test-bugzilla-files/control.py
@@ -55,6 +55,7 @@ def parseArgs(argv):
 def usage():
     message = """usage: {program} [option]"
 -h | --help: print usage information
+--calc: test all files
 --calc: test calc files
 --writer: test writer files
 --impress: test impress files
@@ -71,7 +72,7 @@ if __name__ == "__main__":
     elif len(opts) == 0:
         usage()
         sys.exit()
-    elif "--writer" in opts or "--calc" in opts or "--impress" in opts or "--draw" in opts or "--reverse" in opts:
+    elif "--writer" in opts or "--calc" in opts or "--impress" in opts or "--draw" in opts or "--reverse" in opts or "--all" in opts:
         print(os.getcwd())
         print(os.listdir(os.getcwd()))
         execute_scripts(opts)
diff --git a/test-bugzilla-files/execute.sh b/test-bugzilla-files/execute.sh
index 35ab47b..9203a7e 100755
--- a/test-bugzilla-files/execute.sh
+++ b/test-bugzilla-files/execute.sh
@@ -1,4 +1,4 @@
 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 /home/buildslave/source/bugdocs3/$1 2>&1 | tee console.log
+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 /home/buildslave/source/bugdocs3/$1 2>&1 | tee /srv/crashtestdata/console_$i.log
 rm core*
commit 351ed047549da7231d97f4c5d83e74910ecba593
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 2 03:14:17 2014 +0200

    add new control script for crash testing

diff --git a/test-bugzilla-files/execute.sh b/test-bugzilla-files/execute.sh
new file mode 100755
index 0000000..35ab47b
--- /dev/null
+++ b/test-bugzilla-files/execute.sh
@@ -0,0 +1,4 @@
+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 /home/buildslave/source/bugdocs3/$1 2>&1 | tee console.log
+rm core*
diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py
new file mode 100644
index 0000000..cf9b4c9
--- /dev/null
+++ b/test-bugzilla-files/new-control.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+# Libreoffice test-bugzilla-files control script
+# Copyright (C) 2014  Markus Mohrhard
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import os.path
+import concurrent.futures
+import urllib.request
+import time
+import subprocess
+
+def get_directories():
+    d='.'
+    directories = [o for o in os.listdir(d) if os.path.isdir(os.path.join(d,o))]
+    return directories
+
+def execute_task(directory):
+    print("Yeah")
+    print(directory)
+    subprocess.call("./execute.sh " + directory, shell=True)
+    time.sleep(10)
+    return 
+
+with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
+    future_to_task = {executor.submit(execute_task, dirs): dirs for dirs in get_directories()}
+    for future in concurrent.futures.as_completed(future_to_task):
+        task = future_to_task[future]
+        try:
+            future.result()
+        except Exception as exc:
+            print('%r generated an exception: %s' % (task, exc))
+        else:
+            print('%r successfully passed' % (task))


More information about the Libreoffice-commits mailing list