Skip to content

Commit

Permalink
bitcoin-util-test.py should fail if the output file is empty
Browse files Browse the repository at this point in the history
Github-Pull: #8836
Rebased-From: da9469770847df56e67e629986129a087b5bd7a5
  • Loading branch information
jnewbery authored and MarcoFalke committed Oct 3, 2016
1 parent d87227d commit eb18cc1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/bctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def bctest(testDir, testObj, exeext):
if "output_cmp" in testObj:
outputFn = testObj['output_cmp']
outputData = open(testDir + "/" + outputFn).read()
if not outputData:
print("Output data missing for " + outputFn)
sys.exit(1)
proc = subprocess.Popen(execrun, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE,universal_newlines=True)
try:
outs = proc.communicate(input=inputData)
Expand Down
19 changes: 19 additions & 0 deletions src/test/data/txcreate2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"txid": "cf90229625e9eb10f6be8156bf6aa5ec2eca19a42b1e05c11f3029b560a32e13",
"version": 1,
"locktime": 0,
"vin": [
],
"vout": [
{
"value": 0.00,
"n": 0,
"scriptPubKey": {
"asm": "",
"hex": "",
"type": "nonstandard"
}
}
],
"hex": "01000000000100000000000000000000000000"
}

0 comments on commit eb18cc1

Please sign in to comment.