5 from __future__
import print_function
7 from optparse
import OptionParser
11 after a list of tests is extracted from the infile
12 add differences to the dicts
16 for test
in test_dict.keys():
17 for ftype
in [
'ESD',
'AOD']:
23 if line.startswith(
'Py:diff-root INFO old:')
and test
in line
and ftype
in line:
25 if line.startswith(
'Py:Acmd'):
27 if doRead
and (
"leaves differ" in line
or "WARNING" in line):
28 if line.split(
'\n')[0]
not in test_dict[test][ftype]:
29 test_dict[test][ftype].
append(line.split(
'\n')[0])
31 if debugmode
and doRead:
32 print (
"DEBUG: %s: %s" %(linenr,line.split(
'\n')[0]))
37 create initial dict including all tests which have been probed
43 if "CHANGED" in line
or "IDENTICAL" in line:
44 test = line.split()[0]
45 if selected_test
and test
not in selected_test:
47 test_dict[test] = {
'ESD' : [],
49 'status' : line.split()[1]}
55 prints sorted summary of tests
58 list_sorted =
sorted(test_dict.keys())
59 for test
in list_sorted:
61 print (
'{0:50} {1:10}'.
format(test, test_dict[test][
'status']))
65 prints detailed diff on screen
68 list_sorted =
sorted(test_dict.keys())
69 for test
in list_sorted:
70 if test_dict[test][
'status'] ==
'IDENTICAL':
72 print (test, test_dict[test][
'status'])
73 for item
in [
'ESD',
'AOD']:
75 for line
in test_dict[test][item]:
101 if __name__ ==
"__main__":
102 parser=OptionParser(usage=
"\n ./sstat \n")
103 parser.add_option(
"-f",
"--file",type=
"string" ,dest=
"infile" ,default=
"ESDTAGCOMM_comparison_diffroot_log" ,help=
"inputfile diff-root")
104 parser.add_option(
"-t",
"--test" ,type=
"string" ,dest=
"test" ,default=
None ,help=
"condensed output file")
106 parser.add_option(
"-d",
"--debug", action=
"store_true", dest=
"verbose", default=
False, help=
"print extra DEBUG messages")
107 (options,args)=parser.parse_args()
109 debugmode = options.verbose
111 infile_name =
'ESDTAGCOMM_comparison_diffroot_log'
113 selected_tests =
None
115 selected_tests = options.test.split(
",")
118 test_dict =
getTests(options.infile, selected_tests)
120 test_dict =
getResults(options.infile,test_dict )