aboutsummaryrefslogtreecommitdiff
path: root/src/test/bctest.py
diff options
context:
space:
mode:
authorJohn Newbery <[email protected]>2017-03-29 10:20:10 -0400
committerWladimir J. van der Laan <[email protected]>2017-03-31 11:47:50 +0200
commitecc523288cc655089d83f168e81ae1f249a3ae88 (patch)
tree0362381a38e2d7e48e50a877501703eddc9fd8e1 /src/test/bctest.py
parentbitcoin-tx: Fix missing range check (diff)
downloaddiscoin-ecc523288cc655089d83f168e81ae1f249a3ae88.tar.xz
discoin-ecc523288cc655089d83f168e81ae1f249a3ae88.zip
Check stderr when testing bitcoin-tx
Github-Pull: #10130 Rebased-From: 21704f6334d2a4bd140c6e3260c4bfa3f3157bad
Diffstat (limited to 'src/test/bctest.py')
-rw-r--r--src/test/bctest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/bctest.py b/src/test/bctest.py
index adc5d0e41..7ea15dfdd 100644
--- a/src/test/bctest.py
+++ b/src/test/bctest.py
@@ -98,6 +98,18 @@ def bctest(testDir, testObj, exeext):
logging.error("Return code mismatch for " + outputFn)
raise Exception
+ if "error_txt" in testObj:
+ want_error = testObj["error_txt"]
+ # Compare error text
+ # TODO: ideally, we'd compare the strings exactly and also assert
+ # That stderr is empty if no errors are expected. However, bitcoin-tx
+ # emits DISPLAY errors when running as a windows application on
+ # linux through wine. Just assert that the expected error text appears
+ # somewhere in stderr.
+ if want_error not in outs[1]:
+ logging.error("Error mismatch:\n" + "Expected: " + want_error + "\nReceived: " + outs[1].rstrip())
+ raise Exception
+
def bctester(testDir, input_basename, buildenv):
""" Loads and parses the input file, runs all tests and reports results"""
input_filename = testDir + "/" + input_basename