mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
docs: Rename esp_pthread docs to pthread, expand details of supported APIs
- Move the code that was in the document out to an example
This commit is contained in:
27
examples/system/pthread/example_test.py
Normal file
27
examples/system/pthread/example_test.py
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import division, print_function, unicode_literals
|
||||
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
import ttfw_idf
|
||||
|
||||
|
||||
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32s2', 'esp32c3'])
|
||||
def test_examples_pthread(env, _): # type: (Any, Any) -> None
|
||||
app_name = 'pthread'
|
||||
dut = env.get_dut(app_name, 'examples/system/pthread')
|
||||
dut.start_app()
|
||||
|
||||
# Note: this test doesn't really confirm anything, except that threads are created
|
||||
# and stdout is not being corrupted by multiple threads printing ot it.
|
||||
dut.expect(re.compile(r'Created thread 0x[\da-f]+'))
|
||||
dut.expect(re.compile(r'Created larger stack thread 0x[\da-f]+'))
|
||||
dut.expect(r'Threads have exited')
|
||||
dut.expect(re.compile(r'Created thread 0x[\da-f]+ with new default config'))
|
||||
dut.expect('Thread has exited')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_examples_pthread()
|
Reference in New Issue
Block a user