• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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("//build/lite/config/component/lite_component.gni")
15import("//third_party/jerryscript/engine.gni")
16import("//third_party/jerryscript/tests/test_helper.gni")
17
18host_unittest_action("TddTest") {
19  module_out_path = module_output_path
20  include_dirs = [
21    "//commonlibrary/c_utils/base/include",
22    "${core_path}/include",
23    "${core_path}/api",
24    "${core_path}/debugger",
25    "${core_path}/ecma/builtin-objects/typedarray",
26    "${core_path}/ext",
27    "${core_path}/parser",
28    "${core_path}/parser/js",
29    "${core_path}/parser/regexp",
30    "${core_path}/vm",
31    "${core_path}",
32    "test-common.h",
33    "${ext_path}",
34    "${ext_path}/common",
35    "${ext_path}/debugger",
36    "${ext_path}/handle-scope",
37    "${ext_path}/include/jerryscript-ext",
38    "${ext_path}/include",
39    "${libm_path}",
40    "${debugger_path}",
41    "${port_path}",
42    "${engine_path}/jerry-main",
43    "${port_path}/default/include",
44    "${core_path}/ecma/base",
45    "${core_path}/ecma/operations",
46    "${core_path}/vm",
47    "${core_path}/jcontext",
48    "${core_path}/jmem",
49    "${core_path}/parser/js",
50    "${core_path}/parser/regexp",
51    "${core_path}/jrt",
52    "${core_path}/lit",
53    "${core_path}/ecma/builtin-objects",
54    "//commonlibrary/utils_lite/memory/include",
55    "//commonlibrary/utils_lite/include",
56    "//third_party/googletest/googletest/include/gtest",
57    "//third_party/googletest/include",
58    "//commonlibrary/c_utils/base/include",
59    "//third_party/node/src",
60  ]
61  configs = [ "//third_party/bounds_checking_function:libsec_public_config" ]
62  deps = [
63    "//third_party/bounds_checking_function:libsec_static",
64    "//third_party/googletest:gtest",
65    "//third_party/googletest:gtest_main",
66    "//third_party/jerryscript:jerry",
67    "//third_party/jerryscript:jerry-snapshot",
68    "//third_party/jerryscript:libjerryscript",
69  ]
70
71  cflags = [
72    "-Wno-unused-function",
73    "-Wno-sign-compare",
74    "-Wno-implicit-fallthrough",
75  ]
76  defines = [
77    "JERRY_FOR_IAR_CONFIG",
78    "JERRY_GC_LIMIT=(0)",
79    "JERRY_CPOINTER_32_BIT=0",
80    "JERRY_ERROR_MESSAGES=1",
81    "JERRY_PARSER=1",
82    "JERRY_LINE_INFO=1",
83    "JERRY_LOGGING=0",
84    "JERRY_DEBUGGER=0",
85    "JERRY_MEM_GC_BEFORE_EACH_ALLOC=0",
86    "JERRY_PARSER_DUMP_BYTE_CODE=0",
87    "JERRY_ES2015=0",
88    "JERRY_REGEXP_STRICT_MODE=0",
89    "JERRY_REGEXP_DUMP_BYTE_CODE=0",
90    "JERRY_SNAPSHOT_EXEC=1",
91    "JERRY_SNAPSHOT_SAVE=1",
92    "JERRY_SYSTEM_ALLOCATOR=0",
93    "JERRY_VALGRIND=0",
94    "JERRY_VM_EXEC_STOP=0",
95    "JERRY_STACK_LIMIT=(8)",
96    "JERRY_IAR_JUPITER",
97    "INPUTJS_BUFFER_SIZE=64*1024",
98    "SNAPSHOT_BUFFER_SIZE=48*1024",
99    "JERRY_COMMIT_HASH=\"ignored\"",
100    "JERRY_NDEBUG",
101    "JERRY_HEAPDUMP",
102    "JERRY_REF_TRACKER",
103    "JERRY_ES2015_BUILTIN_TYPEDARRAY=1",
104  ]
105  if (jerryscript_enable_external_context == true) {
106    defines += [ "JERRY_EXTERNAL_CONTEXT=1" ]
107  }
108  sources = [
109    "test-abort.cpp",
110    "test-api-binary-operations-arithmetics.cpp",
111    "test-api-binary-operations-comparisons.cpp",
112    "test-api-binary-operations-instanceof.cpp",
113    "test-api-errortype.cpp",
114    "test-api-promise.cpp",
115    "test-api-property.cpp",
116    "test-api-set-and-clear-error-flag.cpp",
117    "test-api-strings.cpp",
118    "test-api-value-type.cpp",
119    "test-api.cpp",
120    "test-arraybuffer.cpp",
121    "test-container.cpp",
122    "test-context-data.cpp",
123    "test-dataview.cpp",
124    "test-date-helpers.cpp",
125    "test-exec-stop.cpp",
126    "test-has-property.cpp",
127    "test-internal-properties.cpp",
128    "test-jmem.cpp",
129    "test-lit-char-helpers.cpp",
130    "test-native-callback-nested.cpp",
131    "test-native-instanceof.cpp",
132    "test-newtarget.cpp",
133    "test-number-to-int32.cpp",
134    "test-number-to-string.cpp",
135    "test-objects-foreach.cpp",
136    "test-poolman.cpp",
137    "test-promise.cpp",
138    "test-proxy.cpp",
139    "test-regression-3588.cpp",
140    "test-resource-name.cpp",
141    "test-string-to-number.cpp",
142    "test-symbol.cpp",
143    "test-to-integer.cpp",
144    "test-to-length.cpp",
145    "test-typedarray.cpp",
146    "test-unicode.cpp",
147  ]
148}
149
150group("jerry_tdd_test") {
151  testonly = true
152  deps = [ ":TddTest" ]
153}
154group("jerry_tdd_host_test") {
155  testonly = true
156  deps = [ ":TddTestAction" ]
157}
158