1f6603c60Sopenharmony_ci# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
2f6603c60Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3f6603c60Sopenharmony_ci# you may not use this file except in compliance with the License.
4f6603c60Sopenharmony_ci# You may obtain a copy of the License at
5f6603c60Sopenharmony_ci#
6f6603c60Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7f6603c60Sopenharmony_ci#
8f6603c60Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9f6603c60Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10f6603c60Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11f6603c60Sopenharmony_ci# See the License for the specific language governing permissions and
12f6603c60Sopenharmony_ci# limitations under the License.
13f6603c60Sopenharmony_ci
14f6603c60Sopenharmony_ciimport("//build/lite/config/subsystem/aafwk/config.gni")
15f6603c60Sopenharmony_ciimport("//build/lite/config/test.gni")
16f6603c60Sopenharmony_ciimport(
17f6603c60Sopenharmony_ci    "//foundation/bundlemanager/bundle_framework_lite/bundle_framework_lite.gni")
18f6603c60Sopenharmony_ciimport("//test/xts/tools/lite/build/suite_lite.gni")
19f6603c60Sopenharmony_ci
20f6603c60Sopenharmony_cilite_component("acts_component") {
21f6603c60Sopenharmony_ci  all_features = []
22f6603c60Sopenharmony_ci  features = []
23f6603c60Sopenharmony_ci  if (ohos_xts_test_args != "") {
24f6603c60Sopenharmony_ci    args = [
25f6603c60Sopenharmony_ci      "--method_name",
26f6603c60Sopenharmony_ci      "get_target_modules",
27f6603c60Sopenharmony_ci      "--arguments",
28f6603c60Sopenharmony_ci      "all_features=${ohos_xts_test_args}",
29f6603c60Sopenharmony_ci    ]
30f6603c60Sopenharmony_ci    all_features +=
31f6603c60Sopenharmony_ci        exec_script(rebase_path("//test/xts/tools/lite/build/utils.py"),
32f6603c60Sopenharmony_ci                    args,
33f6603c60Sopenharmony_ci                    "list lines")
34f6603c60Sopenharmony_ci  } else {
35f6603c60Sopenharmony_ci    if (ohos_kernel_type == "liteos_m") {
36f6603c60Sopenharmony_ci      all_features += [
37f6603c60Sopenharmony_ci        "//test/xts/acts/ability_lite/ability_hal:ActsAbilityMgrTest",
38f6603c60Sopenharmony_ci        "//test/xts/acts/communication_lite/lwip_hal:ActsLwipTest",
39f6603c60Sopenharmony_ci
40f6603c60Sopenharmony_ci        #"//test/xts/acts/communication_lite/wifiservice_hal:ActsWifiServiceTest",
41f6603c60Sopenharmony_ci        "//test/xts/acts/commonlibrary_lite/file_hal:ActsUtilsFileTest",
42f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/syspara_hal:ActsParameterTest",
43f6603c60Sopenharmony_ci        "//test/xts/acts/iothardware_lite/peripheral_hal:ActsWifiIotTest",
44f6603c60Sopenharmony_ci        "//test/xts/acts/distributeddatamgr_lite/kv_store_hal:ActsKvStoreTest",
45f6603c60Sopenharmony_ci        "//test/xts/acts/security_lite/huks/liteos_m_adapter:ActsHuksHalFunctionTest",
46f6603c60Sopenharmony_ci        "//test/xts/acts/hiviewdfx_lite/hilog_hal:ActsDfxFuncTest",
47f6603c60Sopenharmony_ci        "//test/xts/acts/hiviewdfx_lite/hievent_hal:ActsHieventLiteTest",
48f6603c60Sopenharmony_ci        "//test/xts/acts/distributed_schedule_lite/system_ability_manager_hal:ActsSamgrTest",
49f6603c60Sopenharmony_ci        "//test/xts/acts/update_lite/dupdate_hal:ActsUpdaterFuncTest",
50f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/bootstrap_hal:ActsBootstrapTest",
51f6603c60Sopenharmony_ci        "//test/xts/acts/xts_lite/device_attest_lite/device_attestStart_hal:ActsDeviceAttestTest",
52f6603c60Sopenharmony_ci      ]
53f6603c60Sopenharmony_ci      if (bundle_framework_lite_enable_ohos_bundle_manager_service == true) {
54f6603c60Sopenharmony_ci        all_features += [
55f6603c60Sopenharmony_ci          "//test/xts/acts/appexecfwk_lite/appexecfwk_hal:ActsBundleMgrTest",
56f6603c60Sopenharmony_ci        ]
57f6603c60Sopenharmony_ci      }
58f6603c60Sopenharmony_ci    } else if (ohos_kernel_type == "uniproton") {
59f6603c60Sopenharmony_ci      all_features += [
60f6603c60Sopenharmony_ci        "//test/xts/acts/commonlibrary_lite/file_hal:ActsUtilsFileTest",
61f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/bootstrap_hal:ActsBootstrapTest",
62f6603c60Sopenharmony_ci      ]
63f6603c60Sopenharmony_ci      features += [ "//test/xts/acts/communication_lite/lwip_hal:ActsLwipTest" ]
64f6603c60Sopenharmony_ci    } else if (ohos_kernel_type == "liteos_a") {
65f6603c60Sopenharmony_ci      all_features += [
66f6603c60Sopenharmony_ci        "//test/xts/acts/kernel_lite:ActsKernelTest",
67f6603c60Sopenharmony_ci        "//test/xts/acts/security_lite:securitytest",
68f6603c60Sopenharmony_ci        "//test/xts/acts/distributeddatamgr_lite/kv_store_posix:ActsKvStoreTest",
69f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/syspara_posix:ActsParameterTest",
70f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest",
71f6603c60Sopenharmony_ci        "//test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest",
72f6603c60Sopenharmony_ci
73f6603c60Sopenharmony_ci        "//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest",
74f6603c60Sopenharmony_ci        "//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest",
75f6603c60Sopenharmony_ci        "//test/xts/acts/multimedia_lite/media_lite_posix/recorder_native:ActsMediaRecorderTest",
76f6603c60Sopenharmony_ci        "//test/xts/acts/multimedia_lite/media_lite_posix/audio_native:ActsMediaAudioTest",
77f6603c60Sopenharmony_ci
78f6603c60Sopenharmony_ci        "//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest",
79f6603c60Sopenharmony_ci
80f6603c60Sopenharmony_ci        #"//test/xts/acts/systemabilitymgr_lite/distributed_schedule_posix:ActsDMSTest",
81f6603c60Sopenharmony_ci        "//test/xts/acts/hiviewdfx_lite/hilog_posix:ActsHilogTest",
82f6603c60Sopenharmony_ci
83f6603c60Sopenharmony_ci        "//test/xts/acts/appexecfwk_lite/appexecfwk_posix:ActsBundleMgrTest",
84f6603c60Sopenharmony_ci        "//test/xts/acts/ability_lite/ability_posix:ActsAbilityMgrTest",
85f6603c60Sopenharmony_ci        "//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest",
86f6603c60Sopenharmony_ci
87f6603c60Sopenharmony_ci        "//test/xts/acts/ai_lite/ai_engine_posix/base:ActsAiEngineTest",
88f6603c60Sopenharmony_ci        "//test/xts/acts/global_lite:ActsGlobalTest",
89f6603c60Sopenharmony_ci        "//test/xts/acts/sensors_lite:sensorstest",
90f6603c60Sopenharmony_ci        "//test/xts/acts/update_lite/dupdate_posix:ActsUpdateTest",
91f6603c60Sopenharmony_ci        "//test/xts/acts/xts_lite/device_attest_lite/device_attestStart_posix:ActsDeviceAttestStartTest",
92f6603c60Sopenharmony_ci        "//test/xts/acts/xts_lite/device_attest_lite/device_attestQuerry_posix:ActsDeviceAttestQuerryTest",
93f6603c60Sopenharmony_ci      ]
94f6603c60Sopenharmony_ci    } else if (ohos_kernel_type == "linux") {
95f6603c60Sopenharmony_ci      all_features += [
96f6603c60Sopenharmony_ci        "//test/xts/acts/distributeddatamgr_lite/kv_store_posix:ActsKvStoreTest",
97f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/syspara_posix:ActsParameterTest",
98f6603c60Sopenharmony_ci        "//test/xts/acts/startup_lite/bootstrap_posix:ActsBootstrapTest",
99f6603c60Sopenharmony_ci        "//test/xts/acts/communication_lite/lwip_posix:ActsLwipTest",
100f6603c60Sopenharmony_ci        "//test/xts/acts/security_lite:securitytest",
101f6603c60Sopenharmony_ci
102f6603c60Sopenharmony_ci        #"//test/xts/acts/multimedia_lite/camera_lite_posix/camera_native:ActsMediaCameraTest",
103f6603c60Sopenharmony_ci        #"//test/xts/acts/multimedia_lite/media_lite_posix/player_native:ActsMediaPlayerTest",
104f6603c60Sopenharmony_ci        #"//test/xts/acts/multimedia_lite/media_lite_posix/recorder_native:ActsMediaRecorderTest",
105f6603c60Sopenharmony_ci        "//test/xts/acts/distributed_schedule_lite/system_ability_manager_posix:ActsSamgrTest",
106f6603c60Sopenharmony_ci        "//test/xts/acts/appexecfwk_lite/appexecfwk_posix:ActsBundleMgrTest",
107f6603c60Sopenharmony_ci        "//test/xts/acts/ability_lite/ability_posix:ActsAbilityMgrTest",
108f6603c60Sopenharmony_ci        "//test/xts/acts/ai_lite/ai_engine_posix/base:ActsAiEngineTest",
109f6603c60Sopenharmony_ci        "//test/xts/acts/xts_lite/device_attest_lite/device_attestStart_posix:ActsDeviceAttestStartTest",
110f6603c60Sopenharmony_ci        "//test/xts/acts/xts_lite/device_attest_lite/device_attestQuerry_posix:ActsDeviceAttestQuerryTest",
111f6603c60Sopenharmony_ci      ]
112f6603c60Sopenharmony_ci    }
113f6603c60Sopenharmony_ci  }
114f6603c60Sopenharmony_ci
115f6603c60Sopenharmony_ci  if (ohos_build_type == "debug" && ohos_test_args != "notest") {
116f6603c60Sopenharmony_ci    _all_features = ""
117f6603c60Sopenharmony_ci    _product_json = rebase_path("${product_config_path}/config.json")
118f6603c60Sopenharmony_ci    foreach(one_feature, all_features) {
119f6603c60Sopenharmony_ci      _all_features = _all_features + one_feature + ","
120f6603c60Sopenharmony_ci    }
121f6603c60Sopenharmony_ci    _args = [
122f6603c60Sopenharmony_ci      "--method_name",
123f6603c60Sopenharmony_ci      "filter_by_subsystem",
124f6603c60Sopenharmony_ci      "--arguments",
125f6603c60Sopenharmony_ci      "testsuites=${_all_features}#product_json=${_product_json}",
126f6603c60Sopenharmony_ci    ]
127f6603c60Sopenharmony_ci    features += exec_script(rebase_path("//test/xts/tools/lite/build/utils.py"),
128f6603c60Sopenharmony_ci                            _args,
129f6603c60Sopenharmony_ci                            "list lines")
130f6603c60Sopenharmony_ci  }
131f6603c60Sopenharmony_ci}
132f6603c60Sopenharmony_ci
133f6603c60Sopenharmony_citest_suite("acts") {
134f6603c60Sopenharmony_ci  deps = [ ":acts_component" ]
135f6603c60Sopenharmony_ci  version = "OpenHarmony-ACTS-1.0.1"
136f6603c60Sopenharmony_ci  deps += [ "//test/xts/tools/lite/others/query:libQuery" ]
137f6603c60Sopenharmony_ci}
138f6603c60Sopenharmony_ci
139f6603c60Sopenharmony_cigenerate_notice_file("acts_notice_file") {
140f6603c60Sopenharmony_ci  module_name = "acts"
141f6603c60Sopenharmony_ci  module_source_dir_list = [
142f6603c60Sopenharmony_ci    "//third_party/googletest",
143f6603c60Sopenharmony_ci    "//third_party/unity",
144f6603c60Sopenharmony_ci    "//third_party/bounds_checking_function",
145f6603c60Sopenharmony_ci  ]
146f6603c60Sopenharmony_ci}
147