6 from optparse
import OptionParser
10 after a list of tests is extracted from the infile
11 add differences to the dicts
14 for test
in test_dict.keys():
15 for ftype
in [
'ESD',
'AOD']:
21 if line.startswith(
'Py:diff-root INFO old:')
and test
in line
and ftype
in line:
23 if line.startswith(
'Py:Acmd'):
25 if doRead
and (
"leaves differ" in line
or "WARNING" in line):
26 if line.split(
'\n')[0]
not in test_dict[test][ftype]:
27 test_dict[test][ftype].
append(line.split(
'\n')[0])
29 if debugmode
and doRead:
30 print (
"DEBUG: %s: %s" %(linenr,line.split(
'\n')[0]))
35 create initial dict including all tests which have been probed
41 if "CHANGED" in line
or "IDENTICAL" in line:
42 test = line.split()[0]
43 if selected_test
and test
not in selected_test:
45 test_dict[test] = {
'ESD' : [],
47 'status' : line.split()[1]}
53 prints sorted summary of tests
56 list_sorted =
sorted(test_dict.keys())
57 for test
in list_sorted:
59 print (
'{0:50} {1:10}'.
format(test, test_dict[test][
'status']))
63 prints detailed diff on screen
66 list_sorted =
sorted(test_dict.keys())
67 for test
in list_sorted:
68 if test_dict[test][
'status'] ==
'IDENTICAL':
70 print (test, test_dict[test][
'status'])
71 for item
in [
'ESD',
'AOD']:
73 for line
in test_dict[test][item]:
99 if __name__ ==
"__main__":
100 parser=OptionParser(usage=
"\n ./sstat \n")
101 parser.add_option(
"-f",
"--file",type=
"string" ,dest=
"infile" ,default=
"ESDTAGCOMM_comparison_diffroot_log" ,help=
"inputfile diff-root")
102 parser.add_option(
"-t",
"--test" ,type=
"string" ,dest=
"test" ,default=
None ,help=
"condensed output file")
104 parser.add_option(
"-d",
"--debug", action=
"store_true", dest=
"verbose", default=
False, help=
"print extra DEBUG messages")
105 (options,args)=parser.parse_args()
107 debugmode = options.verbose
109 infile_name =
'ESDTAGCOMM_comparison_diffroot_log'
111 selected_tests =
None
113 selected_tests = options.test.split(
",")
116 test_dict =
getTests(options.infile, selected_tests)
118 test_dict =
getResults(options.infile,test_dict )