Expect no line difference with _Unwind

This commit is contained in:
Jeremy 2023-07-20 22:09:59 -04:00
parent c062bddd83
commit a18c6e9c34
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 7 additions and 3 deletions

View File

@ -17,13 +17,13 @@ def main():
threshold = 100 # ms threshold = 100 # ms
if expect_slow: if expect_slow:
if time > 100: if time > threshold:
print(f"Success (expecting slow): Test program took {time} ms") print(f"Success (expecting slow): Test program took {time} ms")
else: else:
print(f"Error (expecting slow): Test program took {time} ms") print(f"Error (expecting slow): Test program took {time} ms")
sys.exit(1) sys.exit(1)
else: else:
if time > 100: if time > threshold:
print(f"Error: Test program took {time} ms") print(f"Error: Test program took {time} ms")
sys.exit(1) sys.exit(1)
else: else:

View File

@ -78,13 +78,17 @@ def output_matches(output: str, params: Tuple[str]):
expected = [line.strip().split("||") for line in expected.split("\n")] expected = [line.strip().split("||") for line in expected.split("\n")]
output = [line.strip().split("||") for line in output.split("\n")] output = [line.strip().split("||") for line in output.split("\n")]
max_line_diff = MAX_LINE_DIFF
if "CPPTRACE_UNWIND_WITH_UNWIND" in params:
max_line_diff = 0
errored = False errored = False
for i, ((output_file, output_line, output_symbol), (expected_file, expected_line, expected_symbol)) in enumerate(zip(output, expected)): for i, ((output_file, output_line, output_symbol), (expected_file, expected_line, expected_symbol)) in enumerate(zip(output, expected)):
if output_file != expected_file: if output_file != expected_file:
print(f"Error: File name mismatch on line {i + 1}, found \"{output_file}\" expected \"{expected_file}\"") print(f"Error: File name mismatch on line {i + 1}, found \"{output_file}\" expected \"{expected_file}\"")
errored = True errored = True
if abs(int(output_line) - int(expected_line)) > MAX_LINE_DIFF: if abs(int(output_line) - int(expected_line)) > max_line_diff:
print(f"Error: File line mismatch on line {i + 1}, found {output_line} expected {expected_line}") print(f"Error: File line mismatch on line {i + 1}, found {output_line} expected {expected_line}")
errored = True errored = True
if output_symbol != expected_symbol: if output_symbol != expected_symbol: