| # Wrapper for tests that hides the output if they succeed. |
| # Copyright (C) 2020 Red Hat, Inc. |
| # Author: Paolo Bonzini <pbonzini@redhat.com> |
| parser = argparse.ArgumentParser(description='Test driver for QEMU') |
| parser.add_argument('-C', metavar='DIR', dest='dir', default='.', |
| help='change to DIR before doing anything else') |
| parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', |
| parser.add_argument('test_args', nargs=argparse.REMAINDER) |
| args = parser.parse_args() |
| test_args = args.test_args |
| test_args = test_args[1:] |
| result = subprocess.run(test_args, stdout=None, stderr=None) |
| result = subprocess.run(test_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| sys.stdout.buffer.write(result.stdout) |
| sys.exit(result.returncode) |