• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without modification,
4# are permitted provided that the following conditions are met:
5#
6# 1. Redistributions of source code must retain the above copyright notice, this list of
7#    conditions and the following disclaimer.
8#
9# 2. Redistributions in binary form must reproduce the above copyright notice, this list
10#    of conditions and the following disclaimer in the documentation and/or other materials
11#    provided with the distribution.
12#
13# 3. Neither the name of the copyright holder nor the names of its contributors may be used
14#    to endorse or promote products derived from this software without specific prior written
15#    permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29include $(LITEOSTOPDIR)/config.mk
30include ./test_lite.mk
31
32MODULE_NAME := hdf_test
33HDF_TEST_FRAMWORK_ROOT = $(LITEOSTOPDIR)/../../drivers/hdf_core/framework/test/unittest
34HDF_ADAPTERS_ROOT = $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter
35
36LOCAL_SRCS := $(HDF_TEST_FRAMWORK_ROOT)/common/hdf_main_test.c \
37              $(HDF_TEST_FRAMWORK_ROOT)/manager/sample_driver_test.c \
38              $(HDF_TEST_FRAMWORK_ROOT)/osal/osal_test_entry.c \
39              $(HDF_TEST_FRAMWORK_ROOT)/osal/osal_all_test.c \
40              $(HDF_TEST_FRAMWORK_ROOT)/osal/osal_file_test.c \
41              $(HDF_TEST_FRAMWORK_ROOT)/osal/osal_list_test.c \
42              $(HDF_TEST_FRAMWORK_ROOT)/osal/osal_work_test.c \
43              $(HDF_TEST_FRAMWORK_ROOT)/osal/osal_get_case_test.c \
44              $(HDF_TEST_FRAMWORK_ROOT)/utils/hcs_parser/unittest/hcs_parser_test.c \
45              $(HDF_TEST_FRAMWORK_ROOT)/utils/hcs_parser/unittest/hcs_config_test.c \
46              $(HDF_TEST_FRAMWORK_ROOT)/pm/hdf_pm_driver_test.c
47
48ifeq ($(LOSCFG_DRIVERS_HDF_WIFI), y)
49LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/wifi/hdf_wifi_test.c \
50              $(HDF_TEST_FRAMWORK_ROOT)/model/network/wifi/unittest/netdevice/net_device_test.c \
51              $(HDF_TEST_FRAMWORK_ROOT)/model/network/wifi/unittest/module/hdf_module_test.c \
52              $(HDF_TEST_FRAMWORK_ROOT)/model/network/wifi/unittest/net/hdf_netbuf_test.c \
53              $(HDF_TEST_FRAMWORK_ROOT)/model/network/wifi/unittest/qos/flow_control_test.c \
54              $(HDF_TEST_FRAMWORK_ROOT)/model/network/wifi/unittest/message/hdf_queue_test.c \
55              $(HDF_TEST_FRAMWORK_ROOT)/model/network/wifi/unittest/message/hdf_single_node_message_test.c
56endif
57
58ifeq ($(LOSCFG_DRIVERS_HDF_USB_DDK_DEVICE), y)
59LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/model/usb/device/src/hdf_usb_device_test.c \
60              $(HDF_TEST_FRAMWORK_ROOT)/model/usb/device/src/usb_device_lite_cdcacm_test.c \
61              $(HDF_TEST_FRAMWORK_ROOT)/model/usb/device/src/usb_device_lite_sdk_io_test.c \
62              $(HDF_TEST_FRAMWORK_ROOT)/model/usb/device/src/usb_device_lite_sdk_if_test.c
63endif
64
65ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM), y)
66LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_driver_test.c
67LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_event_test.c
68LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_queue_test.c
69LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_device_test.c
70LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_manager_test.c
71LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_platform_entry_test.c
72ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_TRACE), y)
73LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_trace_test.c
74endif
75ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_DUMPER), y)
76LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/platform_dumper_test.c
77endif
78ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_GPIO), y)
79LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/gpio_test.c
80LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/gpio_driver_test.c
81LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_gpio_entry_test.c
82endif
83ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_PIN), y)
84LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/pin_test.c
85LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/pin_driver_test.c
86LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_pin_entry_test.c
87LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/pin_virtual.c
88endif
89ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_I2C), y)
90LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/i2c_test.c
91LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/i2c_driver_test.c
92LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_i2c_entry_test.c
93LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/mini/i2c_mini_virtual.c
94endif
95ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_I2S), y)
96LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/i2s_test.c
97LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_i2s_entry_test.c
98endif
99ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_ADC), y)
100LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/adc_test.c
101LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/adc_driver_test.c
102LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_adc_entry_test.c
103LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/adc_virtual.c
104endif
105ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_DAC), y)
106LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/dac_test.c
107LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/dac_driver_test.c
108LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_dac_entry_test.c
109LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/dac_virtual.c
110endif
111ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_I3C), y)
112LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/i3c_test.c
113LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/i3c_driver_test.c
114LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_i3c_entry_test.c
115LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/i3c_virtual.c
116endif
117ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG), y)
118LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/watchdog_test.c
119LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/watchdog_driver_test.c
120LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_watchdog_entry_test.c
121LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/watchdog_virtual.c
122LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/mini/watchdog_mini_virtual.c
123endif
124ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_SPI), y)
125LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/spi_driver_test.c
126LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/spi_test.c
127LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_spi_entry_test.c
128LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/spi_virtual.c
129endif
130ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_UART), y)
131LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/uart_driver_test.c
132LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/uart_test.c
133LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_uart_entry_test.c
134LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/mini/uart_mini_virtual.c
135endif
136ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_RTC), y)
137LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/rtc_driver_test.c
138LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/rtc_test.c
139LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_rtc_entry_test.c
140LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/mini/rtc_mini_virtual.c
141endif
142ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_SDIO), y)
143LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/sdio_test.c
144LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_sdio_entry_test.c
145endif
146ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_MIPI_DSI), y)
147LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/mipi_dsi_test.c
148LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_mipi_dsi_entry_test.c
149endif
150ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_MIPI_CSI), y)
151LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/mipi_csi_test.c
152LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_mipi_csi_entry_test.c
153endif
154ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_HDMI), y)
155LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/hdmi_test.c
156LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_hdmi_entry_test.c
157endif
158ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_PCIE), y)
159LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/pcie_driver_test.c
160LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/pcie_test.c
161LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_pcie_entry_test.c
162LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/pcie_virtual.c
163endif
164ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_EMMC), y)
165LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/emmc_test.c
166LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_emmc_entry_test.c
167endif
168
169ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_PWM), y)
170LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/pwm_test.c
171LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/pwm_driver_test.c
172LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_pwm_entry_test.c
173LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/pwm_virtual.c
174endif
175ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_TIMER), y)
176LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/timer_driver_test.c
177LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/timer_test.c
178LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_timer_entry_test.c
179endif
180ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_CAN), y)
181LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/can_test.c
182LOCAL_SRCS += $(HDF_ADAPTERS_ROOT)/platform/can/can_virtual.c
183endif
184
185endif
186ifeq ($(LOSCFG_DRIVERS_HDF_PLATFORM_REGULATOR), y)
187LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/common/regulator_test.c
188LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/entry/hdf_regulator_entry_test.c
189LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/platform/virtual/regulator_virtual.c
190endif
191
192ifeq ($(LOSCFG_DRIVERS_HDF_SENSOR), y)
193LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/sensor/hdf_sensor_test.c
194endif
195
196ifeq ($(LOSCFG_DRIVERS_HDF_USB_DDK_HOST), y)
197ifeq ($(LOSCFG_DRIVERS_HDF_USB_PNP_NOTIFY), y)
198LOCAL_SRCS += $(HDF_TEST_FRAMWORK_ROOT)/model/usb/host/src/usb_test.c \
199              $(HDF_TEST_FRAMWORK_ROOT)/model/usb/host/src/usb_raw_test.c \
200              $(HDF_TEST_FRAMWORK_ROOT)/model/usb/host/src/usb_raw_io.c \
201              $(HDF_TEST_FRAMWORK_ROOT)/model/usb/host/src/hdf_usb_entry_test.c
202endif
203endif
204
205LOCAL_FLAGS += $(LITEOS_GCOV_OPTS)
206LOCAL_CFLAGS += -fstack-protector-strong
207
208include $(HDF_DRIVER_TEST)
209