def locate_binary_under_test(suffix) -> str: path = glob(get_fbcode_dir() + "/buck-out/**/hphp/hack/test/rust/" + suffix) assert len(path) < 2, \ "Found {} binaries (try `buck clean` with suffix {}".format( len(path), suffix) return path[0]
import argparse import json import os import re import shlex import subprocess import sys from difflib import unified_diff from glob import glob, iglob from typing import Iterable, List from libfb.py.fbcode_root import get_fbcode_dir HACK_TEST_DIR_DEFAULT = os.path.join(get_fbcode_dir(), "hphp/hack/test") def parse_args(): ap = argparse.ArgumentParser() ap.add_argument( "--dir", default=HACK_TEST_DIR_DEFAULT, help="root directory containing Hack files to be tested", ) ap.add_argument( "--file", "-f", action="append", help="test specific file only (may be repeated)", )
def get_test_repos_path() -> 'os.PathLike[str]': return os.path.join(get_fbcode_dir(), 'fs_image/rpm/tests/repos')