19762338dSopenharmony_ci# Copyright (C) 2021 Huawei Device Co., Ltd.
29762338dSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
39762338dSopenharmony_ci# you may not use this file except in compliance with the License.
49762338dSopenharmony_ci# You may obtain a copy of the License at
59762338dSopenharmony_ci#
69762338dSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
79762338dSopenharmony_ci#
89762338dSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
99762338dSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
109762338dSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119762338dSopenharmony_ci# See the License for the specific language governing permissions and
129762338dSopenharmony_ci# limitations under the License.
139762338dSopenharmony_ci
149762338dSopenharmony_ciimport("//test/xts/tools/build/suite.gni")
159762338dSopenharmony_ci
169762338dSopenharmony_ci_all_test_packages = [
179762338dSopenharmony_ci  "${HATS_ROOT}/distributedhardware:distributedhardware",
189762338dSopenharmony_ci  "${HATS_ROOT}/hdf:hatshdftest",
199762338dSopenharmony_ci  "${HATS_ROOT}/kernel:kernel",
209762338dSopenharmony_ci  "${HATS_ROOT}/powermgr:powermgr",
219762338dSopenharmony_ci  "${HATS_ROOT}/useriam:useriam",
229762338dSopenharmony_ci  "${HATS_ROOT}/telephony:telephony",
239762338dSopenharmony_ci  "${HATS_ROOT}/startup:startup",
249762338dSopenharmony_ci  "${HATS_ROOT}/ai:hatsaitest",
259762338dSopenharmony_ci]
269762338dSopenharmony_ci
279762338dSopenharmony_ci_all_test_packages_ivi = [
289762338dSopenharmony_ci  # add hats for ivi here
299762338dSopenharmony_ci  # "${HATS_ROOT}/multimedia:multimedia_ivi",
309762338dSopenharmony_ci]
319762338dSopenharmony_ci
329762338dSopenharmony_ci_all_test_packages_intellitv = [
339762338dSopenharmony_ci  # add hats for intellitv here
349762338dSopenharmony_ci  #"${HATS_ROOT}/multimedia:multimedia_intellitv",
359762338dSopenharmony_ci]
369762338dSopenharmony_ci
379762338dSopenharmony_ci_all_test_packages_wearable = [
389762338dSopenharmony_ci  # add hats for wearable here
399762338dSopenharmony_ci  #"${HATS_ROOT}/multimedia:multimedia_wearable",
409762338dSopenharmony_ci]
419762338dSopenharmony_ci
429762338dSopenharmony_ciselected_packages_wearable = []
439762338dSopenharmony_ciselected_packages_intellitv = []
449762338dSopenharmony_ciselected_packages_ivi = []
459762338dSopenharmony_ciselected_packages = []
469762338dSopenharmony_ciassert(XTS_SUITENAME != "")
479762338dSopenharmony_ciif (build_xts == true && XTS_SUITENAME == "hats") {
489762338dSopenharmony_ci  _select_script = "//test/xts/tools/build/test_package_select.py"
499762338dSopenharmony_ci  _subsystem_config_path = rebase_path(
509762338dSopenharmony_ci          "$root_build_dir/build_configs/subsystem_info/src_subsystem_info.json")
519762338dSopenharmony_ci  _select_args = [ _subsystem_config_path ] + _all_test_packages
529762338dSopenharmony_ci  _select_args_ivi = [ _subsystem_config_path ] + _all_test_packages_ivi
539762338dSopenharmony_ci  _select_args_intellitv =
549762338dSopenharmony_ci      [ _subsystem_config_path ] + _all_test_packages_intellitv
559762338dSopenharmony_ci  _select_args_wearable =
569762338dSopenharmony_ci      [ _subsystem_config_path ] + _all_test_packages_wearable
579762338dSopenharmony_ci  _target_subsystem = getenv("target_subsystem")
589762338dSopenharmony_ci
599762338dSopenharmony_ci  if (_target_subsystem != "" && _target_subsystem != "all") {
609762338dSopenharmony_ci    print("Build hats, target_subsystem=" + _target_subsystem)
619762338dSopenharmony_ci    _select_args += [ "selected_subsystem=" + _target_subsystem ]
629762338dSopenharmony_ci    _select_args_ivi += [ "selected_subsystem=" + _target_subsystem ]
639762338dSopenharmony_ci    _select_args_intellitv += [ "selected_subsystem=" + _target_subsystem ]
649762338dSopenharmony_ci    _select_args_wearable += [ "selected_subsystem=" + _target_subsystem ]
659762338dSopenharmony_ci  }
669762338dSopenharmony_ci
679762338dSopenharmony_ci  selected_packages = exec_script(_select_script, _select_args, "list lines")
689762338dSopenharmony_ci
699762338dSopenharmony_ci  selected_packages_ivi =
709762338dSopenharmony_ci      exec_script(_select_script, _select_args_ivi, "list lines")
719762338dSopenharmony_ci
729762338dSopenharmony_ci  selected_packages_intellitv =
739762338dSopenharmony_ci      exec_script(_select_script, _select_args_intellitv, "list lines")
749762338dSopenharmony_ci
759762338dSopenharmony_ci  selected_packages_wearable =
769762338dSopenharmony_ci      exec_script(_select_script, _select_args_wearable, "list lines")
779762338dSopenharmony_ci
789762338dSopenharmony_ci  print("Selected packages:")
799762338dSopenharmony_ci  print(selected_packages)
809762338dSopenharmony_ci
819762338dSopenharmony_ci  # always include testtools
829762338dSopenharmony_ci  selected_packages += [ "testtools:deploy_testtools" ]
839762338dSopenharmony_ci  selected_packages += [ "${XTS_ROOT}/tools/others/query:libQuery" ]
849762338dSopenharmony_ci  selected_packages_ivi += [ "testtools:deploy_testtools" ]
859762338dSopenharmony_ci  selected_packages_intellitv += [ "testtools:deploy_testtools" ]
869762338dSopenharmony_ci  selected_packages_wearable += [ "testtools:deploy_testtools" ]
879762338dSopenharmony_ci} else {
889762338dSopenharmony_ci  print("HATS build is not enabled")
899762338dSopenharmony_ci}
90