Skip to content

Commit d0200e3

Browse files
authored
Merge pull request #886 from pbalcer/better-match-out
[test] improve match file error output
2 parents 4c6d556 + be85a49 commit d0200e3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cmake/match.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ execute_process(
7171
)
7272

7373
if(TEST_RESULT)
74-
file(READ ${OUT_FILE} OUTPUT)
75-
file(READ ${MATCH_FILE} MATCH_STRING)
76-
message(FATAL_ERROR "Failed: The output of ${OUT_FILE}:\n ${OUTPUT}\n does not match ${MATCH_FILE}:\n ${MATCH_STRING} (${TEST_RESULT})")
74+
message(FATAL_ERROR "Failed (${TEST_RESULT}): The output of ${OUT_FILE} does not match ${MATCH_FILE}")
7775
elseif()
7876
message("Passed: The output ${OUT_FILE} matches ${MATCH_FILE}")
7977
endif()

cmake/match.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
print("Line " + str(i+1) + " does not match")
6161
print("is: " + input_line)
6262
print("expected: " + match_line.strip())
63+
print("--- Input Lines " + "-" * 64)
64+
print("".join(input_lines).strip())
65+
print("--- Match Lines " + "-" * 64)
66+
print("".join(match_lines).strip())
67+
print("-" * 80)
6368
sys.exit(1)
6469
else:
6570
if (input_idx == len(input_lines) - 1):

0 commit comments

Comments
 (0)