BUILD.gn 4.5 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
# 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("//build/lite/config/component/lite_component.gni")

static_library("test_base") {
A
arvinzzz 已提交
33 34 35 36 37 38 39
  sources = [
    "src/ChipTest.c",
    "src/iCunit.c",
    "src/osTest.c",
    "src/testrun_shellcmd.c",
    "src/testusb_shellcmd.c",
  ]
L
lnlan 已提交
40

A
arvinzzz 已提交
41 42 43 44 45 46 47 48 49 50 51
  include_dirs = [
    "../kernel/base/includ",
    "../kernel/include",
    "../kernel/extended/include",
    "include",
    "../fs/vfs",
    "../fs/proc/include",
    "../fs/jffs2/include",
    "../fs/nfs/include",
    "../bsd/compat/linuxkpi/include",
  ]
L
lnlan 已提交
52

A
arvinzzz 已提交
53 54 55 56 57
  public_configs = [ ":public" ]
}

config("public") {
  include_dirs = [ "include" ]
L
lnlan 已提交
58 59 60
}

lite_component("test") {
A
arvinzzz 已提交
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
  features = [ ":test_base" ]

  # KERNEL BASE TEST
  if (LOSCFG_TEST_KERNEL_BASE_IPC) {
    features += [ "sample/kernel_base/ipc:test_ipc" ]
  }
  if (LOSCFG_TEST_KERNEL_BASE_CORE) {
    features += [ "sample/kernel_base/core:test_core" ]
  }
  if (LOSCFG_TEST_KERNEL_BASE_MP) {
    features += [ "sample/kernel_base/mp:test_mp" ]
  }
  if (LOSCFG_TEST_KERNEL_BASE_MEM) {
    features += [ "sample/kernel_base/mem:test_mem" ]
  }
  if (LOSCFG_TEST_KERNEL_BASE_MISC) {
    features += [ "sample/kernel_base/misc:test_misc" ]
  }
  if (LOSCFG_TEST_KERNEL_BASE_OM) {
    features += [ "sample/kernel_base/om:test_om" ]
  }
  if (LOSCFG_TEST_KERNEL_BASE_ATOMIC) {
    features += [ "sample/kernel_base/atomic:test_atomic" ]
  }
L
lnlan 已提交
85

A
arvinzzz 已提交
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
  # KERNEL EXTEND TEST
  if (LOSCFG_TEST_KERNEL_EXTEND_CPP) {
    features += [ "sample/kernel_extend/cpp:test_cpp" ]
  }
  if (LOSCFG_TEST_KERNEL_EXTEND_CPUP) {
    features += [ "sample/kernel_extend/cpup:test_cpup" ]
  }
  if (LOSCFG_TEST_KERNEL_EXTEND_MMU) {
    features += [ "sample/kernel_extend/mmu:test_mmu" ]
  }

  # COMPAT TEST
  if (LOSCFG_TEST_POSIX) {
    features += [
      "sample/posix:test_posix",
      # "sample/posix/smp:test_posix_smp",
    ]
  }
L
lnlan 已提交
104

A
arvinzzz 已提交
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
  # if (LOSCFG_TEST_POSIX_MEM) {
  #     features += [ "sample/posix/mem:test_posix_mem" ]
  # }
  # if (LOSCFG_TEST_POSIX_MQUEUE) {
  #     features += [ "sample/posix/mqueue:test_posix_mqueue" ]
  # }
  # if (LOSCFG_TEST_POSIX_MUTEX) {
  #     features += [ "sample/posix/mutex:test_posix_mutex" ]
  # }
  # if (LOSCFG_TEST_POSIX_PTHREAD) {
  #     features += [ "sample/posix/pthread:test_posix_pthread" ]
  # }
  # if (LOSCFG_TEST_POSIX_SCHED) {
  #     features += [ "sample/posix/sched:test_posix_sched" ]
  # }
  # if (LOSCFG_TEST_POSIX_SEM) {
  #     features += [ "sample/posix/sem:test_posix_sem" ]
  # }
  # if (LOSCFG_TEST_POSIX_SWTMR) {
  #     features += [ "sample/posix/swtmr:test_posix_swtmr" ]
  # }
  if (LOSCFG_TEST_LINUX) {
    features += [ "sample/linux:test_linux" ]
  }
L
lnlan 已提交
129

A
arvinzzz 已提交
130 131 132
  #if (LOSCFG_TEST_LINUX_HRTIMER) {
  #    features += [ "sample/linux/hrtimer:test_linux_hrtimer" ]
  #}
L
lnlan 已提交
133

A
arvinzzz 已提交
134 135 136 137
  # LIBC TEST
  if (LOSCFG_TEST_LIBC) {
    features += [ "sample/libc:test_libc" ]
  }
L
lnlan 已提交
138

A
arvinzzz 已提交
139 140 141 142
  # LIBM TEST
  if (LOSCFG_TEST_LIBM) {
    features += [ "sample/libm:test_libm" ]
  }
L
lnlan 已提交
143

A
arvinzzz 已提交
144 145 146 147
  # SHELL TEST
  if (LOSCFG_TEST_SHELL) {
    features += [ "sample/shell:test_shell" ]
  }
L
lnlan 已提交
148
}