ci: support for lwip unittest running on host

This commit is contained in:
David Cermak
2018-07-17 14:56:10 +02:00
parent eeb18a9098
commit 1e833bdfef
4 changed files with 88 additions and 1 deletions
+32
View File
@@ -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_0_1_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
+1 -1
View File
@@ -1569,7 +1569,7 @@ typedef struct {
u8_t total;
}tcp_pcb_num_t;
void tcp_pcb_num_cal(tcp_pcb_num_t *tcp_pcb_num)
static void tcp_pcb_num_cal(tcp_pcb_num_t *tcp_pcb_num)
{
struct tcp_pcb_listen *listen;
struct tcp_pcb *pcb;
+24
View File
@@ -0,0 +1,24 @@
/*
Copyright 2018 Espressif Systems (Shanghai) PTE LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _ESP_LWIP_ARCH_CC_H
#define _ESP_LWIP_ARCH_CC_H
typedef unsigned long mem_ptr_t;
#include "ports/unix/port/include/arch/cc.h"
#endif /* _ESP_LWIP_ARCH_CC_H */
+31
View File
@@ -0,0 +1,31 @@
/*
Copyright 2018 Espressif Systems (Shanghai) PTE LTD
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _ESP_LWIP_HDR_LWIPOPTS_H
#define _ESP_LWIP_HDR_LWIPOPTS_H
/* esp-lwip branch src and tests compilable */
#define SNTP_SERVER_DNS 0
#define LWIP_HAVE_LOOPIF 1
/* ESP specific cofiguration */
#define ESP_LWIP 1
#define ESP_STATS_DROP 0
#define ESP_DHCP 0
#define ESP_STATS_TCP 0
#include "../lwipopts.h"
#endif /* _ESP_LWIP_HDR_LWIPOPTS_H */