# 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. if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/test.gni") test_output_root = "$root_out_dir/test/unittest/syscap_codec" executable("test_syscap_napi_unittest") { output_extension = "bin" output_dir = test_output_root include_dirs = [ "//commonlibrary/c_utils/base/include", "//third_party/node/src", "//third_party/googletest/include", "//developtools/syscap_codec/src/", "//developtools/syscap_codec/include/", "//developtools/syscap_codec/interfaces/inner_api/", "//developtools/syscap_codec/test/unittest/common/include/", ] cflags = [ "-g3" ] sources = [ "//developtools/syscap_codec/interfaces/inner_api/syscap_interface.c", "//developtools/syscap_codec/src/create_pcid.c", "//developtools/syscap_codec/src/endian_internal.c", "//developtools/syscap_codec/src/syscap_tool.c", "syscap_codec_test.cpp", ] defines = [ "NAPI_TEST" ] deps = [ "//base//hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//test/testfwk/developer_test/third_party/lib/cpp:gtest_main", "//third_party/bounds_checking_function:libsec_static", ] deps += [ "//build/lite/config/component/cJSON:cjson_static" ] } group("unittest") { deps = [ ":test_syscap_napi_unittest" ] } } else { import("//build/lite/config/component/lite_component.gni") import("//build/ohos.gni") import("//build/test.gni") module_output_path = "developtools/syscap_codec" ohos_unittest("syscap_codec_test") { module_out_path = module_output_path include_dirs = [ "//developtools/syscap_codec/src/", "//developtools/syscap_codec/include/", "//developtools/syscap_codec/interfaces/inner_api/", "//developtools/syscap_codec/test/unittest/common/include/", ] sources = [ "//developtools/syscap_codec/interfaces/inner_api/syscap_interface.c", "//developtools/syscap_codec/src/create_pcid.c", "//developtools/syscap_codec/src/endian_internal.c", "//developtools/syscap_codec/src/syscap_tool.c", "syscap_codec_test.cpp", ] deps = [ "//third_party/bounds_checking_function:libsec_static", "//third_party/googletest:gtest_main", ] deps += [ "//third_party/cJSON:cjson_static" ] } group("unittest") { testonly = true deps = [ ":syscap_codec_test" ] } }