File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,13 @@ class ComplianceTestRunner(object):
125
125
def _run_test (self , test_case ):
126
126
command = shlex .split (self .jp_executable )
127
127
command .append (test_case ['expression' ])
128
- process = subprocess .Popen (command , stdout = subprocess .PIPE ,
129
- stderr = subprocess .PIPE ,
130
- stdin = subprocess .PIPE )
128
+ try :
129
+ process = subprocess .Popen (command , stdout = subprocess .PIPE ,
130
+ stderr = subprocess .PIPE ,
131
+ stdin = subprocess .PIPE )
132
+ except Exception , e :
133
+ raise RuntimeError ('Could not execute test executable "%s": '
134
+ '%s' % (' ' .join (command ), e ))
131
135
process .stdin .write (json .dumps (test_case ['given' ]))
132
136
process .stdin .flush ()
133
137
stdout , stderr = process .communicate ()
@@ -219,9 +223,15 @@ def main():
219
223
if args .list :
220
224
display_available_tests (runner .get_compliance_test_files ())
221
225
else :
222
- runner .run_tests ()
226
+ try :
227
+ runner .run_tests ()
228
+ except Exception , e :
229
+ sys .stderr .write (str (e ))
230
+ sys .stderr .write ("\n " )
231
+ return 1
223
232
sys .stdout .write ('\n ' )
233
+ return 0
224
234
225
235
226
236
if __name__ == '__main__' :
227
- main ()
237
+ sys . exit ( main () )
You can’t perform that action at this time.
0 commit comments