• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//ark/js_runtime/js_runtime_config.gni")
15import("//ark/js_runtime/test/test_helper.gni")
16import("//build/test.gni")
17
18config("include_llvm_config") {
19  if (compile_llvm_online) {
20    include_dirs = [
21      "//third_party/llvm-project/build/include",
22      "//third_party/llvm-project/llvm/include/",
23    ]
24  } else {
25    include_dirs = [
26      "//prebuilts/ark_js_prebuilts/llvm_prebuilts/llvm/include",
27      "//prebuilts/ark_js_prebuilts/llvm_prebuilts/build/include",
28    ]
29  }
30}
31
32module_output_path = "ark/js_runtime"
33
34host_unittest_action("StubTest") {
35  module_out_path = module_output_path
36
37  sources = [
38    # test file
39    "stub_tests.cpp",
40  ]
41  configs = [
42    ":include_llvm_config",
43    "//ark/js_runtime:ecma_test_config",
44    "//ark/js_runtime/ecmascript/compiler:ark_jsruntime_compiler_config",
45    "//ark/js_runtime:ark_jsruntime_public_config",
46    "$ark_root/runtime:arkruntime_public_config",
47  ]
48
49  if (compile_llvm_online) {
50    lib_dirs = [ "//third_party/llvm-project/build/lib" ]
51  } else {
52    lib_dirs = [ "//prebuilts/ark_js_prebuilts/llvm_prebuilts/build/lib" ]
53  }
54
55  libs = [
56    "stdc++",
57    "z",
58    "LLVMTarget",
59    "LLVMObject",
60    "LLVMMC",
61    "LLVMSupport",
62    "LLVMCore",
63    "LLVMExecutionEngine",
64    "LLVMInterpreter",
65    "LLVMMCJIT",
66    "LLVMExegesis",
67    "LLVMRuntimeDyld",
68    "LLVMInstCombine",
69    "LLVMAnalysis",
70    "LLVMScalarOpts",
71    "LLVMBinaryFormat",
72    "LLVMDebugInfoDWARF",
73    "LLVMRemarks",
74    "LLVMTextAPI",
75    "LLVMScalarOpts",
76    "LLVMTransformUtils",
77    "LLVMBitReader",
78    "LLVMAsmPrinter",
79    "LLVMProfileData",
80    "LLVMBitstreamReader",
81    "LLVMSelectionDAG",
82    "LLVMGlobalISel",
83    "LLVMLTO",
84    "LLVMCFGuard",
85    "LLVMVectorize",
86    "LLVMDemangle",
87    "LLVMipo",
88    "LLVMInstrumentation",
89    "LLVMDebugInfoCodeView",
90    "LLVMAggressiveInstCombine",
91    "LLVMAsmParser",
92    "LLVMMCParser",
93    "LLVMMIRParser",
94    "LLVMX86Info",
95    "LLVMAArch64Info",
96    "LLVMARMDesc",
97    "LLVMAArch64Desc",
98    "LLVMX86Desc",
99    "LLVMX86Disassembler",
100    "LLVMARMDisassembler",
101    "LLVMAArch64Disassembler",
102    "LLVMMCDisassembler",
103    "LLVMAArch64CodeGen",
104    "LLVMARMCodeGen",
105    "LLVMCodeGen",
106    "LLVMX86CodeGen",
107    "LLVMX86AsmParser",
108    "LLVMTransformUtils",
109    "LLVMAArch64Utils",
110    "LLVMARMUtils",
111    "LLVMIRReader",
112  ]
113
114  deps = [
115    "$ark_root/libpandabase:libarkbase",
116    "//ark/js_runtime/ecmascript/compiler:libark_jsoptimizer_test",
117    sdk_libc_secshared_dep,
118  ]
119}
120
121group("host_unittest") {
122  testonly = true
123
124  # deps file
125  # deps = [ ":StubTestAction" ]
126}
127