Merge branch 'bugfix/ci_ulp_adc_more_info_v4.2' into 'release/v4.2'

CI: Fix regex in ulp_adc example test (v4.2)

See merge request espressif/esp-idf!10431
This commit is contained in:
Ivan Grokhotkov 2020-09-13 17:26:53 +08:00
commit ced340a1a3

View File

@ -16,10 +16,14 @@ def test_examples_ulp_adc(env, extra_data):
for _ in range(5):
dut.expect('Deep sleep wakeup', timeout=60)
measurements = int(dut.expect(re.compile(r'ULP did (\d+) measurements'), timeout=5)[0], 10)
measurements_str = dut.expect(re.compile(r'ULP did (\d+) measurements'), timeout=5)[0]
assert measurements_str is not None
measurements = int(measurements_str)
Utility.console_log('ULP did {} measurements'.format(measurements))
dut.expect('Thresholds: low=1500 high=2000', timeout=5)
value = int(dut.expect(re.compile(r'Value=(\d+) was (?:below)|(?:above) threshold'), timeout=5)[0], 10)
value_str = dut.expect(re.compile(r'Value=(\d+) was (above|below) threshold'), timeout=5)[0]
assert value_str is not None
value = int(value_str)
Utility.console_log('Value {} was outside the boundaries'.format(value))
dut.expect('Entering deep sleep', timeout=60)