@@ -46,6 +46,7 @@ def summary(s, display, genv, wrappers, urls, png=None):
4646 stdout = open (logpath , "w" ), stderr = subprocess .STDOUT ,
4747 start_new_session = True )
4848 answers = {}
49+ menus = {}
4950 try :
5051 deadline = time .time () + 120
5152 while time .time () < deadline and not any (
@@ -55,19 +56,22 @@ def summary(s, display, genv, wrappers, urls, png=None):
5556 with open (cmd , "a" ) as h :
5657 for i , u in enumerate (urls ):
5758 h .write ("summary %s\n " % u )
59+ h .write ("toolsmenu %s\n " % u )
5860 if png :
5961 h .write ("snap %s\n " % os .path .join (png , "summary-%d.png" % i ))
6062 deadline = time .time () + 90
6163 while time .time () < deadline and len (answers ) < len (urls ):
64+ log = open (logpath , errors = "replace" ).read ()
6265 for u in urls :
63- m = re .search (r"ECCE_TEST_ORGANIZER: summary %s: (.*)" % re .escape (u ),
64- open ( logpath , errors = "replace" ). read () )
65- if m :
66+ m = re .search (r"ECCE_TEST_ORGANIZER: summary %s: (.*)" % re .escape (u ), log )
67+ t = re . search ( r"ECCE_TEST_ORGANIZER: toolsmenu %s: (.*)" % re . escape ( u ), log )
68+ if m and t :
6669 answers [u ] = m .group (1 )
70+ menus [u ] = t .group (1 )
6771 time .sleep (0.5 )
6872 finally :
6973 stop (org )
70- return answers
74+ return answers , menus
7175
7276
7377def main ():
@@ -135,12 +139,16 @@ def main():
135139 finally :
136140 ed .close ()
137141
138- answers = summary (s , display , genv , wrappers , list (opts .values ()), args .png )
142+ answers , menus = summary (s , display , genv , wrappers , list (opts .values ()), args .png )
139143 for code , url in opts .items ():
140144 out = answers .get (url , "" )
141145 tools = re .findall (r"tool=(.*?)(?= tool=|$)" , out )
142146 check (("%s MD Optimize" % code ) in tools ,
143147 "the %s Optimize summary names its editor: %s" % (code , tools ))
148+ items = re .findall (r"item=(.*?)(?= item=|$)" , menus .get (url , "" ))
149+ check (any (i .startswith ("%s MD Optimize" % code ) for i in items ) and
150+ (code == "NWChem" or not any (i .startswith ("NWChem MD" ) for i in items )),
151+ "the %s Optimize Tools menu names its editor: %s" % (code , items ))
144152 check (tools and not any (t .endswith (":clipped" ) for t in tools ),
145153 "no %s summary button clips its label" % code )
146154 finally :
0 commit comments