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/test.gni") 15 16config("selinux_unittest_config") { 17 visibility = [ ":*" ] 18 include_dirs = [ 19 "unittest/common", 20 "//commonlibrary/c_utils/base/include", 21 "//third_party/googletest/include", 22 "//base/security/selinux/interfaces/policycoreutils/include", 23 "//third_party/selinux/libselinux/include", 24 ] 25 cflags = [ 26 "-D_GNU_SOURCE", 27 "-w", 28 ] 29} 30 31ohos_unittest("hap_restorecon_unittest") { 32 subsystem_name = "security" 33 part_name = "selinux" 34 module_out_path = part_name + "/" + part_name 35 public_configs = [ ":selinux_unittest_config" ] 36 sources = [ 37 "unittest/common/test_common.cpp", 38 "unittest/hap_restorecon/unit_test.cpp", 39 ] 40 deps = [ "//third_party/selinux:libselinux" ] 41 external_deps = [ "selinux:libhap_restorecon" ] 42} 43 44ohos_unittest("paraperm_checker_unittest") { 45 subsystem_name = "security" 46 part_name = "selinux" 47 module_out_path = part_name + "/" + part_name 48 public_configs = [ ":selinux_unittest_config" ] 49 sources = [ 50 "unittest/common/test_common.cpp", 51 "unittest/paraperm_checker/unit_test.cpp", 52 ] 53 deps = [ "//third_party/selinux:libselinux" ] 54 external_deps = [ "selinux:libparaperm_checker" ] 55} 56 57ohos_unittest("service_checker_unittest") { 58 subsystem_name = "security" 59 part_name = "selinux" 60 module_out_path = part_name + "/" + part_name 61 public_configs = [ ":selinux_unittest_config" ] 62 sources = [ 63 "unittest/common/test_common.cpp", 64 "unittest/service_checker/unit_test.cpp", 65 ] 66 external_deps = [ "selinux:libservice_checker" ] 67} 68 69group("unittest") { 70 testonly = true 71 deps = [] 72} 73