run_command="./$seq"
fi
export OUTPUT_DIR=$PWD
- (cd "$source_iotests";
- MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
- $run_command >$tmp.out 2>&1)
+ if $debug; then
+ (cd "$source_iotests";
+ MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
+ $run_command -d 2>&1 | tee $tmp.out)
+ else
+ (cd "$source_iotests";
+ MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
+ $run_command >$tmp.out 2>&1)
+ fi
sts=$?
$timestamp && _timestamp
stop=`_wallclock`
def main(supported_fmts=[], supported_oses=['linux']):
'''Run tests'''
+ debug = '-d' in sys.argv
+ verbosity = 1
if supported_fmts and (imgfmt not in supported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
# We need to filter out the time taken from the output so that qemu-iotest
# can reliably diff the results against master output.
import StringIO
- output = StringIO.StringIO()
+ if debug:
+ output = sys.stdout
+ verbosity = 2
+ sys.argv.remove('-d')
+ else:
+ output = StringIO.StringIO()
class MyTestRunner(unittest.TextTestRunner):
- def __init__(self, stream=output, descriptions=True, verbosity=1):
+ def __init__(self, stream=output, descriptions=True, verbosity=verbosity):
unittest.TextTestRunner.__init__(self, stream, descriptions, verbosity)
# unittest.main() will use sys.exit() so expect a SystemExit exception
try:
unittest.main(testRunner=MyTestRunner)
finally:
- sys.stderr.write(re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 tests', output.getvalue()))
+ if not debug:
+ sys.stderr.write(re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 tests', output.getvalue()))