mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
CI: Use higher-level interaction with GDB in example tests and test apps
This commit is contained in:
@@ -12,26 +12,22 @@ def test_examples_app_trace_to_host(env, extra_data):
|
||||
idf_path = dut.app.get_sdk_path()
|
||||
proj_path = os.path.join(idf_path, rel_project_path)
|
||||
|
||||
with ttfw_idf.OCDProcess(os.path.join(proj_path, 'openocd.log')):
|
||||
with ttfw_idf.TelnetProcess(os.path.join(proj_path, 'telnet.log')) as telnet_p:
|
||||
dut.start_app()
|
||||
dut.expect_all('example: Enabling ADC1 on channel 6 / GPIO34.',
|
||||
'example: Enabling CW generator on DAC channel 1',
|
||||
'example: Custom divider of RTC 8 MHz clock has been set.',
|
||||
'example: Sampling ADC and sending data to the host...',
|
||||
re.compile(r'example: Collected \d+ samples in 20 ms.'),
|
||||
'example: Sampling ADC and sending data to the UART...',
|
||||
re.compile(r'example: Sample:\d, Value:\d+'),
|
||||
re.compile(r'example: Collected \d+ samples in 20 ms.'),
|
||||
timeout=20)
|
||||
with ttfw_idf.OCDBackend(os.path.join(proj_path, 'openocd.log'), dut.app.target) as ocd:
|
||||
dut.start_app()
|
||||
dut.expect_all('example: Enabling ADC1 on channel 6 / GPIO34.',
|
||||
'example: Enabling CW generator on DAC channel 1',
|
||||
'example: Custom divider of RTC 8 MHz clock has been set.',
|
||||
'example: Sampling ADC and sending data to the host...',
|
||||
re.compile(r'example: Collected \d+ samples in 20 ms.'),
|
||||
'example: Sampling ADC and sending data to the UART...',
|
||||
re.compile(r'example: Sample:\d, Value:\d+'),
|
||||
re.compile(r'example: Collected \d+ samples in 20 ms.'),
|
||||
timeout=20)
|
||||
|
||||
telnet_p.pexpect_proc.sendline('esp apptrace start file://adc.log 0 9000 5 0 0')
|
||||
telnet_p.pexpect_proc.expect_exact('App trace params: from 2 cores, size 9000 bytes, '
|
||||
'stop_tmo 5 s, poll period 0 ms, wait_rst 0, skip 0 bytes')
|
||||
telnet_p.pexpect_proc.expect_exact('Targets connected.')
|
||||
telnet_p.pexpect_proc.expect_exact('Targets disconnected.')
|
||||
telnet_p.pexpect_proc.expect_exact('Tracing is STOPPED. Size is 9000 of 9000 @')
|
||||
telnet_p.pexpect_proc.expect_exact('Data: blocks incomplete 0, lost bytes: 0')
|
||||
response = ocd.cmd_exec('esp apptrace start file://adc.log 0 9000 5 0 0')
|
||||
with open(os.path.join(proj_path, 'telnet.log'), 'w') as f:
|
||||
f.write(response)
|
||||
assert('Data: blocks incomplete 0, lost bytes: 0' in response)
|
||||
|
||||
with ttfw_idf.CustomProcess(' '.join([os.path.join(idf_path, 'tools/esp_app_trace/logtrace_proc.py'),
|
||||
'adc.log',
|
||||
|
Reference in New Issue
Block a user