mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
Merge branch 'feat/usb_host_create_usb_cmock' into 'master'
feat(usb_host): Create USB Host mock for CMock host tests Closes IDF-11234 See merge request espressif/esp-idf!33619
This commit is contained in:
18
tools/mocks/usb/CMakeLists.txt
Normal file
18
tools/mocks/usb/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
# NOTE: This kind of mocking currently works on Linux targets only.
|
||||
# On Espressif chips, too many dependencies are missing at the moment.
|
||||
message(STATUS "building USB HOST MOCKS")
|
||||
|
||||
idf_component_get_property(original_usb_dir usb COMPONENT_OVERRIDEN_DIR)
|
||||
|
||||
idf_component_mock(INCLUDE_DIRS "${original_usb_dir}/include"
|
||||
"${original_usb_dir}/include/esp_private"
|
||||
"${original_usb_dir}/include/usb"
|
||||
"${original_usb_dir}/private_include"
|
||||
MOCK_HEADER_FILES ${original_usb_dir}/include/usb/usb_host.h
|
||||
${original_usb_dir}/include/esp_private/usb_phy.h
|
||||
REQUIRES freertos)
|
||||
|
||||
|
||||
# We do not mock usb_helpers. We use the original implementation.
|
||||
# This way, we can test Class drivers descriptor parsing
|
||||
target_sources(${COMPONENT_LIB} PRIVATE "${original_usb_dir}/usb_helpers.c")
|
7
tools/mocks/usb/mock/mock_config.yaml
Normal file
7
tools/mocks/usb/mock/mock_config.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
:cmock:
|
||||
:plugins:
|
||||
- expect
|
||||
- expect_any_args
|
||||
- return_thru_ptr
|
||||
- ignore
|
||||
- ignore_arg
|
Reference in New Issue
Block a user