diff --git a/.build-test-rules.yml b/.build-test-rules.yml index b44c0599..1bfa7b39 100644 --- a/.build-test-rules.yml +++ b/.build-test-rules.yml @@ -5,3 +5,7 @@ device/esp_tinyusb: host/class: enable: - if: SOC_USB_OTG_SUPPORTED == 1 + +host/class/cdc/usb_host_cdc_acm/host_test: + enable: + - if: IDF_TARGET in ["linux"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 4) diff --git a/.github/workflows/build_and_run_host_test.yml b/.github/workflows/build_and_run_host_test.yml new file mode 100644 index 00000000..89282c8f --- /dev/null +++ b/.github/workflows/build_and_run_host_test.yml @@ -0,0 +1,29 @@ +name: Build and Run USB Host test + +on: + schedule: + - cron: '0 0 * * SAT' # Saturday midnight + pull_request: + types: [opened, reopened, synchronize] + +jobs: + build: + name: Build + strategy: + fail-fast: false + matrix: + idf_ver: ["latest"] + runs-on: ubuntu-20.04 + container: espressif/idf:${{ matrix.idf_ver }} + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Build USB Test Application + shell: bash + run: | + . ${IDF_PATH}/export.sh + pip install pytest pytest-cpp idf-build-apps==2.4.3 --upgrade + idf-build-apps find --target linux + idf-build-apps build --target linux + pytest host/class/cdc/usb_host_cdc_acm/host_test/build_linux diff --git a/.github/workflows/build_and_run_test_app_usb.yml b/.github/workflows/build_and_run_test_app_usb.yml index b3b98bb9..b4d4b7b3 100644 --- a/.github/workflows/build_and_run_test_app_usb.yml +++ b/.github/workflows/build_and_run_test_app_usb.yml @@ -63,4 +63,4 @@ jobs: PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb - name: Run USB Test App on target - run: pytest --target=${{ matrix.idf_target }} -m usb_host --build-dir=build_${{ matrix.idf_target }} + run: pytest --embedded-services esp,idf --target=${{ matrix.idf_target }} -m usb_host --build-dir=build_${{ matrix.idf_target }} diff --git a/host/class/cdc/usb_host_cdc_acm/host_test/CMakeLists.txt b/host/class/cdc/usb_host_cdc_acm/host_test/CMakeLists.txt index f2429fe3..460a5156 100644 --- a/host/class/cdc/usb_host_cdc_acm/host_test/CMakeLists.txt +++ b/host/class/cdc/usb_host_cdc_acm/host_test/CMakeLists.txt @@ -5,6 +5,7 @@ set(COMPONENTS main) list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/usb/" + "$ENV{IDF_PATH}/tools/mocks/freertos/" ) -project(usb_cdc_host_test) +project(host_test_usb_cdc) diff --git a/host/class/cdc/usb_host_cdc_acm/host_test/main/CMakeLists.txt b/host/class/cdc/usb_host_cdc_acm/host_test/main/CMakeLists.txt index b0cb9e77..6fa86b66 100644 --- a/host/class/cdc/usb_host_cdc_acm/host_test/main/CMakeLists.txt +++ b/host/class/cdc/usb_host_cdc_acm/host_test/main/CMakeLists.txt @@ -3,3 +3,7 @@ idf_component_register(SRC_DIRS . INCLUDE_DIRS . PRIV_INCLUDE_DIRS "../../private_include" WHOLE_ARCHIVE) + +# Currently 'main' for IDF_TARGET=linux is defined in freertos component. +# Since we are using a freertos mock here, need to let Catch2 provide 'main'. +target_link_libraries(${COMPONENT_LIB} PRIVATE Catch2WithMain) diff --git a/host/class/cdc/usb_host_cdc_acm/host_test/main/cdc_descriptors.hpp b/host/class/cdc/usb_host_cdc_acm/host_test/main/cdc_descriptors.hpp index 832791f5..1bafa042 100644 --- a/host/class/cdc/usb_host_cdc_acm/host_test/main/cdc_descriptors.hpp +++ b/host/class/cdc/usb_host_cdc_acm/host_test/main/cdc_descriptors.hpp @@ -20,12 +20,12 @@ - ASIX Electronics Corp. AX88772B (i-tec) - Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter (AXAGON) - Modems: - - Qualcomm / Option SimTech SIM7080 (SIM7070G) + - NOT TESTED: Qualcomm / Option SimTech SIM7080 (SIM7070G) - Quectel Wireless Solutions Co., Ltd. BG96 CAT-M1/NB-IoT modem - - Qualcomm / Option SimTech SIM7000 (SIM7000E) - Qualcomm / Option SimTech, Incorporated (SIM7600E) - - Qualcomm / Option SimTech SIM7080 (SIM7080G) - - Qualcomm / Option A76XX Series LTE Module (SIMA7672E) + - NOT TESTED: Qualcomm / Option SimTech SIM7000 (SIM7000E) + - NOT TESTED: Qualcomm / Option SimTech SIM7080 (SIM7080G) + - NOT TESTED: Qualcomm / Option A76XX Series LTE Module (SIMA7672E) - USB dongle: - NOT TESTED: Shenzhen Rapoo Technology Co., Ltd. Rapoo 2.4G Wireless Device - NOT TESTED: Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) diff --git a/host/class/cdc/usb_host_cdc_acm/host_test/sdkconfig.defaults b/host/class/cdc/usb_host_cdc_acm/host_test/sdkconfig.defaults index 2c101e76..14bc2aef 100644 --- a/host/class/cdc/usb_host_cdc_acm/host_test/sdkconfig.defaults +++ b/host/class/cdc/usb_host_cdc_acm/host_test/sdkconfig.defaults @@ -5,5 +5,4 @@ CONFIG_IDF_TARGET="linux" CONFIG_COMPILER_CXX_EXCEPTIONS=y CONFIG_ESP_MAIN_TASK_STACK_SIZE=12000 CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n diff --git a/pytest.ini b/pytest.ini index 1f07f269..dc82314c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,11 +1,11 @@ [pytest] # only the files with prefix `pytest_` would be recognized as pytest test scripts. python_files = pytest_*.py +cpp_files = host_test_*.elf # set traceback to "short" to prevent the overwhelming tracebacks addopts = -s - --embedded-services esp,idf --tb short markers =