forked from ElementsProject/elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Garzik
committed
Aug 19, 2014
1 parent
dd28197
commit d789386
Showing
6 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ src/qt/test/moc*.cpp | |
*.bak | ||
*.rej | ||
*.orig | ||
*.pyc | ||
*.o | ||
*.o-* | ||
*.patch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2014 BitPay, Inc. | ||
# Distributed under the MIT/X11 software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
import subprocess | ||
import os | ||
import json | ||
import sys | ||
|
||
def bctest(testDir, testObj): | ||
execargs = testObj['exec'] | ||
outputFn = testObj['output_cmp'] | ||
outputData = open(testDir + "/" + outputFn).read() | ||
|
||
proc = subprocess.Popen(execargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
try: | ||
outs = proc.communicate() | ||
except OSError: | ||
print("OSError, Failed to execute " + execargs[0]) | ||
sys.exit(1) | ||
|
||
if outs[0] != outputData: | ||
print("Output data mismatch for " + outputFn) | ||
sys.exit(1) | ||
|
||
def bctester(testDir, input_basename): | ||
input_filename = testDir + "/" + input_basename | ||
raw_data = open(input_filename).read() | ||
input_data = json.loads(raw_data) | ||
|
||
for testObj in input_data: | ||
bctest(testDir, testObj) | ||
|
||
sys.exit(0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/python | ||
# Copyright 2014 BitPay, Inc. | ||
# Distributed under the MIT/X11 software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
import os | ||
import bctest | ||
|
||
if __name__ == '__main__': | ||
bctest.bctester(os.environ["srcdir"] + "/test/data", | ||
"bitcoin-util-test.json") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{ "exec": ["./bitcoin-tx", "-create"], | ||
"output_cmp": "blanktx.hex" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
01000000000000000000 |