• Home
  • Raw
  • Download

Lines Matching full:f

45     parser.add_argument('-f', '--frontend', metavar='opt',
62 help=f'aot compile with pgo, default threshold is {DEFAULT_PGO_THRESHOLD}')
64 help=f'pgo hotness threshold, default is {DEFAULT_PGO_THRESHOLD}')
68 help=f'specify seconds of test timeout, default is {DEFAULT_TIMEOUT}')
89 return (1, '', f'exec command timeout {timeout}s')
100 with open(f'{hap_dir}/module.json') as f:
101 data = json.load(f)
108 with open(f'{hap_dir}/module.json') as f:
109 data = json.load(f)
122 print(f'pls place this script at: {self.place_dir}')
125 self.ohdir = os.path.abspath(f'{self.self_dir}/../../../..')
156 product_dir = f'{self.ohdir}/out/{self.product}'
157 libs_dir_x64_release = (f'{self.ohdir}/prebuilts/clang/ohos/linux-x86_64/llvm/lib:'
158 f'{product_dir}/clang_x64/arkcompiler/ets_runtime:'
159 f'{product_dir}/clang_x64/thirdparty/icu:'
160 f'{product_dir}/clang_x64/thirdparty/zlib')
161 libs_dir_x64_debug = (f'{self.ohdir}/prebuilts/clang/ohos/linux-x86_64/llvm/lib:'
162f'{product_dir}/clang_x64/exe.unstripped/clang_x64/arkcompiler/ets_runtime:'
163f'{product_dir}/clang_x64/lib.unstripped/clang_x64/arkcompiler/ets_runtime:'
164 f'{product_dir}/clang_x64/lib.unstripped/clang_x64/test/test:'
165 f'{product_dir}/clang_x64/lib.unstripped/clang_x64/thirdparty/icu:'
166 f'{product_dir}/clang_x64/lib.unstripped/clang_x64/thirdparty/zlib')
167 …libs_dir_arm64_release = (f'{self.ohdir}/prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-…
168 f'{product_dir}/arkcompiler/ets_runtime/:'
169 f'{product_dir}/utils/utils_base/:'
170 f'{product_dir}/thirdparty/icu:'
171 f'{product_dir}/thirdparty/zlib:'
172 f'{product_dir}/common/dsoftbus/:'
173 f'{product_dir}/commonlibrary/c_utils:'
174 f'{product_dir}/systemabilitymgr/samgr:'
175 f'{product_dir}/hiviewdfx/hisysevent_native:'
176 f'{product_dir}/common/common:'
177 f'{product_dir}/securec/thirdparty_bounds_checking_function:'
178 f'{product_dir}/hiviewdfx/faultloggerd:'
179 f'{product_dir}/thirdparty/bounds_checking_function:'
180 f'{product_dir}/hiviewdfx/hilog_native:'
181 f'{product_dir}/startup/init:'
182 f'{product_dir}/thirdparty/cjson:'
183 f'{product_dir}/lib.unstripped/common/dsoftbus:'
184 f'{product_dir}/security/selinux:'
185 f'{product_dir}/hiviewdfx/hitrace_native/:'
186 f'{product_dir}/communication/ipc/:'
187 f'{product_dir}/distributedschedule/samgr_standard:'
188 f'{product_dir}/security/access_token:'
189 f'{product_dir}/communication/dsoftbus:'
190 f'{product_dir}/startup/startup_l2/:'
191 f'{product_dir}/security/huks/:'
192 f'{product_dir}/clang_x64/thirdparty/icu:'
193 f'{product_dir}/clang_x64/thirdparty/zlib:'
194 f'{product_dir}/clang_x64/arkcompiler/ets_runtime')
195 …libs_dir_arm64_debug = (f'{self.ohdir}/prebuilts/clang/ohos/linux-x86_64/llvm/lib/aarch64-linux-oh…
196 f'{product_dir}/lib.unstripped/arkcompiler/ets_runtime/:'
197 f'{product_dir}/utils/utils_base/:'
198 f'{product_dir}/thirdparty/icu:'
199 f'{product_dir}/thirdparty/zlib:'
200 f'{product_dir}/common/dsoftbus/:'
201 f'{product_dir}/commonlibrary/c_utils:'
202 f'{product_dir}/systemabilitymgr/samgr:'
203 f'{product_dir}/hiviewdfx/hisysevent_native:'
204 f'{product_dir}/common/common:'
205 f'{product_dir}/securec/thirdparty_bounds_checking_function:'
206 f'{product_dir}/hiviewdfx/faultloggerd:'
207 f'{product_dir}/thirdparty/bounds_checking_function:'
208 f'{product_dir}/hiviewdfx/hilog_native:'
209 f'{product_dir}/startup/init:'
210 f'{product_dir}/thirdparty/cjson:'
211 f'{product_dir}/security/selinux:'
212 f'{product_dir}/hiviewdfx/hitrace_native/:'
213 f'{product_dir}/communication/ipc/:'
214 f'{product_dir}/distributedschedule/samgr_standard:'
215 f'{product_dir}/security/access_token:'
216 f'{product_dir}/communication/dsoftbus:'
217 f'{product_dir}/startup/startup_l2/:'
218 f'{product_dir}/security/huks/:'
219 f'{product_dir}/clang_x64/thirdparty/icu/:'
220 f'{product_dir}/clang_x64/thirdparty/zlib/:'
221 f'{product_dir}/clang_x64/arkcompiler/ets_runtime')
225 icu_arg = f'--icu-data-path={self.ohdir}/third_party/icu/ohos_icu4j/data'
227 self.compiler = f'{product_dir}/{bins_dir[0][args.debug]}/ets_runtime/ark_aot_compiler'
228 self.jsvm = f'{product_dir}/{bins_dir[self.arm64][args.debug]}/ets_runtime/ark_js_vm'
229 …self.ts2abc = f'node --expose-gc {product_dir}/clang_x64/arkcompiler/ets_frontend/build/src/index.…
230 self.es2abc = f'{product_dir}/clang_x64/arkcompiler/ets_frontend/es2abc'
235 print(f'not supported frontend: {args.frontend}')
248 self.aot_args = f'{self.aot_args} --builtins-dts={self.builtin}.abc'
252 …self.aot_args = (f'{self.aot_args} --enable-pgo-profiler=true --compiler-pgo-hotness-threshold={ar…
253 f' --compiler-pgo-profiler-path=pgo_file_name.ap')
255 self.frontend_args = f'{self.frontend_args} {args.frontend_args}'
257 self.aot_args = f'{self.aot_args} {args.aot_args}'
259 self.jsvm_args = f'{self.jsvm_args} {args.jsvm_args}'
261 self.aot_args = f'{self.aot_args} --log-level=info'
262 self.jsvm_args = f'{self.jsvm_args} --log-level=info'
269 self.aot_args = f'{self.aot_args} --compiler-target-triple=aarch64-unknown-linux-gnu'
274 print(f'export LD_LIBRARY_PATH={self.libs_dir}')
277 run_and_print(f'hdc shell mount -o remount,rw /')
278 run_and_print(f'hdc file send {args.copy_path}\\ark_aot_compiler /system/bin/')
279 run_and_print(f'hdc shell chmod a+x /system/bin/ark_aot_compiler')
280 run_and_print(f'hdc file send {args.copy_path}\\ark_js_vm /system/bin/')
281 run_and_print(f'hdc shell chmod a+x /system/bin/ark_js_vm')
284 index_dir = f'{product_dir}/clang_x64/arkcompiler/ets_frontend/build/src'
285 os.system(f'cd {index_dir}/.. && npm install')
300 basename = os.path.basename(f'{file}')
304 out_case_dir = f'{dir}'
309 hap_dir = os.path.abspath(f'{out_case_dir}/..')
312 abc_file = f'{os.path.splitext(file)[0]}.abc'
314 pgo_file = f'{hap_dir}/ap/{module_name}'
317 'node': f'node {self.frontend_args} {file}',
318 'qjs': f'qjs {self.frontend_args} {file}',
319 'hermes': f'hermes {self.frontend_args} {file}',
320 … 'abc': f'{self.frontend} {self.frontend_args} {self.abcmode} --output {abc_file} {file}',
321 'pack': [f'mkdir -p {out_case_dir}/../an/arm64-v8a',
322 f'mv {out_case_dir}/{name}.an {hap_dir}/an/arm64-v8a/{module_name}.an',
323 f'mv {out_case_dir}/{name}.ai {hap_dir}/an/arm64-v8a/{module_name}.ai',
324f'cd {out_case_dir}/.. && rm -f ../{hap_name}.hap && zip -r -q ../{hap_name}.hap *',
325 f'mv {hap_dir}/an/arm64-v8a/{module_name}.an {out_case_dir}/{name}.an',
326 f'mv {hap_dir}/an/arm64-v8a/{module_name}.ai {out_case_dir}/{name}.ai',
327 f'rm -rf {hap_dir}/an'],
328 'aot': f'{self.compiler} {self.aot_args} --aot-file={out_case_dir}/{name} {abc_file}',
329 …'aotd': f'{self.runnerd} {self.compiler} {self.aot_args} --aot-file={out_case_dir}/{name} {abc_fil…
330 …'run': f'{self.runner} {self.jsvm} {self.jsvm_args} --aot-file={out_case_dir}/{name} --entry-point…
331 …'rund': f'{self.runnerd} {self.jsvm} {self.jsvm_args} --aot-file={out_case_dir}/{name} --entry-poi…
332 'asmint': f'{self.runner} {self.jsvm} {self.jsvm_args} --entry-point={name} {abc_file}',
333 … 'asmintd': f'{self.runnerd} {self.jsvm} {self.jsvm_args} --entry-point={name} {abc_file}',
334 …'int': f'{self.runner} {self.jsvm} {self.jsvm_args} --asm-interpreter=0 --entry-point={name} {abc_…
335 …'intd': f'{self.runnerd} {self.jsvm} {self.jsvm_args} --asm-interpreter=0 --entry-point={name} {ab…
336 … 'clean': f'rm -f {out_case_dir}/{name}.abc {out_case_dir}/{name}.an {out_case_dir}/{name}.ai',
337 'cleanhap': f'rm -rf {hap_dir}/an {out_case_dir}/{name}.an {out_case_dir}/{name}.ai'}
340 cmd = f'{self.ts2abc} {self.builtin}.ts -m --merge-abc -q -b'
342 cmd = (f'{self.es2abc} --module --merge-abc --extension=ts '
343 f'--output={self.builtin}.abc {self.builtin}.ts')
354 an_size = os.path.getsize(f'{out_case_dir}/{name}.an') / 1024 / 1024
355 print(f'test: {file} abc_size: {abc_size: .1f}MB an_size: {an_size:.1f}MB '
356 f'expand: {an_size / abc_size: .1f} time: {perf_end - perf_start: .1f}s')
362 print(f'packed hap: {hap_name}.hap')
363 print(f'sign --------------------------------------------')
364 self.sign_hap(f'{hap_name}.hap')
367 if os.path.isfile(f'{hap_dir}/{self.hap_abc}'):
384 print(f'not supported tool: {self.args.tool}')
394 print(f'gdb-client start: gdb-multiarch {self.jsvm}')
395 print(f'gdb-server connect: target remote:123456')
413 basename = os.path.basename(f'{file}')
416 send_abc_file = f'{os.path.splitext(file)[0]}.abc'.replace('/', '\\')
417 abc_file = f'{out_case_dir}/{name}.abc'
418 cmd_map = {'abc': f'hdc file send {send_abc_file} {out_case_dir}/',
419 … 'aot': f'hdc shell ark_aot_compiler {self.aot_args} --aot-file={out_case_dir}/{name} {abc_file}',
420 …'run': f'hdc shell ark_js_vm {self.jsvm_args} --aot-file={out_case_dir}/{name} --entry-point={name…
421 … 'asmint': f'hdc shell ark_js_vm {self.jsvm_args} --entry-point={name} {abc_file}',
422 …'int': f'hdc shell ark_js_vm {self.jsvm_args} --asm-interpreter=0 --entry-point={name} {abc_file}'}
440 print_fail(f'FAIL: {file}')
442 expect_file = f'{os.path.dirname(file)}/{self.expect}'
448 print(f'expect: [{expect}]\nbut got: [{out[1]}]')
449 print_fail(f'FAIL: {file}')
451 print_pass(f'PASS: {file}')
453 print_pass(f'PASS: {file}')
458 print(f'Ran tests: {self.test_count}')
459 print(f'Ran failed: {fail_count}')
494 hap_dir = f'{os.path.splitext(file)[0]}.aot'
495 os.system(f'mkdir -p {hap_dir} && unzip -o -q {file} -d {hap_dir}')
496 file = f'{hap_dir}/{self.hap_abc}'
503 sign_dir = f'{name}.sign'
504 sign_tool_dir = f'{self.ohdir}/developtools/hapsigner/dist'
507 os.system(f'mkdir -p {sign_dir} && unzip -o -q {hap_name} module.json -d {sign_dir}')
519 print(f'sign not supported input: {self.args.sign}')
525 with open(f'{sign_tool_dir}/{sign_config}') as f:
526 data_load = json.load(f)
531 with open(f'{sign_dir}/{sign_config}', 'w+') as f:
532 f.write(data_save)
534 …gen_cert = f'java -jar {sign_tool_dir}/hap-sign-tool.jar sign-profile -keyAlias "openharmony appli…
535 …sign_hap = f'java -jar {sign_tool_dir}/hap-sign-tool.jar sign-app -keyAlias "openharmony applicati…
540 print(f'signed of {bundle_apl} for hap: {name}.sign.hap')
546 print(f'not supported step: {self.step}')
553 print(f'only support file type: {self.types[self.step]}')
554 print(f'input path no test case: {self.args.name}')
560 print(f'input path not exists or is file: {self.args.name}')
574 print(f'input path no test case: {self.args.name}')
582 print(f'\033[32;2m{str}\033[0m')
586 print(f'\033[31;2m{str}\033[0m')