[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2022-12-14 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit ff73b7b3c312b9da1e7fa929b32200859061edac
Author: Caolán McNamara 
AuthorDate: Tue Dec 13 20:06:11 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 14 10:41:52 2022 +

remove exported files immediately after no longer need them

to avoid Gigs of files eating up space during a run

Change-Id: I91b7babd25131691f38258221ee4918cc943d445
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/144107
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 16d337e0..22216137 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -375,7 +375,8 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
 # note: avoid empty path segments in the url!
-fileURL = "file://" + os.path.normpath(os.environ["CRASHTESTDATA"] + 
"/current/" + filename)
+filePath = os.path.normpath(os.environ["CRASHTESTDATA"] + "/current/" + 
filename)
+fileURL = "file://" + filePath
 t = None
 try:
 args = [connection]
@@ -404,19 +405,24 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 
 print("xDoc.storeToURL " + fileURL + " " + filterName + "\n")
 if validationCommand:
-validationCommandWithURL = validationCommand + " " + fileURL[7:]
+validationCommandWithURL = validationCommand + " " + filePath
 print(validationCommandWithURL)
 try:
 output = str(subprocess.check_output(validationCommandWithURL, 
shell=True, timeout=600), encoding='utf-8')
 print(output)
 if ("Error" in output) or ("error" in output):
 print("Error validating file")
-validLog = open(fileURL[7:]+".log", "w")
+validLog = open(filePath+".log", "w")
 validLog.write(output)
 validLog.close()
 except subprocess.CalledProcessError:
 pass # ignore that exception
 
+try:
+os.remove(filePath)
+except:
+pass
+
 def getODFunDiffCommand():
 return os.environ["HOME"] + "/source/bin/odfundiff-exe"
 


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2022-09-22 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit acf14295f1450f02e06d1bc508b68df99a50ab15
Author: Caolán McNamara 
AuthorDate: Thu Sep 22 13:27:50 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 22 14:29:51 2022 +0200

odfundiff_exclude_list.txt path isn't right

Change-Id: I9815f91a0e9edc56be6be8afb00d3f86ec5fc9a4
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/140428
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 50a7508..16d337e 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -668,7 +668,7 @@ if __name__ == "__main__":
 
 exclude_list = []
 if os.path.exists(os.environ["CRASHTESTDATA"] + 
"/odfundiff_exclude_list.txt"):
-with open('os.environ["CRASHTESTDATA"] + 
/odfundiff_exclude_list.txt') as file:
+with open(os.environ["CRASHTESTDATA"] + 
"/odfundiff_exclude_list.txt") as file:
 exclude_list = file.readlines()
 exclude_list = [line.rstrip() for line in exclude_list]
 


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2022-09-19 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 7646673d496c3a4efc71dcebbfb00f8ff3494944
Author: Caolán McNamara 
AuthorDate: Mon Sep 19 20:02:21 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 19 21:07:07 2022 +0200

remove the OSL_PIPE_$uid_pytest_foo on killing process

we pass this name to soffice ourself, so we know what the final name
of the pipe will be, so we can remove it ourself

Change-Id: I8d98f8464a203278da09b20be5c7d76f85a6d437
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/140205
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index ec3d492..50a7508 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -83,6 +83,7 @@ class OfficeConnection:
 self.args = args
 self.soffice = None
 self.socket = None
+self.pipename = None
 self.xContext = None
 self.pro = None
 self.suicided = False
@@ -91,7 +92,8 @@ class OfficeConnection:
 if sep != ":":
 raise Exception("soffice parameter does not specify method")
 if method == "path":
-socket = "pipe,name=pytest" + str(uuid.uuid1())
+self.pipename = "pytest" + str(uuid.uuid1())
+socket = "pipe,name=" + self.pipename
 try:
 userdir = self.args["--userdir"]
 except KeyError:
@@ -159,6 +161,9 @@ class OfficeConnection:
 #return ret
 def kill(self):
 self.suicided = True
+command = "rm /tmp/OSL_PIPE_" + str(os.getuid()) + "_" + self.pipename;
+print(command)
+os.system(command)
 command = "kill " + str(self.pro.pid)
 killFile = open("killFile.log", "a")
 killFile.write(command + "\n")


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2022-09-14 Thread Gabor Kelemen (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 04bb93160fa4e10e3eed56df742ebfaebc2153d9
Author: Gabor Kelemen 
AuthorDate: Fri Aug 19 15:36:26 2022 +0200
Commit: Caolán McNamara 
CommitDate: Wed Sep 14 11:46:22 2022 +0200

Use more CRASHTESTDATA in test-bugzilla-files.py

Change-Id: I480eab54b6ab972b0416969aa3f5353d1f8882bf
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/138720
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 32d6bde..ec3d492 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -416,7 +416,7 @@ def getODFunDiffCommand():
 return os.environ["HOME"] + "/source/bin/odfundiff-exe"
 
 def isPreviousExist():
-previous_path = "/srv/crashtestdata/previous"
+previous_path = os.environ["CRASHTESTDATA"] + "/previous"
 if os.path.exists(previous_path):
 return True
 return False
@@ -662,8 +662,8 @@ if __name__ == "__main__":
 runLoadFileTests(opts, exportedFiles, False)
 
 exclude_list = []
-if os.path.exists("/srv/crashtestdata/odfundiff_exclude_list.txt"):
-with open('/srv/crashtestdata/odfundiff_exclude_list.txt') as file:
+if os.path.exists(os.environ["CRASHTESTDATA"] + 
"/odfundiff_exclude_list.txt"):
+with open('os.environ["CRASHTESTDATA"] + 
/odfundiff_exclude_list.txt') as file:
 exclude_list = file.readlines()
 exclude_list = [line.rstrip() for line in exclude_list]
 
@@ -671,7 +671,7 @@ if __name__ == "__main__":
 odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg']
 for filename in exportedFiles:
 if filename[-3:] in odf_file_ext:
-odfundiffCommandWithURL = getODFunDiffCommand() + " 
/srv/crashtestdata/previous" + filename + " /srv/crashtestdata/current" + 
filename
+odfundiffCommandWithURL = getODFunDiffCommand() + " " + 
os.environ["CRASHTESTDATA"] + "/previous" + filename + " " + 
os.environ["CRASHTESTDATA"] + "/current" + filename
 print(odfundiffCommandWithURL)
 try:
 output = 
str(subprocess.check_output(odfundiffCommandWithURL, shell=True, timeout=600), 
encoding='utf-8')
@@ -682,7 +682,7 @@ if __name__ == "__main__":
 continue
 elif not "Diff finished, number of differences found: 
0" in output and \
  not filename in exclude_list:
-validLog = open("/srv/crashtestdata/current" + 
filename + ".log.odfundiff", "w")
+validLog = open(os.environ["CRASHTESTDATA"] + 
"/current" + filename + ".log.odfundiff", "w")
 validLog.write(output)
 validLog.close()
 handleODFunDiff(filename, output)


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

2022-08-17 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   29 +
 test-bugzilla-files/zip.sh |   12 
 2 files changed, 13 insertions(+), 28 deletions(-)

New commits:
commit de1ee0e1bf530ac2a5eb3e4c046351cc40ba57f4
Author: Caolán McNamara 
AuthorDate: Wed Aug 17 10:17:30 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 17 11:23:07 2022 +0200

add a --validate option and default it off

no one appears to be tracking these results and working on improving
them and the runs are quite slow so default it off for now

Change-Id: I30b8ec594a7a4704cb33b86b6e2cd37ab7edef41
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/138412
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index ac219ac..32d6bde 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -602,39 +602,20 @@ class NormalTimer:
 def getImportTime(self):
 return 60
 
-
 def getExportTime(self):
 return 180
 
-
-class AsanTimer:
-def __init__(self):
-pass
-
-def getImportTime(self):
-return 300
-
-def getExportTime(self):
-return 900
-
-
 def runLoadFileTests(opts, files, doExport):
 startTime = datetime.datetime.now()
 connection = PersistentConnection(opts)
 exportedFiles = []
 try:
 tests = []
-#print("before map")
 files.sort()
-asan = "--asan" in opts
-print(asan)
-timer = None
-if asan is True:
-timer = AsanTimer()
-else:
-timer = NormalTimer()
+validate = "--validate" in opts
+timer = NormalTimer()
 
-tests.extend( (LoadFileTest(file, not asan, timer, doExport) for file 
in files) )
+tests.extend( (LoadFileTest(file, validate, timer, doExport) for file 
in files) )
 runConnectionTests(connection, simpleInvoke, tests)
 
 exportedFiles = [item for sublist in tests for item in 
sublist.exportedFiles]
@@ -645,7 +626,7 @@ def runLoadFileTests(opts, files, doExport):
 
 def parseArgs(argv):
 (optlist,args) = getopt.getopt(argv[1:], "hr",
-["help", "soffice=", "userdir=", "valgrind", "asan"])
+["help", "soffice=", "userdir=", "valgrind", "validate"])
 #print optlist
 return (dict(optlist), args)
 
@@ -657,7 +638,7 @@ def usage():
supported methods: 'path', 'connect'
  --userdir=URL specify user installation directory for 'path' method
  --valgrindpass --valgrind to soffice for 'path' method
- --asanrun under asan, don't run export tests
+ --validaterun with validation of exported files
 
  'location' is a pathname, not a URL. 'userdir' is a URL. the 'task_file' 
parameters should be
   full absolute pathnames, not URLs."""
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index 4808b43..b57e0bb 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -22,11 +22,15 @@ cd /srv/crashtestdata/current/srv/crashtestdata/files/
 rm -f odfundiff.zip
 zip -r -q odfundiff.zip */*.odfundiff
 mv odfundiff.zip /srv/crashtestdata/logs/$SHA/.
-rm -f validation.zip
-zip -r -q validation.zip */*.log
-mv validation.zip /srv/crashtestdata/logs/$SHA/.
+if [ -e validation.zip ]; then
+rm -f validation.zip
+zip -r -q validation.zip */*.log
+mv validation.zip /srv/crashtestdata/logs/$SHA/.
+fi
 cd /srv/crashtestdata/logs/$SHA
-unzip validation.zip -d validation
+if [ -e validation.zip ]; then
+unzip validation.zip -d validation
+fi
 unzip odfundiff.zip -d odfundiff
 rm *.zip
 cp ~/source/dev-tools/test-bugzilla-files/analyze_logs.py .


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

2021-10-18 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |7 ---
 test-bugzilla-files/zip.sh |2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 5f98759d3b424308c5688c30ec87110fbab0faf7
Author: Gülşah Köse 
AuthorDate: Mon Oct 18 17:08:29 2021 +0300
Commit: Miklos Vajna 
CommitDate: Mon Oct 18 16:31:00 2021 +0200

Create odfundifflog.csv in a simple way.

Remove import_csv and export_csv functions and just write the data to a
file directly.

Change-Id: Ia28f15984e630647f2097516c3da2c8f61257034
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123751
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 6dec0e0..ac219ac 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -34,7 +34,6 @@ import time
 import uuid
 import datetime
 import re
-from analyze_logs import import_csv, export_csv
 
 import signal
 import threading
@@ -340,8 +339,10 @@ def handleODFunDiff(file, odfundifflog):
 result["total-diff-count"] = len(odfundifflog.splitlines()) - 1 # Last 
line of log is not a real difference
 result["attr-diff-count"]  = getDifferencesByType("Attribute" , 
odfundifflog)
 result["node-diff-count"] = getDifferencesByType("Node", odfundifflog)
-reader = import_csv("odfundifflog.csv")
-export_csv("odfundifflog.csv", result, reader, header=False)
+
+odfundifflog_f = open("odfundifflog.csv", "a")
+odfundifflog_f.write(file + "," + str(result["total-diff-count"]) + "," + 
str(result["attr-diff-count"]) + "," + str(result["node-diff-count"]) + "\n")
+odfundifflog_f.close()
 
 def getDifferencesByType(type, odfundifflog):
 difflist = odfundifflog.splitlines()
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index a923cb5..b35117f 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -9,7 +9,7 @@ mkdir -p /srv/crashtestdata/logs/$SHA/backtraces
 for a in */core*; do gdb ~/build/instdir/program/soffice.bin $a -ex "thread 
apply all backtrace full" --batch > 
/srv/crashtestdata/logs/$SHA/backtraces/`dirname "$a"`-`basename 
"$a"`.backtrace.txt; done
 cat */crashlog.txt > /srv/crashtestdata/logs/$SHA/crashlog.txt
 cat */exportCrash.txt > /srv/crashtestdata/logs/$SHA/exportCrash.txt
-echo "attr-diff-count,filename,node-diff-count,total-diff-count" > 
/srv/crashtestdata/logs/$SHA/odfundifflog.csv
+echo "filename,total-diff-count,attr-diff-count,node-diff-count" > 
/srv/crashtestdata/logs/$SHA/odfundifflog.csv
 cat */odfundifflog.csv >> /srv/crashtestdata/logs/$SHA/odfundifflog.csv
 # Ignore the header.
 num_of_odf_diffs=$(($(< "/srv/crashtestdata/logs/$SHA/odfundifflog.csv" wc 
-l)-1))


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-10-13 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit c5ee461480f3872defa4d3b2374d9fd078f66366
Author: Gülşah Köse 
AuthorDate: Wed Oct 13 10:17:40 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed Oct 13 09:25:03 2021 +0200

Add warning if input file list changed but previous not updated.

Change-Id: If22c0c9ded77d428abde5fedd7f0b8d1eb65c624
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123545
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 45b1613..6dec0e0 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -693,8 +693,13 @@ if __name__ == "__main__":
 print(odfundiffCommandWithURL)
 try:
 output = 
str(subprocess.check_output(odfundiffCommandWithURL, shell=True, timeout=600), 
encoding='utf-8')
-if not "Diff finished, number of differences found: 0" 
in output and \
-   not filename in exclude_list:
+if "IOException" in output:
+print("Previous state doesn't include %s. It seems 
input file list is changed.\
+   Previous state needs to be updated. If you 
are doing now, please ignore \
+   this warning." % (filename))
+continue
+elif not "Diff finished, number of differences found: 
0" in output and \
+ not filename in exclude_list:
 validLog = open("/srv/crashtestdata/current" + 
filename + ".log.odfundiff", "w")
 validLog.write(output)
 validLog.close()


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-09-07 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit dc01a975a1066b54bb1712cfa5071175633a7238
Author: Gülşah Köse 
AuthorDate: Tue Sep 7 10:19:10 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 7 12:15:44 2021 +0200

Ignore some diffs if file is in exclude list.

/srv/crashtestdata/odfundiff_exclude_list.txt is manuel exclude
list. If the file has difference but file name  in exclude list it
will be ignored.

Example entry for odfundiff_exclude_list.txt
/srv/crashtestdata/files/odt/test.odt

Change-Id: Ibfb568e49d492458b824704cfb5a8734f59de850
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121744
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 0ade4eb..710364d 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -661,6 +661,12 @@ if __name__ == "__main__":
 # Check the roundtripped files doesn't crash at import time
 runLoadFileTests(opts, exportedFiles, False)
 
+exclude_list = []
+if os.path.exists("/srv/crashtestdata/odfundiff_exclude_list.txt"):
+with open('/srv/crashtestdata/odfundiff_exclude_list.txt') as file:
+exclude_list = file.readlines()
+exclude_list = [line.rstrip() for line in exclude_list]
+
 if  isPreviousExist():
 for filename in exportedFiles:
 if filename[-3:] == 'odt':
@@ -668,7 +674,8 @@ if __name__ == "__main__":
 print(odfundiffCommandWithURL)
 try:
 output = 
str(subprocess.check_output(odfundiffCommandWithURL, shell=True, timeout=600), 
encoding='utf-8')
-if not "Diff finished, number of differences found: 0" 
in output:
+if not "Diff finished, number of differences found: 0" 
in output and \
+   not filename in exclude_list:
 validLog = open("/srv/crashtestdata/current" + 
filename + ".log.odfundiff", "w")
 validLog.write(output)
 validLog.close()


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-27 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 1788875b6a2cbe30b3398dc358a96d8e1bed13f8
Author: Gülşah Köse 
AuthorDate: Fri Aug 27 14:09:01 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Aug 27 16:36:42 2021 +0200

Check if source file and destination dir exist.

Before creating 'previous' directory, check if
source file and destination dir exist.

Change-Id: I77f70fff388d704717766799e278d0e7693368e3
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121140
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 9d712c6..82fba62 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -401,7 +401,7 @@ def isPreviousExist():
 return False
 
 def saveAsPreviousState(exported_files):
-odf_file_ext = ['odt', 'ods', 'odp', 'odb']
+odf_file_ext = ['odt']
 previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
 if os.path.exists(previous_path):
 rmtree("/srv/crashtestdata/previous")
@@ -409,7 +409,8 @@ def saveAsPreviousState(exported_files):
 
 for file in exportedFiles:
 ext = file[-3:]
-if ext in odf_file_ext:
+if ext in odf_file_ext and 
os.path.exists("/srv/crashtestdata/current"+file):
+os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file), 
exist_ok=True)
 copyfile("/srv/crashtestdata/current"+file, 
"/srv/crashtestdata/previous"+file)
 
 def getODFunDiffCommand():


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-26 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   63 +++--
 1 file changed, 43 insertions(+), 20 deletions(-)

New commits:
commit cd10db7159587868ff0bf9a63d9f22020a8c92a2
Author: Gülşah Köse 
AuthorDate: Wed Aug 25 10:50:49 2021 +0300
Commit: Miklos Vajna 
CommitDate: Thu Aug 26 11:30:54 2021 +0200

Create previous directory to compare

Change-Id: Iae9d9e7e24f262a05ddbfc7ec0180784e311efae
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121011
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 5a05878..9d712c6 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -33,6 +33,7 @@ import sys
 import time
 import uuid
 import datetime
+from shutil import copyfile, rmtree
 
 import signal
 import threading
@@ -347,7 +348,7 @@ def writeExportCrash(fileName):
 exportCrash.write(fileName + '\n')
 exportCrash.close()
 
-def exportDoc(xDoc, filterName, validationCommand, odfundiffCommand, filename, 
connection, timer):
+def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
 # note: avoid empty path segments in the url!
@@ -356,7 +357,7 @@ def exportDoc(xDoc, filterName, validationCommand, 
odfundiffCommand, filename, c
 try:
 args = [connection]
 t = threading.Timer(timer.getExportTime(), alarm_handler, args)
-t.start()  
+t.start()
 xDoc.storeToURL(fileURL, saveProps)
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
 print("caught UnknownPropertyException " + filename + " timedOut: " + 
str(connection.suicided()))
@@ -393,18 +394,26 @@ def exportDoc(xDoc, filterName, validationCommand, 
odfundiffCommand, filename, c
 except subprocess.CalledProcessError:
 pass # ignore that exception
 
-if odfundiffCommand:
-odfundiffCommandWithURL = odfundiffCommand + " " + filename + " 
/srv/crashtestdata/current" + filename
-print(odfundiffCommandWithURL)
-try:
-output = str(subprocess.check_output(odfundiffCommandWithURL, 
shell=True, timeout=600), encoding='utf-8')
-if "number of differences found" in output:
-validLog = open(fileURL[7:]+".log.odfundiff", "w")
-validLog.write(output)
-validLog.close()
-handleODFunDiff(filename)
-except subprocess.CalledProcessError:
-pass
+def isPreviousExist():
+previous_path = "/srv/crashtestdata/previous"
+if os.path.exists(previous_path):
+return True
+return False
+
+def saveAsPreviousState(exported_files):
+odf_file_ext = ['odt', 'ods', 'odp', 'odb']
+previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
+if os.path.exists(previous_path):
+rmtree("/srv/crashtestdata/previous")
+os.makedirs(previous_path)
+
+for file in exportedFiles:
+ext = file[-3:]
+if ext in odf_file_ext:
+copyfile("/srv/crashtestdata/current"+file, 
"/srv/crashtestdata/previous"+file)
+
+def getODFunDiffCommand():
+return os.environ["HOME"] + "/source/bin/odfundiff-exe"
 
 class ExportFileTest:
 def __init__(self, xDoc, filename, enable_validation, timer):
@@ -434,7 +443,6 @@ class ExportFileTest:
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
-odfundiff = self.getODFunDiffCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
@@ -442,7 +450,8 @@ class ExportFileTest:
 filename = base + extensions[filterName]
 self.exportedFiles.append(filename)
 
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
odfundiff, filename, connection, self.timer)
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
+
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -493,10 +502,6 @@ class ExportFileTest:
 return None
 return validationCommand[filterName]
 
-def getODFunDiffCommand(self, filterName):
-if filterName == "writer8":
-return os.environ["HOME"] + "/source/bin/odfundiff-exe"
-return None
 
 def getFilterName(self, format):
 filterNames = { "ods": "calc8",
@@ -668,6 +673,24 @@ if __name__ == "__main__":
 
 # Check the roundtripped files doesn't crash at import time
 runLoadFileTests(opts, exportedFiles, False)
+
+if not isPreviousExist():
+saveAsPreviousState(exportedFiles)
+else:
+   

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-13 Thread Miklos Vajna (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2e025fdbe1047a14fcc481bf830229cb2e72b4cc
Author: Miklos Vajna 
AuthorDate: Fri Aug 13 08:43:59 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 13 08:43:59 2021 +0200

test-bugzilla-files: avoid hardcoding home directory

So it works when it's invoked as a user that is not "buildslave".

Change-Id: If1fb7f021cdb81ba074f26c8c848b79b94aac4ee

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 1b2ade0..5a05878 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -470,7 +470,7 @@ class ExportFileTest:
 odfvalidator = ("java"
 + " 
-Djavax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0=org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl;
 + " 
-Dorg.iso_relax.verifier.VerifierFactoryLoader=com.sun.msv.verifier.jarv.FactoryLoaderImpl"
-+ " -jar /home/buildslave/source/bin/odfvalidator.jar "
++ " -jar " + os.environ["HOME"] + "/source/bin/odfvalidator.jar "
 + " -M "
 + os.path.join(SRCDIR, 
"schema/libreoffice/OpenDocument-manifest-schema-v1.3+libreoffice.rng")
 + " -D "
@@ -495,7 +495,7 @@ class ExportFileTest:
 
 def getODFunDiffCommand(self, filterName):
 if filterName == "writer8":
-return "/home/buildslave/source/bin/odfundiff-exe"
+return os.environ["HOME"] + "/source/bin/odfundiff-exe"
 return None
 
 def getFilterName(self, format):


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-12 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   31 ++---
 1 file changed, 28 insertions(+), 3 deletions(-)

New commits:
commit 71d3bfc24a3385351903e1b399e6050150ea5038
Author: Gülşah Köse 
AuthorDate: Tue Aug 10 16:40:06 2021 +0300
Commit: Miklos Vajna 
CommitDate: Thu Aug 12 13:28:17 2021 +0200

Initial ODFunDiff integration to crash report tool.

Change-Id: I05729cc4abe9d87e549933c9db63133b666cedfb
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/120273
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 0d1121c..1b2ade0 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -332,6 +332,13 @@ def handleCrash(file, disposed):
 #crashed_files.append(file)
 # add here the remaining handling code for crashed files
 
+def handleODFunDiff(file):
+print("File: " + file + " has differences")
+diffLog = open("odfundifflog.txt", "a")
+diffLog.write(file + ' has differences after saving')
+diffLog.write('\n')
+diffLog.close()
+
 def alarm_handler(args):
 args.kill()
 
@@ -340,7 +347,7 @@ def writeExportCrash(fileName):
 exportCrash.write(fileName + '\n')
 exportCrash.close()
 
-def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
+def exportDoc(xDoc, filterName, validationCommand, odfundiffCommand, filename, 
connection, timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
 # note: avoid empty path segments in the url!
@@ -385,7 +392,19 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 validLog.close()
 except subprocess.CalledProcessError:
 pass # ignore that exception
-
+
+if odfundiffCommand:
+odfundiffCommandWithURL = odfundiffCommand + " " + filename + " 
/srv/crashtestdata/current" + filename
+print(odfundiffCommandWithURL)
+try:
+output = str(subprocess.check_output(odfundiffCommandWithURL, 
shell=True, timeout=600), encoding='utf-8')
+if "number of differences found" in output:
+validLog = open(fileURL[7:]+".log.odfundiff", "w")
+validLog.write(output)
+validLog.close()
+handleODFunDiff(filename)
+except subprocess.CalledProcessError:
+pass
 
 class ExportFileTest:
 def __init__(self, xDoc, filename, enable_validation, timer):
@@ -415,6 +434,7 @@ class ExportFileTest:
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
+odfundiff = self.getODFunDiffCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
@@ -422,7 +442,7 @@ class ExportFileTest:
 filename = base + extensions[filterName]
 self.exportedFiles.append(filename)
 
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
odfundiff, filename, connection, self.timer)
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -473,6 +493,11 @@ class ExportFileTest:
 return None
 return validationCommand[filterName]
 
+def getODFunDiffCommand(self, filterName):
+if filterName == "writer8":
+return "/home/buildslave/source/bin/odfundiff-exe"
+return None
+
 def getFilterName(self, format):
 filterNames = { "ods": "calc8",
 "xls": "MS Excel 97",


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2020-10-14 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 8f23d02970e1a5e7d5fc30f5a341d1e807fae9f8
Author: Caolán McNamara 
AuthorDate: Wed Oct 14 12:15:46 2020 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 14 15:10:39 2020 +0200

use an explicit flag that the process was killed by timedOut

instead of using Thread.is_alive

if a document times out and the process killed, that document is recorded 
as a
timeout and not a crash, but any other document the process is handling is
recorded as a crash by its thread

Change-Id: Ia38939814a37322d449371e902fb7e21a6067fe2
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/104284
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index b226718..0d1121c 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -84,6 +84,7 @@ class OfficeConnection:
 self.socket = None
 self.xContext = None
 self.pro = None
+self.suicided = False
 def setUp(self):
 (method, sep, rest) = self.args["--soffice"].partition(":")
 if sep != ":":
@@ -149,12 +150,14 @@ class OfficeConnection:
 self.soffice.terminate()
 ret = self.soffice.wait()
 self.xContext = None
+self.suicided = False
 self.socket = None
 self.soffice = None
 if ret != 0:
 raise Exception("Exit status indicates failure: " + str(ret))
 #return ret
 def kill(self):
+self.suicided = True
 command = "kill " + str(self.pro.pid)
 killFile = open("killFile.log", "a")
 killFile.write(command + "\n")
@@ -187,6 +190,10 @@ class PersistentConnection:
 def kill(self):
 if self.connection:
 self.connection.kill()
+def suicided(self):
+if self.connection:
+return self.connection.suicided
+return False
 
 def simpleInvoke(connection, test):
 try:
@@ -345,11 +352,13 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 t.start()  
 xDoc.storeToURL(fileURL, saveProps)
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
-if t.is_alive():
+print("caught UnknownPropertyException " + filename + " timedOut: " + 
str(connection.suicided()))
+if not connection.suicided():
 writeExportCrash(filename)
 raise # means crashed, handle it later
 except pyuno.getClass("com.sun.star.lang.DisposedException"):
-if t.is_alive():
+print("caught DisposedException " + filename + " timedOut: " + 
str(connection.suicided()))
+if not connection.suicided():
 writeExportCrash(filename)
 raise # means crashed, handle it later
 except pyuno.getClass("com.sun.star.lang.IllegalArgumentException"):
@@ -511,20 +520,16 @@ class LoadFileTest:
 self.exportedFiles = exportTest.exportedFiles
 
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
-print("caught UnknownPropertyException " + self.file)
-if not t.is_alive():
-print("TIMEOUT!")
-else:
+print("caught UnknownPropertyException " + self.file + " timedOut: 
" + str(connection.suicided()))
+if not connection.suicided():
 t.cancel()
 handleCrash(self.file, 0)
 connection.tearDown()
 connection.setUp()
 xDoc = None
 except pyuno.getClass("com.sun.star.lang.DisposedException"):
-print("caught DisposedException " + self.file)
-if not t.is_alive():
-print("TIMEOUT!")
-else:
+print("caught DisposedException " + self.file + " timedOut: " + 
str(connection.suicided()))
+if not connection.suicided():
 t.cancel()
 handleCrash(self.file, 1)
 connection.tearDown()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2020-05-28 Thread Xisco Fauli (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   63 +
 1 file changed, 39 insertions(+), 24 deletions(-)

New commits:
commit 8ba5ca764036923060f39c2e22c4ac45852f8b93
Author: Xisco Fauli 
AuthorDate: Fri Apr 24 18:20:11 2020 +0200
Commit: Caolán McNamara 
CommitDate: Thu May 28 09:48:46 2020 +0200

test-bugzilla-files: test the roundtripped files are still opening

Change-Id: Idf4a2e342ebbd196548f2807dcf4d0628f8b6a83
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/92868
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 8dd8e72..b226718 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -336,22 +336,6 @@ def writeExportCrash(fileName):
 def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
-extensions = { "calc8": ".ods",
-"MS Excel 97": ".xls",
-"Calc Office Open XML": ".xlsx",
-"writer8": ".odt",
-"Office Open XML Text": ".docx",
-"Rich Text Format": ".rtf",
-"MS Word 97": ".doc",
-"impress8": ".odp",
-"draw8": ".odg",
-"Impress Office Open XML": ".pptx",
-"MS PowerPoint 97": ".ppt",
-"math8": ".odf",
-"StarOffice XML (Base)": ".odb"
-}
-base = os.path.splitext(filename)[0]
-filename = base + extensions[filterName]
 # note: avoid empty path segments in the url!
 fileURL = "file://" + os.path.normpath(os.environ["CRASHTESTDATA"] + 
"/current/" + filename)
 t = None
@@ -400,17 +384,36 @@ class ExportFileTest:
 self.filename = filename
 self.enable_validation = enable_validation
 self.timer = timer
+self.exportedFiles = []
 
 def run(self, connection):
 formats = self.getExportFormats()
 print(formats)
+extensions = { "calc8": ".ods",
+"MS Excel 97": ".xls",
+"Calc Office Open XML": ".xlsx",
+"writer8": ".odt",
+"Office Open XML Text": ".docx",
+"Rich Text Format": ".rtf",
+"MS Word 97": ".doc",
+"impress8": ".odp",
+"draw8": ".odg",
+"Impress Office Open XML": ".pptx",
+"MS PowerPoint 97": ".ppt",
+"math8": ".odf",
+"StarOffice XML (Base)": ".odb"
+}
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
self.filename, connection, self.timer)
+base = os.path.splitext(self.filename)[0]
+filename = base + extensions[filterName]
+self.exportedFiles.append(filename)
+
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -479,10 +482,12 @@ class ExportFileTest:
 return filterNames[format]
 
 class LoadFileTest:
-def __init__(self, file, enable_validation, timer):
+def __init__(self, file, enable_validation, timer, doExport):
 self.file = file
 self.enable_validation = enable_validation
 self.timer = timer
+self.doExport = doExport
+self.exportedFiles = []
 
 def run(self, xContext, connection):
 print("Loading document: " + self.file)
@@ -500,9 +505,11 @@ class LoadFileTest:
 xDoc = loadFromURL(xContext, url, t)
 print("doc loaded")
 t.cancel()
-if xDoc:
+if xDoc and self.doExport:
 exportTest = ExportFileTest(xDoc, self.file, 
self.enable_validation, self.timer)
 exportTest.run(connection)
+self.exportedFiles = exportTest.exportedFiles
+
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
 print("caught UnknownPropertyException " + self.file)
 if not t.is_alive():
@@ -570,14 +577,13 @@ class AsanTimer:
 return 900
 
 
-def runLoadFileTests(opts, file_list_name):
+def runLoadFileTests(opts, files, doExport):
 startTime = datetime.datetime.now()
 connection = PersistentConnection(opts)
+

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2020-04-24 Thread Xisco Fauli (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   63 +++--
 1 file changed, 24 insertions(+), 39 deletions(-)

New commits:
commit c3217424495e7818aef184541273806b9a39f443
Author: Xisco Fauli 
AuthorDate: Fri Apr 24 18:18:12 2020 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 24 18:18:12 2020 +0200

Revert "test-bugzilla-files: test the roundtripped files are still opening"

This reverts commit 1e23126c1a20eb08c30772e75f4bd4868153e8a5.

I wanted to submit it to gerrit. Instead, I pushed it to master

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index b226718..8dd8e72 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -336,6 +336,22 @@ def writeExportCrash(fileName):
 def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
+extensions = { "calc8": ".ods",
+"MS Excel 97": ".xls",
+"Calc Office Open XML": ".xlsx",
+"writer8": ".odt",
+"Office Open XML Text": ".docx",
+"Rich Text Format": ".rtf",
+"MS Word 97": ".doc",
+"impress8": ".odp",
+"draw8": ".odg",
+"Impress Office Open XML": ".pptx",
+"MS PowerPoint 97": ".ppt",
+"math8": ".odf",
+"StarOffice XML (Base)": ".odb"
+}
+base = os.path.splitext(filename)[0]
+filename = base + extensions[filterName]
 # note: avoid empty path segments in the url!
 fileURL = "file://" + os.path.normpath(os.environ["CRASHTESTDATA"] + 
"/current/" + filename)
 t = None
@@ -384,36 +400,17 @@ class ExportFileTest:
 self.filename = filename
 self.enable_validation = enable_validation
 self.timer = timer
-self.exportedFiles = []
 
 def run(self, connection):
 formats = self.getExportFormats()
 print(formats)
-extensions = { "calc8": ".ods",
-"MS Excel 97": ".xls",
-"Calc Office Open XML": ".xlsx",
-"writer8": ".odt",
-"Office Open XML Text": ".docx",
-"Rich Text Format": ".rtf",
-"MS Word 97": ".doc",
-"impress8": ".odp",
-"draw8": ".odg",
-"Impress Office Open XML": ".pptx",
-"MS PowerPoint 97": ".ppt",
-"math8": ".odf",
-"StarOffice XML (Base)": ".odb"
-}
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
-base = os.path.splitext(self.filename)[0]
-filename = base + extensions[filterName]
-self.exportedFiles.append(filename)
-
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
self.filename, connection, self.timer)
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -482,12 +479,10 @@ class ExportFileTest:
 return filterNames[format]
 
 class LoadFileTest:
-def __init__(self, file, enable_validation, timer, doExport):
+def __init__(self, file, enable_validation, timer):
 self.file = file
 self.enable_validation = enable_validation
 self.timer = timer
-self.doExport = doExport
-self.exportedFiles = []
 
 def run(self, xContext, connection):
 print("Loading document: " + self.file)
@@ -505,11 +500,9 @@ class LoadFileTest:
 xDoc = loadFromURL(xContext, url, t)
 print("doc loaded")
 t.cancel()
-if xDoc and self.doExport:
+if xDoc:
 exportTest = ExportFileTest(xDoc, self.file, 
self.enable_validation, self.timer)
 exportTest.run(connection)
-self.exportedFiles = exportTest.exportedFiles
-
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
 print("caught UnknownPropertyException " + self.file)
 if not t.is_alive():
@@ -577,13 +570,14 @@ class AsanTimer:
 return 900
 
 
-def runLoadFileTests(opts, files, doExport):
+def runLoadFileTests(opts, file_list_name):
 startTime = datetime.datetime.now()
 connection = PersistentConnection(opts)
-exportedFiles = []
 try:
 tests = []
 # 

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2020-04-24 Thread Xisco Fauli (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   63 +
 1 file changed, 39 insertions(+), 24 deletions(-)

New commits:
commit 1e23126c1a20eb08c30772e75f4bd4868153e8a5
Author: Xisco Fauli 
AuthorDate: Fri Apr 24 17:55:04 2020 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 24 17:55:04 2020 +0200

test-bugzilla-files: test the roundtripped files are still opening

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 8dd8e72..b226718 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -336,22 +336,6 @@ def writeExportCrash(fileName):
 def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
-extensions = { "calc8": ".ods",
-"MS Excel 97": ".xls",
-"Calc Office Open XML": ".xlsx",
-"writer8": ".odt",
-"Office Open XML Text": ".docx",
-"Rich Text Format": ".rtf",
-"MS Word 97": ".doc",
-"impress8": ".odp",
-"draw8": ".odg",
-"Impress Office Open XML": ".pptx",
-"MS PowerPoint 97": ".ppt",
-"math8": ".odf",
-"StarOffice XML (Base)": ".odb"
-}
-base = os.path.splitext(filename)[0]
-filename = base + extensions[filterName]
 # note: avoid empty path segments in the url!
 fileURL = "file://" + os.path.normpath(os.environ["CRASHTESTDATA"] + 
"/current/" + filename)
 t = None
@@ -400,17 +384,36 @@ class ExportFileTest:
 self.filename = filename
 self.enable_validation = enable_validation
 self.timer = timer
+self.exportedFiles = []
 
 def run(self, connection):
 formats = self.getExportFormats()
 print(formats)
+extensions = { "calc8": ".ods",
+"MS Excel 97": ".xls",
+"Calc Office Open XML": ".xlsx",
+"writer8": ".odt",
+"Office Open XML Text": ".docx",
+"Rich Text Format": ".rtf",
+"MS Word 97": ".doc",
+"impress8": ".odp",
+"draw8": ".odg",
+"Impress Office Open XML": ".pptx",
+"MS PowerPoint 97": ".ppt",
+"math8": ".odf",
+"StarOffice XML (Base)": ".odb"
+}
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
self.filename, connection, self.timer)
+base = os.path.splitext(self.filename)[0]
+filename = base + extensions[filterName]
+self.exportedFiles.append(filename)
+
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -479,10 +482,12 @@ class ExportFileTest:
 return filterNames[format]
 
 class LoadFileTest:
-def __init__(self, file, enable_validation, timer):
+def __init__(self, file, enable_validation, timer, doExport):
 self.file = file
 self.enable_validation = enable_validation
 self.timer = timer
+self.doExport = doExport
+self.exportedFiles = []
 
 def run(self, xContext, connection):
 print("Loading document: " + self.file)
@@ -500,9 +505,11 @@ class LoadFileTest:
 xDoc = loadFromURL(xContext, url, t)
 print("doc loaded")
 t.cancel()
-if xDoc:
+if xDoc and self.doExport:
 exportTest = ExportFileTest(xDoc, self.file, 
self.enable_validation, self.timer)
 exportTest.run(connection)
+self.exportedFiles = exportTest.exportedFiles
+
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
 print("caught UnknownPropertyException " + self.file)
 if not t.is_alive():
@@ -570,14 +577,13 @@ class AsanTimer:
 return 900
 
 
-def runLoadFileTests(opts, file_list_name):
+def runLoadFileTests(opts, files, doExport):
 startTime = datetime.datetime.now()
 connection = PersistentConnection(opts)
+exportedFiles = []
 try:
 tests = []
 #print("before map")
-files = []
-files.extend(getFiles(file_list_name[0]))
 files.sort()
 asan = "--asan" in opts

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2018-12-10 Thread Libreoffice Gerrit user
 test-bugzilla-files/test-bugzilla-files.py |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit d7a0c23d35310f62e1a728ee72c012c11db651d6
Author: Caolán McNamara 
AuthorDate: Mon Dec 10 10:07:13 2018 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 10 10:07:13 2018 +

keep cores

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 503a56b..8bf815d 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -546,9 +546,6 @@ class LoadFileTest:
 connection.tearDown()
 connection.setUp()
 print("...done with: " + self.file)
-cores = glob.glob("core*")
-for core in cores:
-os.remove(core)
 
 class NormalTimer:
 def __init__(self):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2018-07-03 Thread Michael Stahl
 test-bugzilla-files/test-bugzilla-files.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ee6deb9c57a16a6de43aefd7f4e392e10cc40dd3
Author: Michael Stahl 
Date:   Tue Jul 3 13:53:38 2018 +0200

test-bugzilla-files.py: add back "current" directory to fileURL

(regression from 347c1b16822777871f3d8dacca4befa95eeb805d)

Change-Id: I096c2881bb6fc8dcfa1c87361aa9f3d3494b75dc

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 4dc048e..503a56b 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -353,7 +353,7 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 base = os.path.splitext(filename)[0]
 filename = base + extensions[filterName]
 # note: avoid empty path segments in the url!
-fileURL = "file://" + os.path.normpath(os.environ["CRASHTESTDATA"] + "/" + 
filename)
+fileURL = "file://" + os.path.normpath(os.environ["CRASHTESTDATA"] + 
"/current/" + filename)
 t = None
 try:
 args = [connection]
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2018-07-03 Thread Michael Stahl
 test-bugzilla-files/test-bugzilla-files.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d17bde68ba59de4d3d47700dd47723dc605056f7
Author: Michael Stahl 
Date:   Tue Jul 3 11:30:17 2018 +0200

test-bugzilla-files: add a timeout to validator invocation

It so happened that the validator went into an odd sort of infinite loop
when validating this one file mtp/ooo60405-2-101.odt.

This could not be reproduced when running the validator manually,
with the same command line that the python.bin process used copied
out of gdb.

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

"main" #1 prio=5 os_prio=0 tid=0x7f927c009000 nid=0x44f1 runnable 
[0x7f928565f000]
   java.lang.Thread.State: RUNNABLE
at 
com.sun.msv.verifier.regexp.AttributeFeeder.onInterleave(AttributeFeeder.java:156)
at com.sun.msv.grammar.InterleaveExp.visit(InterleaveExp.java:48)
at 
com.sun.msv.verifier.regexp.AttributeFeeder.onInterleave(AttributeFeeder.java:156)
at com.sun.msv.grammar.InterleaveExp.visit(InterleaveExp.java:48)
at 
com.sun.msv.verifier.regexp.AttributeFeeder.onInterleave(AttributeFeeder.java:156)
[...]
at com.sun.msv.grammar.InterleaveExp.visit(InterleaveExp.java:48)
at 
com.sun.msv.verifier.regexp.AttributeFeeder.onInterleave(AttributeFeeder.java:156)
at com.sun.msv.grammar.InterleaveExp.visit(InterleaveExp.java:48)
at 
com.sun.msv.verifier.regexp.AttributeFeeder.onSequence(AttributeFeede
r.java:142)
at com.sun.msv.grammar.SequenceExp.visit(SequenceExp.java:44)
at 
com.sun.msv.verifier.regexp.AttributeFeeder.onSequence(AttributeFeeder.java:142)
at com.sun.msv.grammar.SequenceExp.visit(SequenceExp.java:44)
at 
com.sun.msv.verifier.regexp.AttributeFeeder.feed(AttributeFeeder.java:72)
at 
com.sun.msv.verifier.regexp.ExpressionAcceptor.onAttribute(ExpressionAcceptor.java:205)
at 
com.sun.msv.verifier.regexp.ExpressionAcceptor.onAttribute2(ExpressionAcceptor.java:201)
at com.sun.msv.verifier.Verifier.feedAttribute(Verifier.java:308)
at com.sun.msv.verifier.Verifier.startElement(Verifier.java:243)
at 
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
at 
org.odftoolkit.odfvalidator.NamespaceFilter.startElement(NamespaceFilter.java:79)
at 
org.odftoolkit.odfvalidator.ContentFilter.startElement(ContentFilter.java:103)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
at 
org.iso_relax.verifier.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:87)
at javax.xml.validation.Validator.validate(Validator.java:124)
at 
org.odftoolkit.odfvalidator.ODFPackageValidator.validate(ODFPackageValidator.java:264)

at 
org.odftoolkit.odfvalidator.ODFPackageValidator.validateEntry(ODFPackageValidator.java:235)
at 
org.odftoolkit.odfvalidator.ODFPackageValidator.validateEntry(ODFPackageValidator.java:162)
at 
org.odftoolkit.odfvalidator.ODFPackageValidator._validate(ODFPackageValidator.java:116)
at 
org.odftoolkit.odfvalidator.ODFPackageValidator.validate(ODFPackageValidator.java:81)
at 
org.odftoolkit.odfvalidator.ODFValidator.validateFile(ODFValidator.java:163)
at 
org.odftoolkit.odfvalidator.ODFValidator.validate(ODFValidator.java:125)
at org.odftoolkit.odfvalidator.Main.main(Main.java:314)

Change-Id: I798bfe072e3f652a4434c74815df663c48dce3c7

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 8a63a21..4dc048e 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -383,7 +383,7 @@ def exportDoc(xDoc, filterName, 

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2014-11-02 Thread Markus Mohrhard
 test-bugzilla-files/test-bugzilla-files.py |   70 -
 1 file changed, 40 insertions(+), 30 deletions(-)

New commits:
commit 406588edb62589ef549f84e268b3268eb337c02a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Nov 2 19:57:11 2014 +0100

better way to identify the component

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 11cf41c..e43e847 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -233,23 +233,45 @@ class 
EventListener(XDocumentEventListener,unohelper.Base):
 def mkPropertyValue(name, value):
 return uno.createUnoStruct(com.sun.star.beans.PropertyValue,
 name, 0, value, 0)
+de
+
+def getComponent(xDoc)
+if not xDoc:
+return None
+
+if xDoc.supportsService(com.sun.star.sheet.SpreadsheetDocument):
+return calc
+elif xDoc.supportsService(com.sun.star.text.TextDocument):
+return writer
+elif xDoc.supportsService(com.sun.star.drawing.DrawingDocument):
+return draw
+elif 
xDoc.supportsService(com.sun.star.presentation.PresentationDocument):
+return impress
+elif xDoc.supportsService(com.sun.star.formula.FormularProperties):
+return math
+elif xDoc.supportsService(com.sun.star.sdb.OfficeDatabaseDocument):
+return base
+
+
+return other
 
 ### tests ###
 
-def loadFromURL(xContext, url, t, component):
+def loadFromURL(xContext, url, t):
 xDesktop = xContext.ServiceManager.createInstanceWithContext(
 com.sun.star.frame.Desktop, xContext)
 props = [(Hidden, True), (ReadOnly, True)] # FilterName?
 loadProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
-xListener = None
-if component == writer:
-xListener = EventListener()
-xGEB = xContext.ServiceManager.createInstanceWithContext(
-com.sun.star.frame.GlobalEventBroadcaster, xContext)
-xGEB.addDocumentEventListener(xListener)
+
+xListener = EventListener()
+xGEB = xContext.ServiceManager.createInstanceWithContext(
+com.sun.star.frame.GlobalEventBroadcaster, xContext)
+xGEB.addDocumentEventListener(xListener)
+
 try:
 xDoc = None
 xDoc = xDesktop.loadComponentFromURL(url, _blank, 0, loadProps)
+component = getComponent(xDoc)
 if component == calc:
 try:
 if xDoc:
@@ -373,7 +395,6 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection):
 class ExportFileTest:
 def __init__(self, xDoc, component, filename):
 self.xDoc = xDoc
-self.component = component
 self.filename = filename
 def run(self, connection):
 formats = self.getExportFormats()
@@ -396,9 +417,10 @@ class ExportFileTest:
 base : [odb],
 math : [odf]
 }
-if not self.component in formats:
+component = getComponent(self.xDoc)
+if not component in formats:
 return []
-return formats[self.component]
+return formats[component]
 
 def getValidationCommand(self, filterName):
 validationCommand = { calc8 : java 
-Djavax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0=org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl
 
-Dorg.iso_relax.verifier.VerifierFactoryLoader=com.sun.msv.verifier.jarv.FactoryLoaderImpl
 -jar /home/buildslave/source/bin/odfvalidator.jar -e,
@@ -435,10 +457,9 @@ class ExportFileTest:
 
 
 class LoadFileTest:
-def __init__(self, file, state, component):
+def __init__(self, file, state):
 self.file = file
 self.state = state
-self.component = component
 def run(self, xContext, connection):
 print(Loading document:  + self.file)
 t = None
@@ -452,11 +473,11 @@ class LoadFileTest:
 args = [connection]
 t = threading.Timer(60, alarm_handler, args)
 t.start()  
-xDoc = loadFromURL(xContext, url, t, self.component)
+xDoc = loadFromURL(xContext, url, t)
 print(doc loaded)
 t.cancel()
 if xDoc:
-exportTest = ExportFileTest(xDoc, self.component, self.file)
+exportTest = ExportFileTest(xDoc, self.file)
 exportTest.run(connection)
 self.state.goodFiles.append(self.file)
 except pyuno.getClass(com.sun.star.beans.UnknownPropertyException):
@@ -547,28 +568,17 @@ def writeReport(state, startTime):
 timeoutFiles.write(\n)
 timeoutFiles.close()
 
-validCalcFileExtensions = [ .xlsx, .xltx, .xls, .ods, .ots, .sxc, 
.stc, .fods, .xlsb, .xlsm, .xltm, .csv, .slk, .wks, .sdc, 
.sdc5 ]
-validWriterFileExtensions = [ .docx , .rtf, .odt, .fodt, .doc, 
.odm, .ott, .oth, .sxw, .sxg, .stw, .dotx, .lwp, .wpd, 
.wps, .abw, .hwp, .docm, .dotm, .sdw, 

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2014-02-16 Thread Markus Mohrhard
 test-bugzilla-files/test-bugzilla-files.py |  151 +++--
 1 file changed, 145 insertions(+), 6 deletions(-)

New commits:
commit 36caa1b3dddb7fe1e49672133ffc266b437bcdaf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 16 22:25:40 2014 +0100

update crash testing script

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 862933d..f21ce38 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -317,6 +317,135 @@ def handleCrash(file, disposed):
 def alarm_handler(args):
 args.kill()
 
+def writeExportCrash(fileName):
+exportCrash = open(exportCrash.txt, a)
+exportCrash.write(fileName + '\n')
+exportCrash.close()
+
+def exportDoc(xDoc, filterName, validationCommand, filename, connection):
+props = [ (FilterName, filterName) ]
+saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
+extensions = { calc8: .ods,
+MS Excel 97: .xls,
+Calc Office Open XML: .xlsx,
+writer8: .odt,
+Office Open XML Text: .docx,
+Rich Text Format: .rtf,
+MS Word 97: .doc,
+impress8: .odp,
+draw8: .odg,
+Impress Office Open XML: .pptx,
+MS PowerPoint 97: .ppt,
+math8: .odf,
+StarOffice XML (Base): .odb
+}
+base = os.path.splitext(filename)[0]
+filename = base + extensions[filterName]
+fileURL = file:///srv/crashtestdata/current + filename
+t = None
+try:
+args = [connection]
+t = threading.Timer(180, alarm_handler, args)
+t.start()  
+xDoc.storeToURL(fileURL, saveProps)
+except pyuno.getClass(com.sun.star.beans.UnknownPropertyException):
+if t.is_alive():
+writeExportCrash(filename)
+raise # means crashed, handle it later
+except pyuno.getClass(com.sun.star.lang.DisposedException):
+if t.is_alive():
+writeExportCrash(filename)
+raise # means crashed, handle it later
+except pyuno.getClass(com.sun.star.lang.IllegalArgumentException):
+pass # means could not open the file, ignore it
+except pyuno.getClass(com.sun.star.task.ErrorCodeIOException):
+pass
+except:
+pass
+finally:
+if t.is_alive():
+t.cancel()
+
+print(xDoc.storeToURL  + fileURL +   + filterName + \n)
+if validationCommand:
+validationCommandWithURL = validationCommand +   + fileURL[7:]
+print(validationCommandWithURL)
+try:
+output = str(subprocess.check_output(validationCommandWithURL, 
shell=True), encoding='utf-8')
+print(output)
+if (Error in output) or (error in output):
+print(Error validating file)
+validLog = open(fileURL[7:]+.log, w)
+validLog.write(output)
+validLog.close()
+except subprocess.CalledProcessError:
+pass # ignore that exception
+
+
+class ExportFileTest:
+def __init__(self, xDoc, component, filename):
+self.xDoc = xDoc
+self.component = component
+self.filename = filename
+def run(self, connection):
+formats = self.getExportFormats()
+print(formats)
+for format in formats:
+filterName = self.getFilterName(format)
+validation = self.getValidationCommand(filterName)
+print(format)
+print(filterName)
+if filterName:
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
self.filename, connection)
+if xExportedDoc:
+xExportedDoc.close(True)
+
+def getExportFormats(self):
+formats = { calc: [ods, xls, xlsx],
+writer : [odt, doc, docx, rtf],
+impress : [odp, ppt, pptx],
+draw : [odg],
+base : [odb],
+math : [odf]
+}
+if not self.component in formats:
+return []
+return formats[self.component]
+
+def getValidationCommand(self, filterName):
+validationCommand = { calc8 : java 
-Djavax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0=org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl
 
-Dorg.iso_relax.verifier.VerifierFactoryLoader=com.sun.msv.verifier.jarv.FactoryLoaderImpl
 -jar /home/buildslave/source/bin/odfvalidator.jar -e,
+writer8 : java 
-Djavax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0=org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl
 
-Dorg.iso_relax.verifier.VerifierFactoryLoader=com.sun.msv.verifier.jarv.FactoryLoaderImpl
 -jar 

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2013-11-27 Thread Markus Mohrhard
 test-bugzilla-files/test-bugzilla-files.py |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d82bdc09c6956a26929927091238a308a959f440
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Nov 27 18:12:52 2013 +0100

always create a new line for a crashed file

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 84e282b..862933d 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -308,7 +308,8 @@ def handleCrash(file, disposed):
 crashLog = open(crashlog.txt, a)
 crashLog.write('Crash:' + file + ' ')
 if disposed == 1:
-crashLog.write('through disposed\n')
+crashLog.write('through disposed')
+crashLog.write('\n')
 crashLog.close()
 #crashed_files.append(file)
 # add here the remaining handling code for crashed files
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2013-09-12 Thread Tor Lillqvist
 test-bugzilla-files/test-bugzilla-files.py |  962 ++---
 1 file changed, 482 insertions(+), 480 deletions(-)

New commits:
commit 293b82d938f7f4492813299cbb39e7389165
Author: Tor Lillqvist t...@collabora.com
Date:   Fri Sep 6 13:59:04 2013 +0300

Use Unix newlines, drop some noise output, improve usage message

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 54343f6..84e282b 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -1,480 +1,482 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the License); you may not use this file except in compliance with
-# the License or as specified alternatively below. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an AS IS basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# Major Contributor(s):
-# Copyright (C) 2012 Red Hat, Inc., Michael Stahl mst...@redhat.com
-#  (initial developer)
-#
-# All Rights Reserved.
-#
-# For minor contributions see the git repository.
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the GPLv3+), or
-# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
-
-import getopt
-import os
-import subprocess
-import sys
-import time
-import uuid
-import datetime
-
-import signal
-import threading
-try:
-from urllib.parse import quote
-except ImportError:
-from urllib import quote
-
-try:
-import pyuno
-import uno
-import unohelper
-except ImportError:
-print(pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables)
-print(PYTHONPATH=/installation/opt/program)
-print(URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc)
-raise
-
-try:
-from com.sun.star.document import XDocumentEventListener
-except ImportError:
-print(UNO API class not found: try to set URE_BOOTSTRAP variable)
-print(URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc)
-raise
-
-### utilities ###
-
-def partition(list, pred):
-left = []
-right = []
-for e in list:
-if pred(e):
-left.append(e)
-else:
-right.append(e)
-return (left, right)
-
-def filelist(dir, suffix):
-if len(dir) == 0:
-raise Exception(filelist: empty directory)
-if not(dir[-1] == /):
-dir += /
-files = [dir + f for f in os.listdir(dir)]
-#print(files)
-return [f for f in files
-if os.path.isfile(f) and os.path.splitext(f)[1] == suffix]
-
-def getFiles(dirs, suffix):
-print( dirs )
-files = []
-for dir in dirs:
-files += filelist(dir, suffix)
-return files
-
-### UNO utilities ###
-
-class OfficeConnection:
-def __init__(self, args):
-self.args = args
-self.soffice = None
-self.socket = None
-self.xContext = None
-self.pro = None
-def setUp(self):
-(method, sep, rest) = self.args[--soffice].partition(:)
-if sep != ::
-raise Exception(soffice parameter does not specify method)
-if method == path:
-socket = pipe,name=pytest + str(uuid.uuid1())
-try:
-userdir = self.args[--userdir]
-except KeyError:
-raise Exception('path' method requires --userdir)
-if not(userdir.startswith(file://)):
-raise Exception(--userdir must be file URL)
-self.soffice = self.bootstrap(rest, userdir, socket)
-elif method == connect:
-socket = rest
-else:
-raise Exception(unsupported connection method:  + method)
-self.xContext = self.connect(socket)
-
-def bootstrap(self, soffice, userdir, socket):
-argv = [ soffice, --accept= + socket + ;urp,
--env:UserInstallation= + userdir,
---quickstart=no, --nofirststartwizard,
---norestore, --nologo, --headless ]
-if --valgrind in self.args:
-argv.append(--valgrind)
-self.pro = subprocess.Popen(argv)
-print(self.pro.pid)
-
-def connect(self, socket):
-xLocalContext = uno.getComponentContext()
-xUnoResolver = xLocalContext.ServiceManager.createInstanceWithContext(
-com.sun.star.bridge.UnoUrlResolver, xLocalContext)
-url = uno: + socket + ;urp;StarOffice.ComponentContext
-