Fix errors in run_tests.py
This commit is contained in:
parent
736904b13f
commit
709ee95309
@ -29,8 +29,6 @@ def run_command(args, executable=None, merge_stderr=False):
|
|||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
stdout = stdout.decode('utf-8')
|
|
||||||
stderr = stderr.decode('utf-8')
|
|
||||||
if merge_stderr:
|
if merge_stderr:
|
||||||
output = ''
|
output = ''
|
||||||
if stdout:
|
if stdout:
|
||||||
@ -68,7 +66,7 @@ class OutputCheckTest:
|
|||||||
def run(self):
|
def run(self):
|
||||||
args = [self.name + '.pwn']
|
args = [self.name + '.pwn']
|
||||||
if self.extra_args is not None:
|
if self.extra_args is not None:
|
||||||
args += extra_args
|
args += self.extra_args
|
||||||
process, stdout, stderr = run_compiler(args=args)
|
process, stdout, stderr = run_compiler(args=args)
|
||||||
if self.errors is None:
|
if self.errors is None:
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
@ -79,7 +77,7 @@ class OutputCheckTest:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
errors = strip(stderr)
|
errors = strip(stderr)
|
||||||
expected_errors = strip(self.errors)
|
expected_errors = strip(self.errors) if self.errors is not None else ''
|
||||||
if errors != expected_errors:
|
if errors != expected_errors:
|
||||||
self.fail_reason = (
|
self.fail_reason = (
|
||||||
'Error output didn\'t match\n\nExpected errors:\n\n{}\n\n'
|
'Error output didn\'t match\n\nExpected errors:\n\n{}\n\n'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user