Changeset View
Changeset View
Standalone View
Standalone View
test/util/bitcoin-util-test.py
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | def bctest(testDir, testObj, buildenv): | ||||
Raises an error if input can't be read, executable fails, or output/RC | Raises an error if input can't be read, executable fails, or output/RC | ||||
are not as expected. Error is caught by bctester() and reported. | are not as expected. Error is caught by bctester() and reported. | ||||
""" | """ | ||||
# Get the exec names and arguments | # Get the exec names and arguments | ||||
execprog = os.path.join( | execprog = os.path.join( | ||||
buildenv["BUILDDIR"], "src", testObj["exec"] + buildenv["EXEEXT"]) | buildenv["BUILDDIR"], "src", testObj["exec"] + buildenv["EXEEXT"]) | ||||
execargs = testObj['args'] | execargs = testObj['args'] | ||||
execrun = [execprog] + execargs | execrun = [execprog] + execargs | ||||
if buildenv["EMULATOR"]: | |||||
execrun = [buildenv["EMULATOR"]] + execrun | |||||
# Read the input data (if there is any) | # Read the input data (if there is any) | ||||
stdinCfg = None | stdinCfg = None | ||||
inputData = None | inputData = None | ||||
if "input" in testObj: | if "input" in testObj: | ||||
filename = os.path.join(testDir, testObj["input"]) | filename = os.path.join(testDir, testObj["input"]) | ||||
inputData = open(filename, encoding="utf8").read() | inputData = open(filename, encoding="utf8").read() | ||||
stdinCfg = subprocess.PIPE | stdinCfg = subprocess.PIPE | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |