Skip to content

Commit

Permalink
Add case for command failure to driver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuanhao-wu committed Jan 15, 2020
1 parent d827f66 commit 17e6c6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/verilog-conversion/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ def generate_sexp(self, path, output_folder, keep_sexp=False, verbose=False):
try:
if verbose:
print('cmd: ', ' '.join(cmdline))
subprocess.run(' '.join(cmdline), shell=True)
res = subprocess.run(' '.join(cmdline), shell=True)
else:
with open(os.devnull, 'wb') as null:
subprocess.run(' '.join(cmdline), shell=True,
res = subprocess.run(' '.join(cmdline), shell=True,
stdout=null,
stderr=null)
if res.returncode != 0:
raise RuntimeError('systemc-clang exits with code: {}'.format(res.returncode))
move_required = os.path.normpath(sexp_loc) != os.path.normpath(output_filename)
if os.path.isfile(sexp_loc):
if move_required:
Expand Down

0 comments on commit 17e6c6a

Please sign in to comment.