diff options
Diffstat (limited to 'src/test/bctest.py')
-rw-r--r-- | src/test/bctest.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test/bctest.py b/src/test/bctest.py index 3a8d0ea51b..d801415c70 100644 --- a/src/test/bctest.py +++ b/src/test/bctest.py @@ -1,7 +1,7 @@ # Copyright 2014 BitPay, Inc. # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. - +from __future__ import division,print_function,unicode_literals import subprocess import os import json @@ -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) @@ -42,13 +45,17 @@ def bctest(testDir, testObj, exeext): print("Return code mismatch for " + outputFn) sys.exit(1) -def bctester(testDir, input_basename, buildenv): +def bctester(testDir, input_basename, buildenv, verbose = False): input_filename = testDir + "/" + input_basename raw_data = open(input_filename).read() input_data = json.loads(raw_data) for testObj in input_data: + if verbose and "description" in testObj: + print ("Testing: " + testObj["description"]) bctest(testDir, testObj, buildenv.exeext) + if verbose and "description" in testObj: + print ("PASS") sys.exit(0) |