diff --git a/.github/workflows/build_and_run_test_app.yml b/.github/workflows/build_and_run_test_app.yml index 6295f7e..a1f6f9b 100644 --- a/.github/workflows/build_and_run_test_app.yml +++ b/.github/workflows/build_and_run_test_app.yml @@ -6,6 +6,7 @@ on: jobs: build: + name: Build Test App strategy: matrix: idf_ver: ["release-v4.3", "release-v4.4", "latest"] @@ -23,14 +24,14 @@ jobs: env: IDF_TARGET: ${{ matrix.idf_target }} shell: bash + working-directory: test_app run: | - cd test_app . ${IDF_PATH}/export.sh idf.py build - name: Merge binaries + working-directory: test_app/build run: | pip install esptool - cd test_app/build python -m esptool --chip esp32 merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args - uses: actions/upload-artifact@v2 with: @@ -38,18 +39,54 @@ jobs: path: | test_app/build/flash_image.bin - run-qemu: - name: Run Test App in QEMU + #run-qemu: # Keeping this here for future reference. QEMU tests are not passing now + # name: Run Test App in QEMU + # needs: build + # strategy: + # matrix: + # idf_ver: ["release-v4.4", "latest"] #FIXME: QEMU is crashing with v4.3 build + # runs-on: ubuntu-20.04 + # container: ageon/pytest_env + # steps: + # - uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # - uses: actions/download-artifact@v2 + # with: + # name: test_app_bin_esp32_${{ matrix.idf_ver }} + # path: test_app/build + # - name: Run Test App in QEMU + # working-directory: test_app + # run: pytest -s --junit-xml=./test_app_results.xml --embedded-services qemu + + run-target: + name: Run Test App on target needs: build strategy: matrix: idf_ver: ["release-v4.3", "release-v4.4", "latest"] - runs-on: ubuntu-20.04 - container: ageon/pytest_env + idf_target: ["esp32", "esp32c3", "esp32s3"] + exclude: + - idf_ver: "release-v4.3" + idf_target: esp32s3 # ESP32S3 support started with version 4.4 + runs-on: [self-hosted, linux, docker, esp32] # Unfortunately `${{ matrix.idf_target }}` is not accepted here + container: + image: python:3.7-slim-buster + options: --privileged steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/download-artifact@v2 with: - name: test_app_bin_esp32_${{ matrix.idf_ver }} - - - name: Display structure of downloaded files - run: ls -R + name: test_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }} + path: test_app/build + - name: Install Python packages + env: + PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple" + run: pip install esptool pytest-embedded==0.6.0rc0 pytest-embedded-serial-esp==0.6.0rc0 + - name: Download Test App to target + run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 test_app/build/flash_image.bin + - name: Run Test App on target + working-directory: test_app + run: pytest -s --junit-xml=./test_app_results.xml --embedded-services esp --target=${{ matrix.idf_target }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 0147823..8174cc1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,5 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: actions/setup-python@v2 - uses: pre-commit/action@v2.0.3 diff --git a/expat/idf_component.yml b/expat/idf_component.yml index 567c266..1c4d525 100644 --- a/expat/idf_component.yml +++ b/expat/idf_component.yml @@ -2,4 +2,4 @@ version: "2.4.3" description: "Expat - XML Parsing C Library" url: https://github.com/espressif/idf-extra-components/tree/master/expat dependencies: - idf: ">=4.4" + idf: ">=4.3" diff --git a/pid_ctrl/idf_component.yml b/pid_ctrl/idf_component.yml index 9c21bb1..fa81695 100644 --- a/pid_ctrl/idf_component.yml +++ b/pid_ctrl/idf_component.yml @@ -1,5 +1,5 @@ -version: "0.1.0" +version: "0.1.1" description: Proportional-integral-derivative controller url: https://github.com/espressif/idf-extra-components/tree/master/pid_ctrl dependencies: - idf: ">=4.3" + idf: ">=4.4" diff --git a/test_app/CMakeLists.txt b/test_app/CMakeLists.txt index 41475c8..4085337 100644 --- a/test_app/CMakeLists.txt +++ b/test_app/CMakeLists.txt @@ -2,7 +2,16 @@ # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(EXTRA_COMPONENT_DIRS ../libsodium ../expat ../esp_encrypted_img) +set(EXTRA_COMPONENT_DIRS ../libsodium ../expat ../esp_encrypted_img ../cbor ../jsmn ../qrcode) + +if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "4.4") + list(APPEND EXTRA_COMPONENT_DIRS ../pid_ctrl) +endif() + +if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0") + list(APPEND EXTRA_COMPONENT_DIRS ../sh2lib ../nghttp) +endif() + # Set the components to include the tests for. set(TEST_COMPONENTS libsodium expat esp_encrypted_img CACHE STRING "List of components to test") diff --git a/test_app/main/test_app_main.c b/test_app/main/test_app_main.c index 65c83a5..26d18af 100644 --- a/test_app/main/test_app_main.c +++ b/test_app/main/test_app_main.c @@ -11,6 +11,8 @@ void app_main(void) { UNITY_BEGIN(); - unity_run_menu(); + //unity_run_tests_by_tag("[libsodium]", false); + unity_run_all_tests(); + //unity_run_menu(); UNITY_END(); } diff --git a/test_app/sdkconfig.defaults b/test_app/sdkconfig.defaults index 9801b6c..719be77 100644 --- a/test_app/sdkconfig.defaults +++ b/test_app/sdkconfig.defaults @@ -4,3 +4,11 @@ CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# Run-time checks of Heap and Stack +CONFIG_HEAP_POISONING_COMPREHENSIVE=y +CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y +CONFIG_COMPILER_STACK_CHECK=y +CONFIG_ESP_MAIN_TASK_STACK_SIZE=16000 + +CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL=y diff --git a/test_app/sdkconfig.defaults.esp32c3 b/test_app/sdkconfig.defaults.esp32c3 new file mode 100644 index 0000000..d2265c0 --- /dev/null +++ b/test_app/sdkconfig.defaults.esp32c3 @@ -0,0 +1 @@ +CONFIG_ESP32C3_REV_MIN_0=y diff --git a/test_app/test_app.py b/test_app/test_app.py new file mode 100644 index 0000000..e62dd36 --- /dev/null +++ b/test_app/test_app.py @@ -0,0 +1,2 @@ +def test_app(dut): + dut.expect_unity_test_output(timeout=240)