From 9177682a7ef0648ce3d4bde8b1bc3277a7d09eb7 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 6 Sep 2021 15:37:51 +0200 Subject: [PATCH] CI: Check the number of detected cores of apptrace --- examples/system/app_trace_to_host/example_test.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/system/app_trace_to_host/example_test.py b/examples/system/app_trace_to_host/example_test.py index 082b564340..f0e4fb7876 100644 --- a/examples/system/app_trace_to_host/example_test.py +++ b/examples/system/app_trace_to_host/example_test.py @@ -12,8 +12,9 @@ def test_examples_app_trace_to_host(env, extra_data): dut = env.get_dut('app_trace_to_host', rel_project_path) idf_path = dut.app.get_sdk_path() proj_path = os.path.join(idf_path, rel_project_path) + oocd_log_path = os.path.join(proj_path, 'openocd.log') - with ttfw_idf.OCDBackend(os.path.join(proj_path, 'openocd.log'), dut.app.target) as ocd: + with ttfw_idf.OCDBackend(oocd_log_path, 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', @@ -27,6 +28,15 @@ def test_examples_app_trace_to_host(env, extra_data): ocd.apptrace_start('file://adc.log 0 9000 5 0 0') ocd.apptrace_wait_stop(tmo=30) + with open(oocd_log_path) as oocd_log: + cores = 1 if dut.app.get_sdkconfig().get('CONFIG_FREERTOS_UNICORE', '').replace('"','') == 'y' else 2 + params_str = 'App trace params: from {} cores'.format(cores) + for line in oocd_log: + if params_str in line: + break + else: + raise RuntimeError('"{}" could not be found in {}'.format(params_str, oocd_log_path)) + with ttfw_idf.CustomProcess(' '.join([os.path.join(idf_path, 'tools/esp_app_trace/logtrace_proc.py'), 'adc.log', os.path.join(dut.app.binary_path, 'app_trace_to_host.elf')]),