自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

移植案例與原理 - XTS子系統(tǒng)之應(yīng)用兼容性測試套件之一

原創(chuàng)
系統(tǒng) OpenHarmony
本文主要通過實(shí)例分析下ACTS應(yīng)用兼容性測試套件移植案例,以及移植過程中特定的操作的原理。

??想了解更多內(nèi)容,請?jiān)L問:??

??51CTO和華為官方合作共建的鴻蒙技術(shù)社區(qū)??

??https://harmonyos.51cto.com??

XTS(X Test Suite)子系統(tǒng)是OpenHarmony生態(tài)認(rèn)證測試套件的集合,當(dāng)前包括:

  • acts(application compatibility test suite)應(yīng)用兼容性測試套件,看護(hù)北向HAP兼容、OpenHarmony開發(fā)API兼容。
  • hats(Hardware Abstraction Test Suite )硬件抽象測試套,看護(hù)HDI層接口。
  • dcts(Distributed Compatibility Test Suite )分布式兼容性測試套,看護(hù)分布式兼容(待上線)

本文主要通過實(shí)例分析下ACTS應(yīng)用兼容性測試套件移植案例,以及移植過程中特定的操作的原理。主要講述的是輕量系統(tǒng)兼容性測試。輕量系統(tǒng)因系統(tǒng)能力限制,兼容性測試在系統(tǒng)初始化階段進(jìn)行;并且各設(shè)備燒錄工具存在差異,導(dǎo)致自動化工具(xDevice工具)無法實(shí)現(xiàn)真正的自動適配,因此認(rèn)證執(zhí)行方式不對合作伙伴進(jìn)行限制。流程如下:

步驟1 編譯適配:XTS子系統(tǒng)加入到編譯組件中,隨版本一起編譯;

步驟2 本地執(zhí)行:完成兼容性測試;

1、編譯適配XTS子系統(tǒng)

1.1 產(chǎn)品解決方案適配

需要在產(chǎn)品解決方案配置文件中增加增加xts_acts與xts_tools組件定義。下面看幾個示例,文件vendor\bestechnic\xts_demo\config.json中的配置片段:

   {
"subsystem": "xts",
"components": [
{ "component": "xts_acts", "features":
[
"config_ohos_xts_acts_utils_lite_kv_store_data_path = \"/data\"",
"enable_ohos_test_xts_acts_use_thirdparty_lwip = true"
]
},
{ "component": "xts_tools", "features":[] }
]
}

文件vendor\goodix\gr5515_sk_xts_demo\config.json中的配置片段:

    {
"subsystem": "xts",
"components": [
{ "component": "xts_acts", "features":
[
"config_ohos_xts_acts_utils_lite_kv_store_data_path = \"/data\""
]
},
{ "component": "xts_tools", "features":[] }
]
},

1.2 編譯鏈接

需要通過鏈接選項(xiàng)指定需要鏈接的ACTS的部件編譯庫文件,會使用到 --whole-archive 和 --no-whole-archive這2個ld鏈接選項(xiàng)。–whole-archive 可以把 在其后面出現(xiàn)的靜態(tài)庫包含的函數(shù)和變量輸出到動態(tài)庫,–no-whole-archive 則關(guān)掉這個特性。在文件vendor\goodix\gr5515_sk_xts_demo\BUILD.gn中,對ACTS的編譯文件進(jìn)行鏈接。其中⑴到⑵處的鏈接選項(xiàng)為編譯出的屬于ACTS的組件測試庫文件。

   executable("${fw_img_name}.elf") {
deps = [
"tests:drivers",
"tests:fs_test",
"tests:ohosdemo",
"tests:shell_test",
"http://build/lite:ohos",
]

ldflags = [
"-Wl,--whole-archive",
# "-lfs_test",
# "-ldrivers_test",
# "-lapp_hello",
"-lshell_test",
"-lhctest",
"-lmodule_ActsBootstrapTest",
"-lmodule_ActsWifiIotTest",
"-lmodule_ActsUtilsFileTest",
"-lmodule_ActsKvStoreTest",
"-lmodule_ActsParameterTest",
"-lmodule_ActsSamgrTest",
"-lhuks_test_common",
"-lmodule_ActsHuksHalFunctionTest",
"-lmodule_ActsDfxFuncTest",
"-lmodule_ActsUpdaterFuncTest",
"-lmodule_ActsHieventLiteTest",
"-Wl,--no-whole-archive",
]
}

