diff --git a/examples/system/app_trace_to_host/example_test.py b/examples/system/app_trace_to_host/example_test.py index 4be49f3c09..de58da3b6c 100644 --- a/examples/system/app_trace_to_host/example_test.py +++ b/examples/system/app_trace_to_host/example_test.py @@ -16,7 +16,6 @@ def test_examples_app_trace_to_host(env, extra_data): 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...', @@ -24,10 +23,8 @@ def test_examples_app_trace_to_host(env, extra_data): re.compile(r'example: Collected \d+ samples in 20 ms.'), timeout=20) - 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) + ocd.apptrace_start("file://adc.log 0 9000 5 0 0") + ocd.apptrace_wait_stop(tmo=30) with ttfw_idf.CustomProcess(' '.join([os.path.join(idf_path, 'tools/esp_app_trace/logtrace_proc.py'), 'adc.log', diff --git a/tools/ci/python_packages/ttfw_idf/DebugUtils.py b/tools/ci/python_packages/ttfw_idf/DebugUtils.py index a83ba88581..16fdf481bf 100644 --- a/tools/ci/python_packages/ttfw_idf/DebugUtils.py +++ b/tools/ci/python_packages/ttfw_idf/DebugUtils.py @@ -82,6 +82,15 @@ class OCDBackend(object): def cmd_exec(self, cmd): return self.oocd.cmd_exec(cmd) + def apptrace_start(self, trace_args): + self.oocd.apptrace_start(trace_args) + + def apptrace_stop(self): + self.oocd.apptrace_stop() + + def apptrace_wait_stop(self, tmo=10): + self.oocd.apptrace_wait_stop(tmo=tmo) + class GDBBackend(object): def __init__(self, logfile_path, elffile_path, target, gdbinit_path=None, working_dir=None):