14514f5e3Sopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
24514f5e3Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
34514f5e3Sopenharmony_ci# you may not use this file except in compliance with the License.
44514f5e3Sopenharmony_ci# You may obtain a copy of the License at
54514f5e3Sopenharmony_ci#
64514f5e3Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
74514f5e3Sopenharmony_ci#
84514f5e3Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
94514f5e3Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
104514f5e3Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114514f5e3Sopenharmony_ci# See the License for the specific language governing permissions and
124514f5e3Sopenharmony_ci# limitations under the License.
134514f5e3Sopenharmony_ci
144514f5e3Sopenharmony_ciimport("//arkcompiler/ets_runtime/js_runtime_config.gni")
154514f5e3Sopenharmony_ciimport("//arkcompiler/ets_runtime/test/test_helper.gni")
164514f5e3Sopenharmony_ci
174514f5e3Sopenharmony_cimodule_output_path = "arkcompiler/ets_runtime"
184514f5e3Sopenharmony_ci
194514f5e3Sopenharmony_cihost_unittest_action("AssemblerTest") {
204514f5e3Sopenharmony_ci  module_out_path = module_output_path
214514f5e3Sopenharmony_ci
224514f5e3Sopenharmony_ci  sources = [
234514f5e3Sopenharmony_ci    # test file
244514f5e3Sopenharmony_ci    "../assembler/tests/assembler_aarch64_test.cpp",
254514f5e3Sopenharmony_ci    "../assembler/tests/assembler_x64_test.cpp",
264514f5e3Sopenharmony_ci  ]
274514f5e3Sopenharmony_ci
284514f5e3Sopenharmony_ci  deps = [
294514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
304514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
314514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
324514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
334514f5e3Sopenharmony_ci  ]
344514f5e3Sopenharmony_ci
354514f5e3Sopenharmony_ci  # hiviewdfx libraries
364514f5e3Sopenharmony_ci  external_deps = hiviewdfx_ext_deps
374514f5e3Sopenharmony_ci  deps += hiviewdfx_deps
384514f5e3Sopenharmony_ci}
394514f5e3Sopenharmony_ci
404514f5e3Sopenharmony_cihost_unittest_action("TypedArrayLoweringTest") {
414514f5e3Sopenharmony_ci  module_out_path = module_output_path
424514f5e3Sopenharmony_ci
434514f5e3Sopenharmony_ci  sources = [
444514f5e3Sopenharmony_ci    # test file
454514f5e3Sopenharmony_ci    "typed_array_lowering_test.cpp",
464514f5e3Sopenharmony_ci  ]
474514f5e3Sopenharmony_ci
484514f5e3Sopenharmony_ci  deps = [
494514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
504514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
514514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
524514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
534514f5e3Sopenharmony_ci  ]
544514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
554514f5e3Sopenharmony_ci}
564514f5e3Sopenharmony_ci
574514f5e3Sopenharmony_cihost_unittest_action("DeadCodeEliminationTest") {
584514f5e3Sopenharmony_ci  module_out_path = module_output_path
594514f5e3Sopenharmony_ci
604514f5e3Sopenharmony_ci  sources = [
614514f5e3Sopenharmony_ci    # test file
624514f5e3Sopenharmony_ci    "dead_code_elimination_test.cpp",
634514f5e3Sopenharmony_ci  ]
644514f5e3Sopenharmony_ci
654514f5e3Sopenharmony_ci  deps = [
664514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
674514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
684514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
694514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
704514f5e3Sopenharmony_ci  ]
714514f5e3Sopenharmony_ci}
724514f5e3Sopenharmony_ci
734514f5e3Sopenharmony_cihost_unittest_action("CombinedPassVisitorTest") {
744514f5e3Sopenharmony_ci  module_out_path = module_output_path
754514f5e3Sopenharmony_ci
764514f5e3Sopenharmony_ci  sources = [
774514f5e3Sopenharmony_ci    # test file
784514f5e3Sopenharmony_ci    "combined_pass_visitor_test.cpp",
794514f5e3Sopenharmony_ci  ]
804514f5e3Sopenharmony_ci
814514f5e3Sopenharmony_ci  deps = [
824514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
834514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
844514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
854514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
864514f5e3Sopenharmony_ci  ]
874514f5e3Sopenharmony_ci}
884514f5e3Sopenharmony_ci
894514f5e3Sopenharmony_cihost_unittest_action("LoopOptimizationTest") {
904514f5e3Sopenharmony_ci  module_out_path = module_output_path
914514f5e3Sopenharmony_ci
924514f5e3Sopenharmony_ci  sources = [
934514f5e3Sopenharmony_ci    # test file
944514f5e3Sopenharmony_ci    "loop_optimization_test.cpp",
954514f5e3Sopenharmony_ci  ]
964514f5e3Sopenharmony_ci
974514f5e3Sopenharmony_ci  deps = [
984514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
994514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
1004514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
1014514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
1024514f5e3Sopenharmony_ci  ]
1034514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
1044514f5e3Sopenharmony_ci}
1054514f5e3Sopenharmony_ci
1064514f5e3Sopenharmony_cihost_unittest_action("ConstantFoldingTest") {
1074514f5e3Sopenharmony_ci  module_out_path = module_output_path
1084514f5e3Sopenharmony_ci
1094514f5e3Sopenharmony_ci  sources = [
1104514f5e3Sopenharmony_ci    # test file
1114514f5e3Sopenharmony_ci    "constant_folding_test.cpp",
1124514f5e3Sopenharmony_ci  ]
1134514f5e3Sopenharmony_ci
1144514f5e3Sopenharmony_ci  deps = [
1154514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
1164514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
1174514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
1184514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
1194514f5e3Sopenharmony_ci  ]
1204514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
1214514f5e3Sopenharmony_ci}
1224514f5e3Sopenharmony_ci
1234514f5e3Sopenharmony_cihost_unittest_action("GlobalValueNumberingTest") {
1244514f5e3Sopenharmony_ci  module_out_path = module_output_path
1254514f5e3Sopenharmony_ci
1264514f5e3Sopenharmony_ci  sources = [
1274514f5e3Sopenharmony_ci    # test file
1284514f5e3Sopenharmony_ci    "global_value_numbering_test.cpp",
1294514f5e3Sopenharmony_ci    "meta_data_equal_test.cpp",
1304514f5e3Sopenharmony_ci  ]
1314514f5e3Sopenharmony_ci
1324514f5e3Sopenharmony_ci  deps = [
1334514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
1344514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
1354514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
1364514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
1374514f5e3Sopenharmony_ci  ]
1384514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
1394514f5e3Sopenharmony_ci}
1404514f5e3Sopenharmony_ci
1414514f5e3Sopenharmony_cihost_unittest_action("InstructionCombineTest") {
1424514f5e3Sopenharmony_ci  module_out_path = module_output_path
1434514f5e3Sopenharmony_ci
1444514f5e3Sopenharmony_ci  sources = [
1454514f5e3Sopenharmony_ci    # test file
1464514f5e3Sopenharmony_ci    "instruction_combine_test.cpp",
1474514f5e3Sopenharmony_ci  ]
1484514f5e3Sopenharmony_ci
1494514f5e3Sopenharmony_ci  deps = [
1504514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
1514514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
1524514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
1534514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
1544514f5e3Sopenharmony_ci  ]
1554514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
1564514f5e3Sopenharmony_ci}
1574514f5e3Sopenharmony_ci
1584514f5e3Sopenharmony_cihost_unittest_action("CreateEmptyFileTest") {
1594514f5e3Sopenharmony_ci  module_out_path = module_output_path
1604514f5e3Sopenharmony_ci
1614514f5e3Sopenharmony_ci  sources = [
1624514f5e3Sopenharmony_ci    # test file
1634514f5e3Sopenharmony_ci    "create_empty_file_test.cpp",
1644514f5e3Sopenharmony_ci  ]
1654514f5e3Sopenharmony_ci
1664514f5e3Sopenharmony_ci  deps = [
1674514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
1684514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
1694514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
1704514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
1714514f5e3Sopenharmony_ci  ]
1724514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
1734514f5e3Sopenharmony_ci}
1744514f5e3Sopenharmony_ci
1754514f5e3Sopenharmony_cihost_unittest_action("AotVersionTest") {
1764514f5e3Sopenharmony_ci  module_out_path = module_output_path
1774514f5e3Sopenharmony_ci
1784514f5e3Sopenharmony_ci  sources = [
1794514f5e3Sopenharmony_ci    # test file
1804514f5e3Sopenharmony_ci    "aot_version_test.cpp",
1814514f5e3Sopenharmony_ci  ]
1824514f5e3Sopenharmony_ci
1834514f5e3Sopenharmony_ci  deps = [
1844514f5e3Sopenharmony_ci    "$ark_root/libpandafile:libarkfile_static",
1854514f5e3Sopenharmony_ci    "$js_root:libark_jsruntime_test_set",
1864514f5e3Sopenharmony_ci    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
1874514f5e3Sopenharmony_ci    sdk_libc_secshared_dep,
1884514f5e3Sopenharmony_ci  ]
1894514f5e3Sopenharmony_ci  external_deps = [ "zlib:libz" ]
1904514f5e3Sopenharmony_ci}
1914514f5e3Sopenharmony_ci
1924514f5e3Sopenharmony_cigroup("host_unittest") {
1934514f5e3Sopenharmony_ci  testonly = true
1944514f5e3Sopenharmony_ci
1954514f5e3Sopenharmony_ci  # deps file
1964514f5e3Sopenharmony_ci  deps = [
1974514f5e3Sopenharmony_ci    ":AotVersionTestAction",
1984514f5e3Sopenharmony_ci    ":AssemblerTestAction",
1994514f5e3Sopenharmony_ci    ":ConstantFoldingTestAction",
2004514f5e3Sopenharmony_ci    ":CreateEmptyFileTestAction",
2014514f5e3Sopenharmony_ci    ":GlobalValueNumberingTestAction",
2024514f5e3Sopenharmony_ci    ":InstructionCombineTestAction",
2034514f5e3Sopenharmony_ci    ":LoopOptimizationTestAction",
2044514f5e3Sopenharmony_ci    ":TypedArrayLoweringTestAction",
2054514f5e3Sopenharmony_ci  ]
2064514f5e3Sopenharmony_ci
2074514f5e3Sopenharmony_ci  if (is_mac) {
2084514f5e3Sopenharmony_ci    deps -= [ ":AssemblerTestAction" ]
2094514f5e3Sopenharmony_ci  }
2104514f5e3Sopenharmony_ci}
211