diff --git a/.gitlab/ci/dependencies/dependencies.yml b/.gitlab/ci/dependencies/dependencies.yml index 71dbe58a7f..11ccd47784 100644 --- a/.gitlab/ci/dependencies/dependencies.yml +++ b/.gitlab/ci/dependencies/dependencies.yml @@ -131,6 +131,7 @@ build:integration_test: - sdio # UT_044, UT_045 - usb # USB Device & Host tests - spi_multi # UT_C2_SPI_DUAL + - 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 70ab941386..264599334a 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -233,8 +233,16 @@ .patterns-unit_test-spi_multi: &patterns-unit_test-spi_multi - "components/esp_serial_slave_link/**/*" - "components/driver/**/*" + - "components/hal/**/*" - "examples/peripherals/spi_slave*/**/*" +# 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 # @@ -513,6 +521,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: @@ -532,6 +542,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: @@ -547,6 +559,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: @@ -565,6 +579,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: @@ -583,6 +599,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: @@ -601,6 +619,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: @@ -619,6 +639,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: @@ -1011,6 +1033,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 @@ -1236,6 +1260,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 @@ -1312,6 +1349,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 @@ -1393,6 +1443,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 @@ -1474,6 +1537,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 @@ -1555,6 +1631,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 @@ -1636,6 +1725,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 @@ -1715,6 +1817,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 @@ -1790,6 +1903,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 @@ -1869,6 +1993,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 @@ -1948,6 +2083,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 @@ -2027,6 +2173,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 @@ -2106,6 +2263,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 @@ -2187,6 +2355,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 @@ -2279,6 +2458,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 @@ -2368,6 +2558,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 @@ -2466,6 +2667,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 @@ -2555,6 +2767,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 @@ -2644,6 +2867,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 @@ -2765,6 +2999,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 @@ -2844,6 +3089,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 @@ -2927,6 +3183,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 @@ -3010,6 +3277,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 @@ -3093,6 +3371,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 @@ -3176,6 +3465,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 cc588b04a7..6f82490889 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -228,6 +228,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 @@ -268,6 +276,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_esp32s2_flash_multi: extends: - .pytest_components_dir_template @@ -284,6 +300,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 @@ -324,6 +348,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 @@ -340,6 +372,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 18a3d1222c..5ea8072872 100644 --- a/pytest.ini +++ b/pytest.ini @@ -62,6 +62,7 @@ markers = MSPI_F4R8: runner with Quad Flash and Octal PSRAM MSPI_F4R4: runner with Quad Flash and Quad PSRAM test_jtag_arm: runner where the chip is accessible through JTAG as well + 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.