Skip to content

Commit 005cd42

Browse files
committed
WIP
1 parent c2f8b45 commit 005cd42

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/host/README

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Host emulation (WIP)
3+
--------------------
4+
5+
Regular host test:
6+
make <no argument>
7+
8+
Build all examples with debug enabled: (WIP)
9+
make D=1 examples
10+
11+
Show the example list:
12+
make list
13+
14+
Build one example
15+
make D=1 ../../libraries/esp8266/examples/Blink/Blink
16+
run it:
17+
./bin/Blink -h
18+
19+
20+
Interesting examples:
21+
make D=1 ../../libraries/esp8266/examples/Blink/Blink
22+
make D=1 ../../libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient
23+
make D=1 ../../libraries/ESP8266WebServer/examples/HelloServer/HelloServer
24+
25+
Needs tweaking:
26+
make D=1 ../../libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer
27+
(declare 'void drawGraph();' on top of file)

tests/host/common/MockUDPSocket.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ int mockUDPSocket ()
2121

2222
bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
2323
{
24+
int optval = 1;
25+
if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
26+
fprintf(stderr, MOCK "SO_REUSEPORT failed for udp port %d\n", port);
27+
optval = 1;
28+
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
29+
fprintf(stderr, MOCK "SO_REUSEADDR failed for udp port %d\n", port);
30+
2431
struct sockaddr_in servaddr;
2532
memset(&servaddr, 0, sizeof(servaddr));
2633

0 commit comments

Comments
 (0)