[Libreoffice-commits] dev-tools.git: 2 commits - test-bugzilla-files/analyze-logs.py
Markus Mohrhard
markus.mohrhard at googlemail.com
Sun Dec 14 06:49:40 PST 2014
test-bugzilla-files/analyze-logs.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
New commits:
commit a53e02fc799e1dc545d9d4982f41a5b65b7f618d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Nov 29 04:06:32 2014 +0100
fix export crash analyzing
diff --git a/test-bugzilla-files/analyze-logs.py b/test-bugzilla-files/analyze-logs.py
index e17b244..1ae2ddf 100644
--- a/test-bugzilla-files/analyze-logs.py
+++ b/test-bugzilla-files/analyze-logs.py
@@ -35,15 +35,18 @@ def analyze_import_crash(crashtest_file, crashes):
crashes[format] = 1 + crashes[format]
return crashes
-def analyze_export_crash(directory):
- crashtest_file = os.path.join(directory, "exportCrash.txt")
+def analyze_export_crash(crashtest_file, crashes):
if not os.path.exists(crashtest_file):
- return collections.Counter()
- exts = []
+ return 0
+
+ regex = re.compile("/srv/crashtestdata/files/\w+/[a-zA-Z0-9_-]+\.(\w+)")
for line in open(crashtest_file):
- ext = os.path.splitext(line)[1]
- exts.append(ext.replace(".","").replace("\n",""))
- return collections.Counter(exts)
+ r = regex.search(line)
+ format = r.groups()[0]
+ if format not in crashes:
+ crashes[format] = 0
+ crashes[format] = 1 + crashes[format]
+ return crashes
def analyze_validation_errors(directory):
exts = []
@@ -83,9 +86,8 @@ def update_import():
export_csv("importCrash.csv", import_crashes, reader)
def update_export():
- export_crashes = collections.Counter()
- for directory in get_directories():
- export_crashes += analyze_export_crash(directory)
+ export_crashes = dict()
+ analyze_export_crash("exportCrash.txt", export_crashes)
reader = import_csv("exportCrashes.csv")
export_csv("exportCrashes.csv", export_crashes, reader)
commit da9883f92b13c66bc5402f2f8a99217a17c91509
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Nov 24 16:51:43 2014 +0100
another fix necessary
diff --git a/test-bugzilla-files/analyze-logs.py b/test-bugzilla-files/analyze-logs.py
index f3f6aae..e17b244 100644
--- a/test-bugzilla-files/analyze-logs.py
+++ b/test-bugzilla-files/analyze-logs.py
@@ -22,8 +22,7 @@ import collections
import csv
import re
-def analyze_import_crash(directory, crashes):
- crashtest_file = os.path.join(directory, "crashlog.txt")
+def analyze_import_crash(crashtest_file, crashes):
if not os.path.exists(crashtest_file):
return 0
@@ -79,8 +78,7 @@ def export_csv(filename, data, reader):
def update_import():
import_crashes = dict()
- for directory in get_directories():
- analyze_import_crash(directory, import_crashes)
+ analyze_import_crash("crashlog.txt", import_crashes)
reader = import_csv("importCrash.csv")
export_csv("importCrash.csv", import_crashes, reader)
More information about the Libreoffice-commits
mailing list