mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-04 19:10:58 +02:00
ci: run Example_GENERIC for C3
Add support for running example_GENERIC tests for C3 on label. Fix examples that fail.
This commit is contained in:
committed by
Angus Gratton
parent
c270a9f0b9
commit
8efb2bb1ed
@@ -6,7 +6,7 @@ import ttfw_idf
|
||||
from tiny_test_fw import Utility
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_base_mac_address(env, extra_data):
|
||||
|
||||
dut = env.get_dut('base_mac_address', 'examples/system/base_mac_address')
|
||||
|
@@ -3,7 +3,7 @@ from __future__ import print_function
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_system_console(env, extra_data):
|
||||
dut = env.get_dut('console_example', 'examples/system/console', app_config_name='history')
|
||||
print('Using binary path: {}'.format(dut.app.binary_path))
|
||||
|
@@ -4,14 +4,16 @@ import re
|
||||
|
||||
import ttfw_idf
|
||||
|
||||
touch_wake_up_support = ['esp32']
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_deep_sleep(env, extra_data):
|
||||
|
||||
dut = env.get_dut('deep_sleep', 'examples/system/deep_sleep')
|
||||
dut.start_app()
|
||||
|
||||
def expect_enable_deep_sleep():
|
||||
def expect_enable_deep_sleep_touch():
|
||||
dut.expect_all('Enabling timer wakeup, 20s',
|
||||
re.compile(r'Touch pad #8 average: \d+, wakeup threshold set to \d+.'),
|
||||
re.compile(r'Touch pad #9 average: \d+, wakeup threshold set to \d+.'),
|
||||
@@ -19,6 +21,16 @@ def test_examples_deep_sleep(env, extra_data):
|
||||
'Entering deep sleep',
|
||||
timeout=10)
|
||||
|
||||
def expect_enable_deep_sleep_no_touch():
|
||||
dut.expect_all('Enabling timer wakeup, 20s',
|
||||
'Entering deep sleep',
|
||||
timeout=10)
|
||||
|
||||
if dut.TARGET in touch_wake_up_support:
|
||||
expect_enable_deep_sleep = expect_enable_deep_sleep_touch
|
||||
else:
|
||||
expect_enable_deep_sleep = expect_enable_deep_sleep_no_touch
|
||||
|
||||
dut.expect('Not a deep sleep reset', timeout=30)
|
||||
expect_enable_deep_sleep()
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import re
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_efuse(env, extra_data):
|
||||
|
||||
dut = env.get_dut('efuse', 'examples/system/efuse')
|
||||
|
@@ -69,8 +69,8 @@ def _test_iteration_events(dut):
|
||||
dut.expect(TASK_ITERATION_HANDLING.format(iteration))
|
||||
dut.expect('TASK_EVENTS:TASK_ITERATION_EVENT: all_event_handler')
|
||||
elif iteration == TASK_UNREGISTRATION_LIMIT:
|
||||
dut.expect('TASK_EVENTS:TASK_ITERATION_EVENT: unregistering task_iteration_handler')
|
||||
dut.expect('TASK_EVENTS:TASK_ITERATION_EVENT: all_event_handler')
|
||||
dut.expect_all('TASK_EVENTS:TASK_ITERATION_EVENT: unregistering task_iteration_handler',
|
||||
'TASK_EVENTS:TASK_ITERATION_EVENT: all_event_handler')
|
||||
print('Unregistered handler at iteration {} out of {}'.format(iteration, TASK_ITERATION_LIMIT))
|
||||
else:
|
||||
dut.expect('TASK_EVENTS:TASK_ITERATION_EVENT: all_event_handler')
|
||||
@@ -81,7 +81,7 @@ def _test_iteration_events(dut):
|
||||
print('Deleted task event source')
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32'])
|
||||
def test_default_event_loop_example(env, extra_data):
|
||||
dut = env.get_dut('default_event_loop', 'examples/system/esp_event/default_event_loop')
|
||||
|
||||
|
@@ -8,9 +8,9 @@ TASK_ITERATION_POSTING = 'posting TASK_EVENTS:TASK_ITERATION_EVENT to {}, iterat
|
||||
TASK_ITERATION_HANDLING = 'handling TASK_EVENTS:TASK_ITERATION_EVENT from {}, iteration {}'
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_user_event_loops_example(env, extra_data):
|
||||
dut = env.get_dut('user_event_loops', 'examples/system/esp_event/user_event_loops', dut_class=ttfw_idf.ESP32DUT)
|
||||
dut = env.get_dut('user_event_loops', 'examples/system/esp_event/user_event_loops')
|
||||
|
||||
dut.start_app()
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
| Supported Targets | ESP32 |
|
||||
| ----------------- | ----- |
|
||||
| Supported Targets | ESP32 | ESP32-S2 |
|
||||
| ----------------- | ----- | -------- |
|
||||
|
||||
# High Resolution Timer Example (`esp_timer`)
|
||||
# High Resolution Timer Example (`esp_timer`)
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
@@ -15,7 +15,7 @@ The `esp_timer` API also provides the `esp_timer_get_time()` function which retu
|
||||
|
||||
### Hardware Required
|
||||
|
||||
This example should be able to run on any commonly available ESP32 development board.
|
||||
This example should be able to run on any commonly available ESP development board.
|
||||
|
||||
### Configure the project
|
||||
|
||||
@@ -127,7 +127,7 @@ I (5265) example: Periodic timer called, time since boot: 5002476 us
|
||||
|
||||
The one-shot timer runs and changes the period of the periodic timer. Now the periodic timer runs with a period of 1 second:
|
||||
|
||||
```
|
||||
```
|
||||
I (5265) example: One-shot timer called, time since boot: 5002586 us
|
||||
I (5265) example: Restarted periodic timer with 1s period, time since boot: 5005475 us
|
||||
I (6265) example: Periodic timer called, time since boot: 6005492 us
|
||||
@@ -144,7 +144,7 @@ I (10265) example: Periodic timer called, time since boot: 10005492 us
|
||||
### 5. Continuation through light sleep
|
||||
|
||||
To illustrate that timekeeping continues correctly after light sleep, the example enters light sleep for 0.5 seconds. This sleep does not impact timer period, and the timer is executed 1 second after the previous iteration. Note that the timers can not execute during light sleep, since the CPU is not running at that time. Such timers would execute immediately after light sleep, and then continue running with their normal period.
|
||||
|
||||
|
||||
```
|
||||
I (10275) example: Entering light sleep for 0.5s, time since boot: 10011559 us
|
||||
I (10275) example: Woke up from light sleep, time since boot: 10512007 us
|
||||
|
@@ -26,9 +26,9 @@ LIGHT_SLEEP_TIME = 500000
|
||||
ONE_SHOT_TIMER_PERIOD = 5000000
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32'])
|
||||
def test_examples_system_esp_timer(env, extra_data):
|
||||
dut = env.get_dut('esp_timer_example', 'examples/system/esp_timer', dut_class=ttfw_idf.ESP32DUT)
|
||||
dut = env.get_dut('esp_timer_example', 'examples/system/esp_timer')
|
||||
# start test
|
||||
dut.start_app()
|
||||
groups = dut.expect(STARTING_TIMERS_REGEX, timeout=30)
|
||||
|
@@ -6,9 +6,9 @@ STATS_TASK_ITERS = 3
|
||||
STATS_TASK_EXPECT = 'Real time stats obtained'
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_real_time_stats_example(env, extra_data):
|
||||
dut = env.get_dut('real_time_stats', 'examples/system/freertos/real_time_stats', dut_class=ttfw_idf.ESP32DUT)
|
||||
dut = env.get_dut('real_time_stats', 'examples/system/freertos/real_time_stats')
|
||||
dut.start_app()
|
||||
|
||||
for iteration in range(0, STATS_TASK_ITERS):
|
||||
|
@@ -1,3 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-S2 |
|
||||
| ----------------- | ----- | -------- |
|
||||
# Light Sleep Example
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
@@ -12,9 +12,9 @@ WAITING_FOR_GPIO_STR = 'Waiting for GPIO0 to go high...'
|
||||
WAKEUP_INTERVAL_MS = 2000
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32'])
|
||||
def test_examples_system_light_sleep(env, extra_data):
|
||||
dut = env.get_dut('light_sleep_example', 'examples/system/light_sleep', dut_class=ttfw_idf.ESP32DUT)
|
||||
dut = env.get_dut('light_sleep_example', 'examples/system/light_sleep')
|
||||
dut.start_app()
|
||||
|
||||
# Ensure DTR and RTS are de-asserted for proper control of GPIO0
|
||||
|
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32'])
|
||||
def test_examples_perfmon(env, extra_data):
|
||||
|
||||
dut = env.get_dut('perfmon', 'examples/system/perfmon')
|
||||
|
@@ -18,7 +18,7 @@ def get_uart_msgs(i):
|
||||
'uart_select_example: {} bytes were received through UART1: {}'.format(len(msg), msg)]
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_select(env, extra_data):
|
||||
|
||||
dut = env.get_dut('select', 'examples/system/select')
|
||||
|
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_task_watchdog(env, extra_data):
|
||||
|
||||
dut = env.get_dut('task_watchdog', 'examples/system/task_watchdog')
|
||||
|
@@ -52,7 +52,7 @@ void app_main(void)
|
||||
#ifndef CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0
|
||||
esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(0));
|
||||
#endif
|
||||
#ifndef CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1
|
||||
#if CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 && !CONFIG_FREERTOS_UNICORE
|
||||
esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(1));
|
||||
#endif
|
||||
|
||||
|
@@ -7,7 +7,7 @@ import ttfw_idf
|
||||
from tiny_test_fw import Utility
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32'])
|
||||
def test_examples_ulp(env, extra_data):
|
||||
|
||||
dut = env.get_dut('ulp', 'examples/system/ulp')
|
||||
|
@@ -6,7 +6,7 @@ import ttfw_idf
|
||||
from tiny_test_fw import Utility
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32'])
|
||||
def test_examples_ulp_adc(env, extra_data):
|
||||
|
||||
dut = env.get_dut('ulp_adc', 'examples/system/ulp_adc')
|
||||
|
@@ -5,7 +5,7 @@ import re
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])
|
||||
def test_examples_unit_test(env, extra_data):
|
||||
|
||||
dut = env.get_dut('unit_test', 'examples/system/unit_test')
|
||||
|
Reference in New Issue
Block a user