aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-03-07 18:07:08 -0500
committerJohn Newbery <john@johnnewbery.com>2017-03-07 18:07:08 -0500
commit6c1fb73dd1744b7281e5d506c14307daf1b72e1f (patch)
tree2af4e14054915d9ed6442fd3fb34480f86a5a303 /src
parent47510ad3dd514e04caa364ff56ab2cc83569efb9 (diff)
downloadbitcoin-6c1fb73dd1744b7281e5d506c14307daf1b72e1f.tar.xz
Improve logging in bctest.py if there is a formatting mismatch
Diffstat (limited to 'src')
-rw-r--r--src/test/bctest.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test/bctest.py b/src/test/bctest.py
index adc5d0e418..c69f52afc3 100644
--- a/src/test/bctest.py
+++ b/src/test/bctest.py
@@ -10,6 +10,7 @@ import sys
import binascii
import difflib
import logging
+import pprint
def parse_output(a, fmt):
"""Parse the output according to specified format.
@@ -65,6 +66,7 @@ def bctest(testDir, testObj, exeext):
raise
if outputData:
+ data_mismatch, formatting_mismatch = False, False
# Parse command output and expected output
try:
a_parsed = parse_output(outs[0], outputType)
@@ -79,7 +81,7 @@ def bctest(testDir, testObj, exeext):
# Compare data
if a_parsed != b_parsed:
logging.error("Output data mismatch for " + outputFn + " (format " + outputType + ")")
- raise Exception
+ data_mismatch = True
# Compare formatting
if outs[0] != outputData:
error_message = "Output formatting mismatch for " + outputFn + ":\n"
@@ -88,7 +90,9 @@ def bctest(testDir, testObj, exeext):
fromfile=outputFn,
tofile="returned"))
logging.error(error_message)
- raise Exception
+ formatting_mismatch = True
+
+ assert not data_mismatch and not formatting_mismatch
# Compare the return code to the expected return code
wantRC = 0
@@ -115,7 +119,9 @@ def bctester(testDir, input_basename, buildenv):
failed_testcases.append(testObj["description"])
if failed_testcases:
- logging.error("FAILED TESTCASES: [" + ", ".join(failed_testcases) + "]")
+ error_message = "FAILED_TESTCASES:\n"
+ error_message += pprint.pformat(failed_testcases, width=400)
+ logging.error(error_message)
sys.exit(1)
else:
sys.exit(0)