3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 def analyze_file(filename
):
15 with
open(filename
, encoding
='utf-8') as fh
:
17 if line
.lstrip().startswith('class '):
18 class_name
= line
.lstrip().split(" ")[1].split("(")[0]
19 elif line
.lstrip().startswith('def test_'):
21 line
.lstrip().split("test_")[1].split("(")[0])
24 return class_name
, method_list
26 def get_files_list(directory
, extension
):
29 dh
= os
.scandir(directory
)
32 array_items
+= get_files_list(entry
.path
, extension
)
34 if entry
.name
.endswith(extension
):
35 array_items
.append(entry
.path
)
40 if name
.startswith('tdf'):
41 return "[https://bugs.documentfoundation.org/show_bug.cgi?id={} {}]"\
42 .format(name
.split('tdf')[1], name
)
50 'Writer' : ['../uitest/writer_tests/', '../writerperfect/qa/uitest/', '../sw/qa/uitest/writer_tests/'],
51 'Calc' : ['../uitest/calc_tests', '../sc/qa/uitest/'],
52 'Impress' : ['../uitest/impress_tests/'],
53 'Math': ['../uitest/math_tests/'],
55 'Manual_tests': ['../uitest/manual_tests/']}
59 print('{{Menu.Development}}')
60 print('{{OrigLang|}}')
62 print('Generated on ' + str(datetime
.datetime
.now()))
63 for k
,v
in uitest_dirs
.items():
64 print('\n=== ' + k
+ ' ===')
67 uitest_files
= get_files_list(uitest_dir
, uitest_ext
)
68 for uitest_file
in uitest_files
:
69 class_name
, method_names
= analyze_file(uitest_file
)
71 print("* {} ({})".format(
72 linkFormat(class_name
),uitest_file
[3:]))
73 for m
in method_names
:
74 print('**' + linkFormat(m
))
76 print('[[Category:QA]][[Category:Development]]')
78 if __name__
== '__main__':