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( 15 "//arkcompiler/ets_runtime/compiler_service/test/compiler_service_test.gni") 16import("//arkcompiler/ets_runtime/js_runtime_config.gni") 17 18config("module_private_config") { 19 visibility = [ ":*" ] 20 include_dirs = [ 21 "${compiler_service_root}/include", 22 "${compiler_service_root}/interface", 23 ] 24 cflags = [ 25 "-Wno-error=keyword-macro", 26 "-Wno-nested-anon-types", 27 "-Wno-gnu-anonymous-struct", 28 "-Wno-variadic-macros", 29 ] 30} 31 32ohos_unittest("AotCompilerServiceUnitTest") { 33 module_out_path = module_output_path 34 configs = [ 35 ":module_private_config", 36 "$js_root:ark_jsruntime_public_config", 37 ] 38 version_script = "${compiler_service_root}/libaot_compiler_service.map" 39 sources = [ 40 "${js_root}/common_components/log/log.cpp", 41 "${compiler_service_root}/interface/aot_compiler_interface_proxy.cpp", 42 "${compiler_service_root}/interface/aot_compiler_interface_stub.cpp", 43 "${compiler_service_root}/src/aot_args_handler.cpp", 44 "${compiler_service_root}/src/aot_compiler_client.cpp", 45 "${compiler_service_root}/src/aot_compiler_error_utils.cpp", 46 "${compiler_service_root}/src/aot_compiler_impl.cpp", 47 "${compiler_service_root}/src/aot_compiler_load_callback.cpp", 48 "${compiler_service_root}/src/aot_compiler_service.cpp", 49 "${compiler_service_root}/src/power_disconnected_listener.cpp", 50 "${compiler_service_root}/src/screen_status_listener.cpp", 51 "${compiler_service_root}/src/thermal_mgr_listener.cpp", 52 ] 53 if (is_mingw) { 54 sources += [ 55 "${js_root}/ecmascript/platform/windows/file.cpp", 56 ] 57 } else { 58 sources += [ 59 "${js_root}/ecmascript/platform/unix/file.cpp", 60 ] 61 } 62 deps = [ 63 "${compiler_service_root}:libcompiler_service", 64 ] 65 external_deps = [ 66 "ability_base:want", 67 "access_token:libaccesstoken_sdk", 68 "access_token:libtokenid_sdk", 69 "c_utils:utils", 70 "common_event_service:cesfwk_innerkits", 71 "eventhandler:libeventhandler", 72 "googletest:gtest_main", 73 "hilog:libhilog", 74 "hisysevent:libhisysevent", 75 "hitrace:hitrace_meter", 76 "icu:shared_icui18n", 77 "icu:shared_icuuc", 78 "ipc:ipc_core", 79 "runtime_core:libarkfile_static", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 ] 83 defines = [] 84 if (code_sign_enable_test) { 85 external_deps += [ "code_signature:liblocal_code_sign_sdk" ] 86 defines += [ "CODE_SIGN_ENABLE" ] 87 } 88 sources += [ "aotcompilerservice_unit.cpp" ] 89} 90