Skip to content

Commit

Permalink
chore: Disable esp_tinyusb/test_app in test-rules.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-marcisovsky committed Feb 22, 2024
1 parent ad3f614 commit c4cea45
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .build-test-rules.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
device/esp_tinyusb/test_app:
enable:
- if: IDF_TARGET in ["esp32s2", "esp32s3"]
disable:
- if: IDF_VERSION < 5.0

host/class/cdc/usb_host_cdc_acm/test_app:
enable:
Expand Down
11 changes: 4 additions & 7 deletions device/esp_tinyusb/test_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

# Set the components to include the tests for.
set(TEST_COMPONENTS)
set(EXTRA_COMPONENT_DIRS)

if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
list(APPEND EXTRA_COMPONENT_DIRS ../)
list(APPEND TEST_COMPONENTS "esp_tinyusb")
endif()
set(EXTRA_COMPONENT_DIRS
../
)

set(TEST_COMPONENTS "esp_tinyusb")
project(test_app_usb_device_esp_tinyusb)
39 changes: 4 additions & 35 deletions device/esp_tinyusb/test_app/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
include($ENV{IDF_PATH}/tools/cmake/version.cmake)
##set (TINYUSB_LIB)
##if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
## set(TINYUSB_LIB "esp_tinyusb")
##else()
## set(TINYUSB_LIB "tinyusb")
##endif()
#
## TODO: once IDF_v4.4 is at the EOL support, use WHOLE_ARCHIVE
#idf_component_register(SRCS "test_esp_tinyusb.c" "test_bvalid_sig.c" "test_app_main.c"
# INCLUDE_DIRS "."
# REQUIRES unity usb)
#
## In order for the cases defined by `TEST_CASE` to be linked into the final elf,
## the component can be registered as WHOLE_ARCHIVE
#
## Due to the backward compatibility to IDFv4.4 (in which WHOLE_ARCHIVE is not implemented) we use following approach:
## Any non-static function from test_app/main/*.c (apart from test_app_main.c) file is added as an undefined symbol
## because otherwise the linker will ignore test_app/main/*.c as it has no other files depending on any
## symbols in it.
#
## force-link test_bvalid_sig.c
#set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u tud_mount_cb")
## force-link test_esp_tinyusb.c - void function linker_hook created because:
## no non-static function, no dependency to already force-linked test_bvalid_sig.c
#set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u linker_hook")

if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
idf_component_register(SRCS "test_esp_tinyusb.c" "test_bvalid_sig.c" "test_app_main.c"
INCLUDE_DIRS "."
REQUIRES unity usb)
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u tud_mount_cb")
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u linker_hook")
else()
idf_component_register(SRCS "test_app_main.c"
INCLUDE_DIRS ".")
endif()
idf_component_register(SRCS "test_esp_tinyusb.c" "test_bvalid_sig.c" "test_app_main.c"
INCLUDE_DIRS "."
REQUIRES unity esp_tinyusb
WHOLE_ARCHIVE)

0 comments on commit c4cea45

Please sign in to comment.