• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//arkcompiler/runtime_core/ark_config.gni")
15import("$ark_root/panda_guard/tests/panda_guard_test_config.gni")
16import("$ark_root/tests/test_helper.gni")
17
18panda_guard_test_configs = [ "$ark_root/panda_guard:panda_guard_public_config" ]
19
20panda_guard_test_deps = [ "$ark_root/panda_guard:panda_guard_static" ]
21
22panda_guard_include_dirs = [ "$ark_root/panda_guard/tests" ]
23
24ohos_copy("copy_config_files") {
25  sources = [ "$ark_root/panda_guard/tests/unittest/configs" ]
26  outputs = [ "${target_out_dir}/configs" ]
27
28  part_name = "runtime_core"
29  subsystem_name = "arkcompiler"
30}
31
32host_unittest_action("PandaGuardUnitTest") {
33  module_out_path = "$ark_root"
34  sources = [
35    "unittest/guard_args_parser_test.cpp",
36    "unittest/guard_context_test.cpp",
37    "unittest/guard_name_cache_test.cpp",
38    "unittest/guard_options_test.cpp",
39    "unittest/name_generator_test.cpp",
40    "unittest/string_util_test.cpp",
41    "util/test_util.cpp",
42  ]
43  include_dirs = panda_guard_include_dirs
44  configs = panda_guard_test_configs
45  configs += [
46    "$ark_root:ark_config",
47    "$ark_root/assembler:arkassembler_public_config",
48    "$ark_root/libpandabase:arkbase_public_config",
49    "$ark_root/libpandafile:arkfile_public_config",
50    "$ark_root/compiler:arkcompiler_public_config",
51  ]
52  deps = panda_guard_test_deps
53  unit_test_dir = rebase_path(target_out_dir)
54  defines = [ "PANDA_GUARD_UNIT_TEST_DIR=\"${unit_test_dir}/\"" ]
55
56  deps += [ ":copy_config_files" ]
57
58  external_deps = [ sdk_libc_secshared_dep ]
59}
60
61group("host_unittest") {
62  testonly = true
63  deps = [ ":PandaGuardUnitTestAction" ]
64}
65