1 # Copyright (C) 2023 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 
14 import("//build/ohos.gni")
15 import("//build/test.gni")
16 
17 module_output_path = "drm_framework/drm_framework_unittest"
18 
19 config("drm_framework_capi_unittest_v1_0_config") {
20   include_dirs = [
21     "../../../../interfaces/kits/c/drm_capi/include",
22     "../../../../interfaces/kits/c/drm_capi/common",
23     "../../../../frameworks/native/test/unittest/include",
24     "../../../../frameworks/native/test/common/include",
25     "../../../../interfaces/inner_api/native/drm",
26     "../../../../services/utils/include",
27   ]
28 
29   cflags = [
30     "-fno-exceptions",
31     "-Wall",
32     "-fno-common",
33     "-fstack-protector-all",
34     "-Wshadow",
35     "-FPIC",
36     "-FS",
37     "-O2",
38     "-D_FORTIFY_SOURCE=2",
39     "-Wformat=2",
40     "-Wdate-time",
41   ]
42   cflags_cc = [ "-fno-rtti" ]
43 }
44 
45 ohos_unittest("drm_framework_capi_unittest_v1_0") {
46   module_out_path = module_output_path
47   configs = [ ":drm_framework_capi_unittest_v1_0_config" ]
48 
49   sanitize = {
50     debug = true
51   }
52   cflags = []
53   sources = [
54     "../../../../frameworks/native/test/common/src/http.cpp",
55     "../../../../frameworks/native/test/unittest/src/drm_framework_dfx_unittest.cpp",
56     "../../../../frameworks/native/test/unittest/src/drm_framework_unittest.cpp",
57     "../../../../services/utils/drm_dfx.cpp",
58   ]
59 
60   deps = [
61     "../../../../frameworks/native:drm_framework",
62     "../../../../interfaces/kits/c/drm_capi:native_drm",
63     "../../../../interfaces/kits/js/drm_napi:drm_napi",
64     "../../../../services/drm_service:drm_service",
65     "//third_party/curl:curl_shared",
66     "//third_party/googletest:gmock_main",
67   ]
68 
69   external_deps = [
70     "c_utils:utils",
71     "hidumper:lib_dump_usage",
72     "hilog:libhilog",
73     "hisysevent:libhisysevent",
74     "hitrace:libhitracechain",
75     "ipc:ipc_core",
76   ]
77   subsystem_name = "multimedia"
78   part_name = "drm_framework"
79 }
80