• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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
16module_output_path = "developertest/detector"
17
18###############################################################################
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [ "../../../include" ]
23}
24
25##############################unittest##########################################
26ohos_unittest("DetectorDependTest") {
27  module_out_path = module_output_path
28
29  sources = [ "detector_depend_test.cpp" ]
30
31  configs = [ ":module_private_config" ]
32
33  deps = [
34    "//test/developertest/examples/detector:detector",
35    "//third_party/googletest:gtest_main",
36  ]
37}
38
39ohos_unittest("DetectorFileTest") {
40  module_out_path = module_output_path
41
42  sources = [
43    "../../../include/detector.h",
44    "../../../src/detector.cpp",
45  ]
46
47  sources += [ "detector_file_test.cpp" ]
48
49  configs = [ ":module_private_config" ]
50
51  deps = [ "//third_party/googletest:gtest_main" ]
52}
53
54ohos_unittest("DetectorPrimeTest") {
55  module_out_path = module_output_path
56
57  sources = [
58    "../../../include/detector.h",
59    "../../../src/detector.cpp",
60  ]
61
62  sources += [ "detector_prime_test.cpp" ]
63
64  configs = [ ":module_private_config" ]
65
66  deps = [ "//third_party/googletest:gtest_main" ]
67}
68
69###############################################################################
70group("unittest") {
71  testonly = true
72  deps = []
73
74  deps += [
75    # deps file
76    ":DetectorDependTest",
77    ":DetectorFileTest",
78    ":DetectorPrimeTest",
79  ]
80}
81###############################################################################
82