Skip to content

Commit 3f1df4b

Browse files
dpgeorgeprojectgus
authored andcommitted
tests/net_hosted: Only run network loopback test on supported targets.
Only a few ports have TCP/IP loopback enabled in their network stack, and this test will only pass on those ports. There's not really any good way to do a feature check for loopback mode without actually running the test and seeing if it passes/fails, so add an explicit check that the test is running on a port known to support loopback. (Enabling loopback on lwIP, eg RPI_PICO_W, costs +568 code and +272 bss and is a rarely used feature, so not worth unconditionally enabling.) Signed-off-by: Damien George <[email protected]>
1 parent 62479f2 commit 3f1df4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/net_hosted/asyncio_loopback.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Test network loopback behaviour
22

3+
import sys
4+
5+
# Only certain platforms can do TCP/IP loopback.
6+
if sys.platform not in ("darwin", "esp32", "linux"):
7+
print("SKIP")
8+
raise SystemExit
9+
310
try:
411
import asyncio
512
except ImportError:

0 commit comments

Comments
 (0)