diff --git a/.gitlab/ci/dependencies/dependencies.yml b/.gitlab/ci/dependencies/dependencies.yml index 9488e093f7..f0ef9b2322 100644 --- a/.gitlab/ci/dependencies/dependencies.yml +++ b/.gitlab/ci/dependencies/dependencies.yml @@ -128,6 +128,7 @@ build:integration_test: - wifi # example_test_002, example_test*wifi* - ethernet # example_test*ethernet* - sdio # UT_044, UT_045 + - adc # component_ut_pytest_esp32x_adc patterns: - "{0}-{1}-{2}" - "{0}-{2}" diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index c2ba00de89..37600a6af3 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -220,6 +220,13 @@ - "components/driver/**/*" - "components/sdmmc/**/*" +# for jobs: component_ut_pytest_esp32x_adc: +.patterns-component_ut-adc: &patterns-component_ut-adc + - "components/esp_adc/**/*" + - "components/driver/**/*" + - "components/hal/**/*" + - "components/esp_hw_support/**/*" + - "components/efuse/**/*" ############## # if anchors # @@ -498,6 +505,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:component_ut-esp32: rules: @@ -517,6 +526,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:component_ut-esp32c2: rules: @@ -532,6 +543,8 @@ changes: *patterns-build_components - <<: *if-dev-push changes: *patterns-build_system + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:component_ut-esp32c3: rules: @@ -550,6 +563,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:component_ut-esp32h2: rules: @@ -568,6 +583,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:component_ut-esp32s2: rules: @@ -586,6 +603,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:component_ut-esp32s3: rules: @@ -604,6 +623,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc .rules:build:custom_test: rules: @@ -980,6 +1001,8 @@ changes: *patterns-build_system - <<: *if-dev-push changes: *patterns-component_ut + - <<: *if-dev-push + changes: *patterns-component_ut-adc - <<: *if-dev-push changes: *patterns-custom_test - <<: *if-dev-push @@ -1187,6 +1210,19 @@ - <<: *if-dev-push changes: *patterns-component_ut +.rules:test:component_ut-esp32-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-component_ut + - <<: *if-label-component_ut_esp32 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-component_ut-adc + .rules:test:component_ut-esp32-bt: rules: - <<: *if-revert-branch @@ -1241,6 +1277,19 @@ - <<: *if-label-component_ut_esp32c2 - <<: *if-label-unit_test_esp32c2 +.rules:test:component_ut-esp32c2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-component_ut + - <<: *if-label-component_ut_esp32c2 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-component_ut-adc + .rules:test:component_ut-esp32c2-bt: rules: - <<: *if-revert-branch @@ -1300,6 +1349,19 @@ - <<: *if-dev-push changes: *patterns-component_ut +.rules:test:component_ut-esp32c3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-component_ut + - <<: *if-label-component_ut_esp32c3 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-component_ut-adc + .rules:test:component_ut-esp32c3-bt: rules: - <<: *if-revert-branch @@ -1359,6 +1421,19 @@ - <<: *if-dev-push changes: *patterns-component_ut +.rules:test:component_ut-esp32h2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-component_ut + - <<: *if-label-component_ut_esp32h2 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-component_ut-adc + .rules:test:component_ut-esp32h2-bt: rules: - <<: *if-revert-branch @@ -1418,6 +1493,19 @@ - <<: *if-dev-push changes: *patterns-component_ut +.rules:test:component_ut-esp32s2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-component_ut + - <<: *if-label-component_ut_esp32s2 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-component_ut-adc + .rules:test:component_ut-esp32s2-bt: rules: - <<: *if-revert-branch @@ -1477,6 +1565,19 @@ - <<: *if-dev-push changes: *patterns-component_ut +.rules:test:component_ut-esp32s3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-component_ut + - <<: *if-label-component_ut_esp32s3 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-component_ut-adc + .rules:test:component_ut-esp32s3-bt: rules: - <<: *if-revert-branch @@ -1534,6 +1635,17 @@ - <<: *if-dev-push changes: *patterns-custom_test +.rules:test:custom_test-esp32-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-custom_test + - <<: *if-label-custom_test_esp32 + - <<: *if-label-target_test + .rules:test:custom_test-esp32-bt: rules: - <<: *if-revert-branch @@ -1587,6 +1699,17 @@ when: never - <<: *if-label-custom_test_esp32c2 +.rules:test:custom_test-esp32c2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-custom_test + - <<: *if-label-custom_test_esp32c2 + - <<: *if-label-target_test + .rules:test:custom_test-esp32c2-bt: rules: - <<: *if-revert-branch @@ -1644,6 +1767,17 @@ - <<: *if-dev-push changes: *patterns-custom_test +.rules:test:custom_test-esp32c3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-custom_test + - <<: *if-label-custom_test_esp32c3 + - <<: *if-label-target_test + .rules:test:custom_test-esp32c3-bt: rules: - <<: *if-revert-branch @@ -1701,6 +1835,17 @@ - <<: *if-dev-push changes: *patterns-custom_test +.rules:test:custom_test-esp32h2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-custom_test + - <<: *if-label-custom_test_esp32h2 + - <<: *if-label-target_test + .rules:test:custom_test-esp32h2-bt: rules: - <<: *if-revert-branch @@ -1758,6 +1903,17 @@ - <<: *if-dev-push changes: *patterns-custom_test +.rules:test:custom_test-esp32s2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-custom_test + - <<: *if-label-custom_test_esp32s2 + - <<: *if-label-target_test + .rules:test:custom_test-esp32s2-bt: rules: - <<: *if-revert-branch @@ -1815,6 +1971,17 @@ - <<: *if-dev-push changes: *patterns-custom_test +.rules:test:custom_test-esp32s3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-custom_test + - <<: *if-label-custom_test_esp32s3 + - <<: *if-label-target_test + .rules:test:custom_test-esp32s3-bt: rules: - <<: *if-revert-branch @@ -1874,6 +2041,17 @@ - <<: *if-dev-push changes: *patterns-example_test +.rules:test:example_test-esp32-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32 + - <<: *if-label-target_test + .rules:test:example_test-esp32-bt: rules: - <<: *if-revert-branch @@ -1942,6 +2120,17 @@ when: never - <<: *if-label-example_test_esp32c2 +.rules:test:example_test-esp32c2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32c2 + - <<: *if-label-target_test + .rules:test:example_test-esp32c2-bt: rules: - <<: *if-revert-branch @@ -2007,6 +2196,17 @@ - <<: *if-dev-push changes: *patterns-example_test +.rules:test:example_test-esp32c3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32c3 + - <<: *if-label-target_test + .rules:test:example_test-esp32c3-bt: rules: - <<: *if-revert-branch @@ -2081,6 +2281,17 @@ - <<: *if-dev-push changes: *patterns-example_test +.rules:test:example_test-esp32h2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32h2 + - <<: *if-label-target_test + .rules:test:example_test-esp32h2-bt: rules: - <<: *if-revert-branch @@ -2146,6 +2357,17 @@ - <<: *if-dev-push changes: *patterns-example_test +.rules:test:example_test-esp32s2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32s2 + - <<: *if-label-target_test + .rules:test:example_test-esp32s2-bt: rules: - <<: *if-revert-branch @@ -2211,6 +2433,17 @@ - <<: *if-dev-push changes: *patterns-example_test +.rules:test:example_test-esp32s3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32s3 + - <<: *if-label-target_test + .rules:test:example_test-esp32s3-bt: rules: - <<: *if-revert-branch @@ -2308,6 +2541,17 @@ - <<: *if-dev-push changes: *patterns-unit_test +.rules:test:unit_test-esp32-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32 + .rules:test:unit_test-esp32-bt: rules: - <<: *if-revert-branch @@ -2363,6 +2607,17 @@ when: never - <<: *if-label-unit_test_esp32c2 +.rules:test:unit_test-esp32c2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32c2 + .rules:test:unit_test-esp32c2-bt: rules: - <<: *if-revert-branch @@ -2422,6 +2677,17 @@ - <<: *if-dev-push changes: *patterns-unit_test +.rules:test:unit_test-esp32c3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32c3 + .rules:test:unit_test-esp32c3-bt: rules: - <<: *if-revert-branch @@ -2481,6 +2747,17 @@ - <<: *if-dev-push changes: *patterns-unit_test +.rules:test:unit_test-esp32h2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32h2 + .rules:test:unit_test-esp32h2-bt: rules: - <<: *if-revert-branch @@ -2540,6 +2817,17 @@ - <<: *if-dev-push changes: *patterns-unit_test +.rules:test:unit_test-esp32s2-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32s2 + .rules:test:unit_test-esp32s2-bt: rules: - <<: *if-revert-branch @@ -2599,6 +2887,17 @@ - <<: *if-dev-push changes: *patterns-unit_test +.rules:test:unit_test-esp32s3-adc: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-target_test + - <<: *if-label-unit_test + - <<: *if-label-unit_test_esp32s3 + .rules:test:unit_test-esp32s3-bt: rules: - <<: *if-revert-branch diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index 3185a11259..0625417a1a 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -220,6 +220,14 @@ component_ut_pytest_esp32_generic: - build_pytest_components_esp32 tags: [ esp32, generic ] +component_ut_pytest_esp32_adc: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32-adc + needs: + - build_pytest_components_esp32 + tags: [ esp32, adc ] + component_ut_pytest_esp32_ip101: extends: - .pytest_components_dir_template @@ -252,6 +260,14 @@ component_ut_pytest_esp32s2_generic: - build_pytest_components_esp32s2 tags: [ esp32s2, generic ] +component_ut_pytest_esp32s2_adc: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32s2-adc + needs: + - build_pytest_components_esp32s2 + tags: [ esp32s2, adc ] + component_ut_pytest_esp32s3_generic: extends: - .pytest_components_dir_template @@ -260,6 +276,14 @@ component_ut_pytest_esp32s3_generic: - build_pytest_components_esp32s3 tags: [ esp32s3, generic ] +component_ut_pytest_esp32s3_adc: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32s3-adc + needs: + - build_pytest_components_esp32s3 + tags: [ esp32s3, adc ] + component_ut_pytest_esp32s3_octal_psram: extends: - .pytest_components_dir_template @@ -292,6 +316,14 @@ component_ut_pytest_esp32c2_generic: - build_pytest_components_esp32c2 tags: [ esp32c2, generic, xtal_40mhz ] +component_ut_pytest_esp32c2_adc: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32c2-adc + needs: + - build_pytest_components_esp32c2 + tags: [ esp32c2, adc ] + component_ut_pytest_esp32c2_xtal_26mhz: extends: - .pytest_components_dir_template @@ -308,6 +340,14 @@ component_ut_pytest_esp32c3_generic: - build_pytest_components_esp32c3 tags: [ esp32c3, generic ] +component_ut_pytest_esp32c3_adc: + extends: + - .pytest_components_dir_template + - .rules:test:component_ut-esp32c3-adc + needs: + - build_pytest_components_esp32c3 + tags: [ esp32c3, adc ] + component_ut_pytest_esp32c3_flash_encryption: extends: - .pytest_components_dir_template diff --git a/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c b/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c index c635e9d518..d877a1d661 100644 --- a/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c +++ b/components/driver/test_apps/legacy_adc_driver/main/test_legacy_adc.c @@ -27,14 +27,14 @@ #elif CONFIG_IDF_TARGET_ESP32S2 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 25 +#define ADC_TEST_LOW_THRESH 35 #define ADC_TEST_HIGH_VAL 8191 #define ADC_TEST_HIGH_THRESH 10 #elif CONFIG_IDF_TARGET_ESP32C3 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 50 +#define ADC_TEST_LOW_THRESH 60 //This is due to ADC2 accuracy is not as good as ADC1, and also we use weak pulldown #define ADC_TEST_HIGH_VAL 4095 #define ADC_TEST_HIGH_THRESH 10 @@ -48,17 +48,11 @@ #elif CONFIG_IDF_TARGET_ESP32C2 #define ADC_TEST_LOW_VAL 2147 -#define ADC_TEST_LOW_THRESH 50 +#define ADC_TEST_LOW_THRESH 100 #define ADC_TEST_HIGH_VAL 4095 #define ADC_TEST_HIGH_THRESH 0 -#elif CONFIG_IDF_TARGET_ESP32H2 -#define ADC_TEST_LOW_VAL 2147 -#define ADC_TEST_LOW_THRESH 50 - -#define ADC_TEST_HIGH_VAL 4095 -#define ADC_TEST_HIGH_THRESH 0 #endif //ADC Channels diff --git a/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py b/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py index 9718e7ecee..881f8e0f6b 100644 --- a/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py +++ b/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py @@ -10,7 +10,7 @@ from pytest_embedded import Dut @pytest.mark.esp32s3 @pytest.mark.esp32c3 @pytest.mark.esp32c2 -@pytest.mark.generic +@pytest.mark.adc @pytest.mark.parametrize( 'config', [ diff --git a/components/esp_adc/test_apps/adc/main/test_common_adc.h b/components/esp_adc/test_apps/adc/main/test_common_adc.h index 740c1093cc..99b80a0eb1 100644 --- a/components/esp_adc/test_apps/adc/main/test_common_adc.h +++ b/components/esp_adc/test_apps/adc/main/test_common_adc.h @@ -72,7 +72,7 @@ void test_adc_calibration_deinit(adc_cali_handle_t handle); #elif CONFIG_IDF_TARGET_ESP32C3 #define ADC_TEST_LOW_VAL 0 -#define ADC_TEST_LOW_THRESH 60 +#define ADC_TEST_LOW_THRESH 60 //This is due to ADC2 accuracy is not as good as ADC1, and also we use weak pulldown #define ADC_TEST_HIGH_VAL 4095 #define ADC_TEST_HIGH_VAL_DMA 4095 @@ -88,7 +88,7 @@ void test_adc_calibration_deinit(adc_cali_handle_t handle); #elif CONFIG_IDF_TARGET_ESP32C2 #define ADC_TEST_LOW_VAL 2147 -#define ADC_TEST_LOW_THRESH 50 +#define ADC_TEST_LOW_THRESH 100 #define ADC_TEST_HIGH_VAL 4095 #define ADC_TEST_HIGH_THRESH 0 diff --git a/components/esp_adc/test_apps/adc/pytest_adc.py b/components/esp_adc/test_apps/adc/pytest_adc.py index 6bbeb4d5fa..bf7d2fb093 100644 --- a/components/esp_adc/test_apps/adc/pytest_adc.py +++ b/components/esp_adc/test_apps/adc/pytest_adc.py @@ -7,10 +7,10 @@ from pytest_embedded import Dut @pytest.mark.esp32 @pytest.mark.esp32s2 -@pytest.mark.esp32c3 @pytest.mark.esp32s3 +@pytest.mark.esp32c3 @pytest.mark.esp32c2 -@pytest.mark.generic +@pytest.mark.adc @pytest.mark.parametrize('config', [ 'iram_safe', 'release', diff --git a/pytest.ini b/pytest.ini index 2433ce2571..7ddfbabf9d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -59,6 +59,7 @@ markers = MSPI_F8R8: runner with Octal Flash and Octal PSRAM MSPI_F4R8: runner with Quad Flash and Octal PSRAM MSPI_F4R4: runner with Quad Flash and Quad PSRAM + adc: ADC related tests should run on adc runners # multi-dut markers multi_dut_generic: tests should be run on generic runners, at least have two duts connected.