File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,19 +48,22 @@ def compile_and_check(examples):
4848
4949 # executing commands from cmd
5050 os .chdir (t )
51- with open (os .path .join (t , 'output.log' ), 'w' ) as f :
51+ logfile = os .path .join (t , 'output.log' )
52+ with open (logfile , 'w' ) as f :
5253 for cmd in example ['cmd' ]:
5354 cmd = cmd [2 :].strip ()
5455 print ('--' , 'calling' , cmd )
5556 subprocess .call (cmd .split (' ' ), stderr = subprocess .STDOUT , stdout = f )
5657
5758 # comparing with out
58- with open (os . path . join ( t , 'output.log' ) , 'r' ) as f :
59+ with open (logfile , 'r' ) as f :
5960 for i , line in enumerate (f .readlines ()):
6061 if example ['out' ][i ] != line :
6162 print ('--' , 'error' )
6263 errcnt += 1
63-
64+ except :
65+ print ('--' , 'error' )
66+ with open (logfile , 'r' ) as fin : print fin .read ()
6467 finally :
6568 os .chdir (path )
6669 shutil .rmtree (t )
You can’t perform that action at this time.
0 commit comments