Skip to content

Commit

Permalink
fix the poll define and run standard lwip unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
freakyxue committed Apr 15, 2019
1 parent 1bb6e7f commit 74e2fa3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
stages:
- host_test
image: ${CI_DOCKER_REGISTRY}/esp32-ci-env

variables:
# tag in lwip-contrib repo, which supports our esp-lwip branch (and it's cherry-picked commits from release branches)
LWIP_CONTRIB_TAG: STABLE-2_1_0_RELEASE
# test timeout is seconds
TEST_TIMEOUT: 200

before_script:
# Use CI Tools
- curl -sSL ${CIT_LOADER_URL} | sh
- source citools/import_functions

run_lwip_unittests:
stage: host_test
tags:
- host_test
dependencies: []
script:
# have to clone lwip-contrib repo, as it contains unit test infrastructure
- cit_add_ssh_key "${GITLAB_KEY}" "$(cit_parse_url_host ${LWIP_CONTRIB_MIRROR})" "$(cit_parse_url_port ${LWIP_CONTRIB_MIRROR})"
- git clone "${LWIP_CONTRIB_MIRROR}" lwip-contrib && cd lwip-contrib && git checkout tags/${LWIP_CONTRIB_TAG}
- cd ports/unix/check/
# updating environment
- export LWIPDIR=../../../../src && export CK_DEFAULT_TIMEOUT=${TEST_TIMEOUT}
- export TESTFILES=`find $LWIPDIR/../test/unit -name '*.c' | tr '\n' ' '`
- export CFLAGS=-I$LWIPDIR/../test/unit/esp
# build and run tests
- make "TESTFILES=$TESTFILES" check

4 changes: 3 additions & 1 deletion src/include/lwip/sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#define LWIP_HDR_SOCKETS_H

#include "lwip/opt.h"

#include "sys/poll.h"
#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */

#include "lwip/ip_addr.h"
Expand Down Expand Up @@ -503,13 +503,15 @@ typedef struct fd_set
#define POLLWRNORM 0x80
#define POLLWRBAND 0x100
#define POLLHUP 0x200
#ifdef NO_POLLFD
typedef unsigned int nfds_t;
struct pollfd
{
int fd;
short events;
short revents;
};
#endif/* NO_POLLFD*/
#endif

/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided
Expand Down

0 comments on commit 74e2fa3

Please sign in to comment.