examples: Move non-block socket examples to a single app

To simplify the examples, reused the boiler plate and statics and mainly
for testing on localhost interface with no physical network.
This commit is contained in:
David Cermak
2021-06-11 16:50:28 +02:00
committed by bot
parent e8bbe2f94f
commit 07de534191
26 changed files with 555 additions and 826 deletions

View File

@@ -0,0 +1,26 @@
# This example code is in the Public Domain (or CC0 licensed, at your option.)
# Unless required by applicable law or agreed to in writing, this
# software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied.
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import re
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
def test_examples_protocol_socket_non_block(env, _):
dut = env.get_dut('non_blocking_socket', 'examples/protocols/sockets/non_blocking', dut_class=ttfw_idf.ESP32DUT)
# start the test and expect the client to receive back it's original data
dut.start_app()
dut.expect(re.compile(r'nonblocking-socket-client: Received: GET / HTTP/1.1'), timeout=30)
if __name__ == '__main__':
test_examples_protocol_socket_non_block()