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/.
13 def analyze_file(filename
):
16 with
open(filename
, encoding
='utf-8') as fh
:
18 if line
.lstrip().startswith('class '):
19 class_name
= line
.lstrip().split(" ")[1].split("(")[0]
20 elif line
.lstrip().startswith('def test_'):
22 line
.lstrip().split("test_")[1].split("(")[0])
25 return class_name
, method_list
27 def get_files_list(directory
, extension
):
30 dh
= os
.scandir(directory
)
33 array_items
+= get_files_list(entry
.path
, extension
)
35 if entry
.name
.endswith(extension
):
36 array_items
.append(entry
.path
)
41 bugId
= re
.search(r
'\d{5,6}', name
)
43 return "[https://bugs.documentfoundation.org/show_bug.cgi?id={} {}]"\
44 .format(bugId
.group(), name
)
52 'Writer' : ['../writerperfect/qa/uitest/', '../sw/qa/uitest/'],
53 'Calc' : ['../sc/qa/uitest/'],
54 'Impress' : ['../uitest/impress_tests/', '../sd/qa/uitest/'],
55 'Math': ['../uitest/math_tests/'],
56 'Demo': ['../uitest/demo_ui/'],
61 print('{{Menu.Development}}')
63 print('Generated on ' + str(datetime
.datetime
.now()))
64 for k
,v
in uitest_dirs
.items():
65 print('\n=== ' + k
+ ' ===')
68 uitest_files
= get_files_list(uitest_dir
, uitest_ext
)
69 for uitest_file
in uitest_files
:
70 class_name
, method_names
= analyze_file(uitest_file
)
72 print("# {} ({})".format(
73 linkFormat(class_name
),uitest_file
[3:]))
74 for m
in method_names
:
75 print('##' + linkFormat(m
))
77 print('[[Category:QA]][[Category:Development]]')
79 if __name__
== '__main__':