# Copyright (C) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") config("selinux_unittest_config") { visibility = [ ":*" ] include_dirs = [ "unittest/common", "//commonlibrary/c_utils/base/include", "//third_party/googletest/include", "//base/security/selinux/interfaces/policycoreutils/include", "//third_party/selinux/libselinux/include", ] cflags = [ "-D_GNU_SOURCE", "-w", ] } ohos_unittest("hap_restorecon_unittest") { subsystem_name = "security" part_name = "selinux" module_out_path = part_name + "/" + part_name public_configs = [ ":selinux_unittest_config" ] sources = [ "unittest/common/test_common.cpp", "unittest/hap_restorecon/unit_test.cpp", ] deps = [ "//third_party/selinux:libselinux" ] external_deps = [ "selinux:libhap_restorecon" ] } ohos_unittest("paraperm_checker_unittest") { subsystem_name = "security" part_name = "selinux" module_out_path = part_name + "/" + part_name public_configs = [ ":selinux_unittest_config" ] sources = [ "unittest/common/test_common.cpp", "unittest/paraperm_checker/unit_test.cpp", ] deps = [ "//third_party/selinux:libselinux" ] external_deps = [ "selinux:libparaperm_checker" ] } ohos_unittest("service_checker_unittest") { subsystem_name = "security" part_name = "selinux" module_out_path = part_name + "/" + part_name public_configs = [ ":selinux_unittest_config" ] sources = [ "unittest/common/test_common.cpp", "unittest/service_checker/unit_test.cpp", ] external_deps = [ "selinux:libservice_checker" ] } group("unittest") { testonly = true deps = [] }