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/ohos.gni") 15import("//build/ohos_var.gni") 16import("//build/test.gni") 17 18module_output_path = "libpurgeablemem/" 19 20purgeable_external_deps = [ 21 "c_utils:utils", 22 "hilog:libhilog", 23 "memory_utils:libpurgeablemem", 24] 25 26purgeable_public_deps = [ "//third_party/googletest:gtest_main" ] 27 28ohos_unittest("purgeable_c_test") { 29 module_out_path = module_output_path 30 sources = [ "purgeable_c_test.cpp" ] 31 if (is_standard_system) { 32 external_deps = purgeable_external_deps 33 public_deps = purgeable_public_deps 34 } 35 36 subsystem_name = "commonlibrary" 37 part_name = "memory_utils" 38} 39 40ohos_unittest("purgeable_cpp_test") { 41 module_out_path = module_output_path 42 sources = [ "purgeable_cpp_test.cpp" ] 43 if (is_standard_system) { 44 external_deps = purgeable_external_deps 45 public_deps = purgeable_public_deps 46 } 47 48 subsystem_name = "commonlibrary" 49 part_name = "memory_utils" 50} 51 52ohos_unittest("purgeableashmem_test") { 53 module_out_path = module_output_path 54 sources = [ "purgeableashmem_test.cpp" ] 55 if (is_standard_system) { 56 external_deps = purgeable_external_deps 57 public_deps = purgeable_public_deps 58 } 59 60 subsystem_name = "commonlibrary" 61 part_name = "memory_utils" 62} 63 64ohos_unittest("purgeableresourcemanager_test") { 65 module_out_path = module_output_path 66 sources = [ "purgeableresourcemanager_test.cpp" ] 67 if (is_standard_system) { 68 external_deps = purgeable_external_deps 69 public_deps = purgeable_public_deps 70 } 71 72 subsystem_name = "commonlibrary" 73 part_name = "memory_utils" 74} 75 76group("libpurgeablemem_test") { 77 testonly = true 78 deps = [ 79 ":purgeable_c_test", 80 ":purgeable_cpp_test", 81 ":purgeableashmem_test", 82 ":purgeableresourcemanager_test", 83 ] 84} 85