Lines Matching refs:cls
41 cls, test_dir: str, testdata_dir: str, use_browser: bool, ndk_path: Optional[str], argument
49 cls.script_dir = Path(__file__).resolve().parents[1]
50 cls.test_base_dir = Path(test_dir).resolve()
51 cls.test_base_dir.mkdir(parents=True, exist_ok=True)
52 cls.testdata_dir = Path(testdata_dir).resolve()
53 cls.browser_option = [] if use_browser else ['--no_browser']
54 cls.ndk_path = ndk_path
55 cls.progress_conn = progress_conn
58 cls.log_fh = open(cls.test_base_dir / 'test.log', 'a')
60 logging.getLogger().addHandler(logging.StreamHandler(cls.log_fh))
62 os.dup2(cls.log_fh.fileno(), sys.stderr.fileno())
67 cls.adb = AdbHelper(enable_switch_to_root=True)
68 cls.android_version = cls.adb.get_android_version()
69 cls.device_features = None
72 def log(cls, s: str): argument
73 cls.log_fh.write(s + '\n')
75 cls.log_fh.flush()
78 def testdata_path(cls, testdata_name: str) -> str: argument
80 return str(cls.testdata_dir / testdata_name)
83 def get_test_dir(cls, test_name: str) -> Path: argument
85 return cls.test_base_dir / test_name
88 def script_path(cls, script_name: str) -> str: argument
90 return str(cls.script_dir / script_name)
93 def get_device_features(cls): argument
94 if cls.device_features is None:
95 args = [sys.executable, cls.script_path(
99 cls.device_features = output.split()
100 return cls.device_features
103 def is_trace_offcpu_supported(cls): argument
104 return 'trace-offcpu' in cls.get_device_features()
107 def get_32bit_abi(cls): argument
108 return cls.adb.get_property('ro.product.cpu.abilist32').strip().split(',')[0]
111 def write_progress(cls, progress: str): argument
112 if cls.progress_conn:
113 cls.progress_conn.send(progress)