在文件vendor\bestechnic\xts_demo\config.json中,需要鏈接的ACTS部件測試庫文件寫在了bin_list里的force_link_libs里。

  "bin_list": [
{
"elf_name": "wifiiot",
"bsp_target_name": "best2600w_liteos",
"signature": "false",
"burn_name": "rtos_main",
"enable": "true",
"force_link_libs": [
"bootstrap",
"abilityms",
"bundlems",
"broadcast",
"hctest",
"module_ActsParameterTest",
"module_ActsBootstrapTest",
"module_ActsDfxFuncTest",
"module_ActsHieventLiteTest",
"module_ActsSamgrTest",
"module_ActsKvStoreTest"
]
},
.......
],

然后在文件device\soc\bestechnic\bes2600\BUILD.gn里組裝編譯鏈接選項(xiàng),相關(guān)代碼片段如下:

  # config bin from vendor/bestechnic/<product_name>/config.json
foreach(bin_file, bin_list) {
......

if (build_enable == "true") {
......

# force link invisible function ,which ar to lib
ldflags += [ "-Wl,--whole-archive" ]
foreach(force_link_lib, bin_file.force_link_libs) {
ldflags += [ "-l${force_link_lib}" ]
}
ldflags += [ "-lbsp${bsp_target_name}" ]
ldflags += [ "-Wl,--no-whole-archive" ]
......
}
}

在文件vendor_asrmicro\xts_demo\config.json中,存在這樣的配置片段。

    "xts_list": [
{
"enable": "true",
"xts_modules": [
"ActsKvStoreTest",
"ActsDfxFuncTest",
"ActsHieventLiteTest",
"ActsSamgrTest",
"ActsParameterTest",
"ActsWifiServiceTest",
"ActsWifiIotTest",
"ActsBootstrapTest"
]
}
]

然后,在文件device_soc_asrmicro\asr582x\liteos_m\sdk\BUILD.gn文件中組裝編譯鏈接選項(xiàng)。

 foreach(xts_item, xts_list) {
xts_enable = xts_item.enable
if(xts_enable == "true")
{
defines = [ "CFG_HARMONY_SUPPORT" ]
ldflags += [
"-Llibs",
"-Wl,--whole-archive",
"-lhctest",
"-lbootstrap",
"-lbroadcast",
]
foreach(xts_module, xts_item.xts_modules) {
ldflags += [ "-lmodule_${xts_module}" ]
}
ldflags += [ "-Wl,--no-whole-archive" ]
}
}

在產(chǎn)品解決方案配置文件中增加的bin_list、xts_list這些配置選項(xiàng)都不是config.json中的默認(rèn)的標(biāo)準(zhǔn)選項(xiàng)。各個方案實(shí)現(xiàn)的風(fēng)格差異比較大,建議使用第一種,寫在文件vendor\goodix\gr5515_sk_xts_demo\BUILD.gn中會比較好。另外,需要使用hb命令觸發(fā)debug版本(非debug版本不會觸發(fā)測試編譯)。

??想了解更多內(nèi)容,請?jiān)L問:??

??51CTO和華為官方合作共建的鴻蒙技術(shù)社區(qū)??

??https://harmonyos.51cto.com??

責(zé)任編輯:jianghua 來源: 鴻蒙社區(qū)
相關(guān)推薦

2022-02-16 15:48:26

ACTS應(yīng)用XTS子系統(tǒng)鴻蒙

2021-12-27 16:22:19

鴻蒙HarmonyOS應(yīng)用

2022-01-26 15:16:24

utilsOpenHarmon鴻蒙

2022-01-25 17:12:36

startup子系統(tǒng)syspara系統(tǒng)鴻蒙

2023-04-17 19:43:54

兼容性測試軟件測試

2023-02-06 16:11:22

代碼研發(fā)鴻蒙

2021-10-06 19:06:25

微軟Windows 11Windows

2009-08-17 10:22:19

C# Windows

2009-10-15 10:56:19

開放式布線系統(tǒng)

2012-01-04 10:45:01

2012-05-16 11:30:39

2009-09-01 18:55:09

Windows 7兼容

2023-07-10 09:38:06

兼容性測試方案

2012-04-24 10:08:12

HTML5

2009-03-07 09:49:07

Windows 7兼容性

2021-12-27 16:20:45

鴻蒙HarmonyOS應(yīng)用

2015-10-30 18:00:45

應(yīng)用程序兼容性FireEye

2022-08-22 09:01:59

類型兼容性TypeScript

2009-09-15 08:33:01

2009-04-25 09:15:11

微軟Windows 7操作系統(tǒng)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號