• 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/calculator"
17
18###############################################################################
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [ "../../../include" ]
23}
24
25##############################unittest##########################################
26ohos_unittest("CalculatorSubTest") {
27  module_out_path = module_output_path
28
29  sources = [
30    "../../../include/calculator.h",
31    "../../../src/calculator.cpp",
32  ]
33
34  sources += [ "calculator_sub_test.cpp" ]
35
36  configs = [ ":module_private_config" ]
37
38  deps = [ "//third_party/googletest:gtest_main" ]
39}
40
41ohos_unittest("CalculatorAddTest") {
42  module_out_path = module_output_path
43
44  sources = [
45    "../../../include/calculator.h",
46    "../../../src/calculator.cpp",
47  ]
48
49  sources += [ "calculator_add_test.cpp" ]
50
51  configs = [ ":module_private_config" ]
52
53  deps = [ "//third_party/googletest:gtest_main" ]
54}
55
56###############################################################################
57group("unittest") {
58  testonly = true
59  deps = []
60
61  deps += [
62    # deps file
63    ":CalculatorAddTest",
64    ":CalculatorSubTest",
65  ]
66}
67###############################################################################
68