1# Porting Verification 2 3 4After the OpenHarmony chip is ported, conduct the OpenHarmony compatibility test and chip SDK function test to obtain certification. Detecting defects in the development process can improve code quality. 5 6 7## Conducting the OpenHarmony Compatibility Test 8 9The OpenHarmony compatibility test is included in the X Test Suite (XTS), a set of OpenHarmony certification test suites. For details, see [DFX](https://gitee.com/openharmony/docs/blob/master/en/readme/dfx.md). 10 111. Add the test subsystem and the xts_acts component. 12 Add the following code to the **vendor/xxx/xxx/config.json** file: 13 14 15 ``` 16 { 17 "subsystem": "test", 18 "components": [ 19 { "component": "xts_acts", "features":[] }, 20 { "component": "xts_tools", "features":[] } 21 ] 22 } 23 ``` 24 252. Link the .a library generated by the XTS. 26 In the linking options, link the **libmodule_ActsXxxTest.a** library in the **out/MyBoard/MyProduct/libs** directory in the mode of **-lmodule_ActsXxxTest**. The sample code is as follows: 27 28 29 ``` 30 "-Wl,--whole-archive", 31 ...... 32 "-lhctest", 33 "-lbootstrap", 34 "-lbroadcast", 35 "-lmodule_ActsBootstrapTest", 36 "-lmodule_ActsCMSISTest", 37 "-lmodule_ActsDfxFuncTest", 38 "-lmodule_ActsParameterTest", 39 "-lmodule_ActsSamgrTest", 40 "-lmodule_ActsSecurityDataTest", 41 ...... 42 "-Wl,--no-whole-archive", 43 ``` 44 453. Modify the code based on the test report. 46 Burn the files generated after compilation to the development board and use the serial port tool to view the XTS test report. If any test item fails, modify the code as needed. 47 48 During fault locating, you can comment out unnecessary test items in the **test/xts/acts/build_lite/BUILD.gn** file. 49 50 51 ``` 52 if (ohos_kernel_type == "liteos_m") { 53 all_features += [ 54 "//test/xts/acts/communication_lite/lwip_hal:ActsLwipTest", 55 "//test/xts/acts/communication_lite/softbus_hal:ActsSoftBusTest", 56 "//test/xts/acts/communication_lite/wifiservice_hal:ActsWifiServiceTest", 57 "//test/xts/acts/utils_lite/file_hal:ActsUtilsFileTest", 58 "//test/xts/acts/startup_lite/syspara_hal:ActsParameterTest", 59 "//test/xts/acts/iot_hardware_lite/iot_controller_hal:ActsWifiIotTest", 60 "//test/xts/acts/kernel_lite/kernelcmsis_hal:ActsCMSISTest", 61 "//test/xts/acts/utils_lite/kv_store_hal:ActsKvStoreTest", 62 "//test/xts/acts/security_lite/datahuks_hal:ActsSecurityDataTest", 63 "//test/xts/acts/hiviewdfx_lite/hilog_hal:ActsDfxFuncTest", 64 "//test/xts/acts/distributed_schedule_lite/samgr_hal:ActsSamgrTest", 65 "//test/xts/acts/update_lite/updater_hal:ActsUpdaterFuncTest", 66 "//test/xts/acts/startup_lite/bootstrap_hal:ActsBootstrapTest", 67 ] 68 } 69 ``` 70 71> ![icon-caution.gif](public_sys-resources/icon-caution.gif) **CAUTION** 72> 1. XTS automatically runs the test after **OHOS_SystemInit()** is called. 73> 74> 2. You must add code between "-Wl,--whole-archive" and "-Wl,--no-whole-archive". Otherwise, the link fails. 75> 76> During the XTS test, the following static libraries must be linked: 77> 78> 79> ``` 80> "-lhctest", 81> "-lbootstrap", 82> "-lbroadcast", 83> ``` 84 85 86## Conducting the Chip SDK Function Test 87 88Verify the chip SDK functions, such as Wi-Fi, Bluetooth, and OTA. 89