Exemplo n.º 1
0
def main():
    args = arg_parser()

    wrapper = os.environ.get('MESON_EXE_WRAPPER')
    if wrapper is not None:
        args.glcpp = split_args(wrapper) + [args.glcpp]
    else:
        args.glcpp = [args.glcpp]

    success = True
    try:
        if args.unix:
            success = success and test_unix(args)
        if args.windows:
            success = success and test_windows(args)
        if args.oldmac:
            success = success and test_oldmac(args)
        if args.bizarro:
            success = success and test_bizarro(args)
        if args.valgrind:
            success = success and test_valgrind(args)
    except OSError as e:
        if e.errno == errno.ENOEXEC:
            print('Skipping due to inability to run host binaries.',
                  file=sys.stderr)
            sys.exit(77)
        raise

    exit(0 if success else 1)
Exemplo n.º 2
0
except ImportError:
    from shlex import split as split_args

parser = argparse.ArgumentParser()
parser.add_argument('--i965_asm', help='path to i965_asm binary')
parser.add_argument(
    '--gen_name',
    help='name of the hardware generation (as understood by i965_asm)')
parser.add_argument('--gen_folder',
                    type=pathlib.Path,
                    help='name of the folder for the generation')
args = parser.parse_args()

wrapper = os.environ.get('MESON_EXE_WRAPPER')
if wrapper is not None:
    i965_asm = split_args(wrapper) + [args.i965_asm]
else:
    i965_asm = [args.i965_asm]

success = True

for asm_file in args.gen_folder.glob('*.asm'):
    expected_file = asm_file.stem + '.expected'
    expected_path = args.gen_folder / expected_file

    try:
        command = i965_asm + [
            '--type', 'hex', '--gen', args.gen_name, asm_file
        ]
        with subprocess.Popen(command,
                              stdout=subprocess.PIPE,
Exemplo n.º 3
0
def get_test_runner(runner):
    """Wrap the test runner in the exe wrapper if necessary."""
    wrapper = os.environ.get('MESON_EXE_WRAPPER', None)
    if wrapper is None:
        return [runner]
    return split_args(wrapper) + [runner]