aboutsummaryrefslogtreecommitdiff
path: root/test/util/bctest.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-03-29 10:20:10 -0400
committerJohn Newbery <john@johnnewbery.com>2017-03-30 16:37:53 -0400
commit21704f6334d2a4bd140c6e3260c4bfa3f3157bad (patch)
treeb77e55009e0e648b16c007fb077250088886777b /test/util/bctest.py
parenteb66bf9bdd5ae20c546314eb2c494ac09929970f (diff)
downloadbitcoin-21704f6334d2a4bd140c6e3260c4bfa3f3157bad.tar.xz
Check stderr when testing bitcoin-tx
Diffstat (limited to 'test/util/bctest.py')
-rw-r--r--test/util/bctest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/util/bctest.py b/test/util/bctest.py
index dfe3a123d1..b17cf77ae3 100644
--- a/test/util/bctest.py
+++ b/test/util/bctest.py
@@ -102,6 +102,18 @@ def bctest(testDir, testObj, buildenv):
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