BUILD.gn 6.7 KB
Newer Older
L
lnlan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
#    conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
#    of conditions and the following disclaimer in the documentation and/or other materials
#    provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
#    to endorse or promote products derived from this software without specific prior written
#    permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import("config.gni")

local_flags = []
if (board_name == "hispark_taurus") {
  local_flags += [ "-DLOSCFG_USER_TEST_SMP" ]
}
if (LOSCFG_USER_TEST_SMOKE == true) {
  local_flags += [ "-DLOSCFG_USER_TEST_SMOKE" ]
}
if (LOSCFG_USER_TEST_FULL == true) {
  local_flags += [ "-DLOSCFG_USER_TEST_FULL" ]
}
if (LOSCFG_USER_TEST_PRESSURE == true) {
  local_flags += [ "-DLOSCFG_USER_TEST_PRESSURE" ]
}
if (LOSCFG_USER_TEST_LLT == true) {
  local_flags += [ "-DLOSCFG_USER_TEST_LLT" ]
}

config("public_config") {
  cflags = [ "-fpermissive" ]
  cflags += [
    "-O2",
    "-fbuiltin",
    "-Wno-narrowing",
  ]
  cflags += local_flags
  cflags_cc = cflags
}

group("unittest") {
  deps = []
L
lnlan 已提交
62
  if (LOSCFG_USER_TEST_UTIL == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
63 64
    deps += [ "util:liteos_a_util_unittest" ]
  }
L
lnlan 已提交
65
  if (LOSCFG_USER_TEST_TIME_TIMER == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
66 67
    deps += [ "time/timer:liteos_a_time_timer_unittest" ]
  }
L
lnlan 已提交
68 69
  if (LOSCFG_USER_TEST_TIME_CLOCK == true &&
    (LOSCFG_USER_TEST_SMOKE == true || LOSCFG_USER_TEST_FULL == true)) {
L
lnlan 已提交
70 71
    deps += [ "time/clock:liteos_a_time_clock_unittest" ]
  }
L
lnlan 已提交
72
  if (LOSCFG_USER_TEST_SYS == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
73 74
    deps += [ "sys:liteos_a_sys_unittest" ]
  }
L
lnlan 已提交
75
  if (LOSCFG_USER_TEST_SIGNAL == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
76 77
    deps += [ "signal:liteos_a_signal_unittest" ]
  }
L
lnlan 已提交
78
  if (LOSCFG_USER_TEST_SECURITY_REUGID == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
79 80
    deps += [ "security/reugid:liteos_a_security_reugid_unittest" ]
  }
L
lnlan 已提交
81
  if (LOSCFG_USER_TEST_SECURITY_CAPABILITY == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
82 83
    deps += [ "security/capability:liteos_a_security_capability_unittest" ]
  }
L
lnlan 已提交
84
  if (LOSCFG_USER_TEST_SECURITY_VID == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
85 86
    deps += [ "security/vid:liteos_a_security_vid_unittest" ]
  }
L
lnlan 已提交
87
  if (LOSCFG_USER_TEST_MUTEX == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
88 89
    deps += [ "process/mutex:liteos_a_mutex_unittest" ]
  }
L
lnlan 已提交
90
  if (LOSCFG_USER_TEST_PROCESS == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
91 92
    deps += [ "process/process:liteos_a_process_unittest" ]
  }
L
lnlan 已提交
93
  if (LOSCFG_USER_TEST_PTHREAD == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
94 95
    deps += [ "process/pthread:liteos_a_pthread_unittest" ]
  }
L
lnlan 已提交
96
  if (LOSCFG_USER_TEST_RWLOCK == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
97 98
    deps += [ "process/rwlock:liteos_a_rwlock_unittest" ]
  }
L
lnlan 已提交
99
  if (LOSCFG_USER_TEST_SPINLOCK == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
100 101
    deps += [ "process/spinlock:liteos_a_spinlock_unittest" ]
  }
L
lnlan 已提交
102
  if (LOSCFG_USER_TEST_POSIX_MEM == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
103 104
    deps += [ "posix/mem:liteos_a_posix_mem_unittest" ]
  }
L
lnlan 已提交
105 106
  if (LOSCFG_USER_TEST_POSIX_MQUEUE == true &&
    (LOSCFG_USER_TEST_SMOKE == true || LOSCFG_USER_TEST_FULL == true)) {
L
lnlan 已提交
107 108
    deps += [ "posix/mqueue:liteos_a_posix_mqueue_unittest" ]
  }
L
lnlan 已提交
109 110
  if (LOSCFG_USER_TEST_POSIX_PTHREAD == true &&
    (LOSCFG_USER_TEST_SMOKE == true || LOSCFG_USER_TEST_FULL == true)) {
L
lnlan 已提交
111 112
    deps += [ "posix/pthread:liteos_a_posix_pthread_unittest" ]
  }
L
lnlan 已提交
113 114
  if (LOSCFG_USER_TEST_MISC == true &&
    (LOSCFG_USER_TEST_SMOKE == true || LOSCFG_USER_TEST_FULL == true)) {
L
lnlan 已提交
115 116
    deps += [ "misc:liteos_a_misc_unittest" ]
  }
L
lnlan 已提交
117
  if (LOSCFG_USER_TEST_MEM_SHM == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
118 119
    deps += [ "mem/shm:liteos_a_mem_shm_unittest" ]
  }
L
lnlan 已提交
120
  if (LOSCFG_USER_TEST_MEM_VM == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
121 122
    deps += [ "mem/vm:liteos_a_mem_vm_unittest" ]
  }
L
lnlan 已提交
123
  if (LOSCFG_USER_TEST_IO == true && LOSCFG_USER_TEST_FULL == true) {
L
lnlan 已提交
124 125
    deps += [ "IO:liteos_a_io_unittest" ]
  }
L
lnlan 已提交
126
  if (LOSCFG_USER_TEST_EXC == true && LOSCFG_USER_TEST_FULL == true) {
L
lnlan 已提交
127 128
    deps += [ "exc:liteos_a_exc_unittest" ]
  }
L
lnlan 已提交
129
  if (LOSCFG_USER_TEST_DYNLOAD == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
130 131
    deps += [ "dynload:liteos_a_dynload_unittest" ]
  }
L
lnlan 已提交
132
  if (LOSCFG_USER_TEST_DRIVERS_HID == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
133 134
    deps += [ "drivers/hid:liteos_a_drivers_hid_unittest" ]
  }
L
lnlan 已提交
135
  if (LOSCFG_USER_TEST_DRIVERS_STORAGE == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
136 137
    deps += [ "drivers/storage:liteos_a_drivers_storage_unittest" ]
  }
L
lnlan 已提交
138
  if (LOSCFG_USER_TEST_NET_NETDB == true && LOSCFG_USER_TEST_FULL == true) {
L
lnlan 已提交
139 140
    deps += [ "net/netdb:liteos_a_net_netdb_unittest" ]
  }
L
lnlan 已提交
141
  if (LOSCFG_USER_TEST_NET_RESOLV == true && LOSCFG_USER_TEST_FULL == true) {
L
lnlan 已提交
142 143
    deps += [ "net/resolv:liteos_a_net_resolv_unittest" ]
  }
L
lnlan 已提交
144
  if (LOSCFG_USER_TEST_NET_SOCKET == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
145 146
    deps += [ "net/socket:liteos_a_net_socket_unittest" ]
  }
L
lnlan 已提交
147
  if (LOSCFG_USER_TEST_IPC == true && LOSCFG_USER_TEST_FULL == true) {
L
lnlan 已提交
148 149
    deps += [ "IPC:liteos_a_ipc_unittest" ]
  }
L
lnlan 已提交
150
  if (LOSCFG_USER_TEST_LITEIPC == true && LOSCFG_USER_TEST_SMOKE == true) {
L
lnlan 已提交
151 152
    deps += [ "liteipc:liteos_a_liteipc_unittest" ]
  }
L
lnlan 已提交
153 154
  if (LOSCFG_USER_TEST_FS_JFFS == true &&
    (LOSCFG_USER_TEST_SMOKE == true || LOSCFG_USER_TEST_FULL == true || LOSCFG_USER_TEST_PRESSURE == true)) {
L
lnlan 已提交
155 156
    deps += [ "fs:liteos_a_fs_unittest" ]
  }
L
lnlan 已提交
157 158
  if (LOSCFG_USER_TEST_FS_VFAT == true &&
    (LOSCFG_USER_TEST_SMOKE == true || LOSCFG_USER_TEST_FULL == true || LOSCFG_USER_TEST_PRESSURE == true)) {
L
lnlan 已提交
159 160 161
    deps += [ "fs/vfat2:liteos_a_fs_vfat_unittest" ]
  }
}