mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-21 11:30:01 +00:00
Tuning test
This commit is contained in:
1 parent
1d0e65d17a
commit
866c987409
4 files changed
+20
-14
No files matched your search
@@ -15,9 +15,6 @@ matrix:
|
||||
- os: osx
|
||||
compiler: clang
|
||||
script: make mg_prefix
|
||||
- os: linux
|
||||
compiler: clang
|
||||
script: cat /usr/include/mbedtls/net.h ; grep -r mbedtls_net_send /usr/include/mbedtls/
|
||||
- os: linux
|
||||
compiler: msvc98
|
||||
script: make vc98 vc2017
|
||||
|
||||
@@ -48,7 +48,7 @@ fuzz: mongoose.c mongoose.h Makefile test/fuzz.c
|
||||
|
||||
# make CLANG=/usr/local/opt/llvm\@8/bin/clang ASAN_OPTIONS=detect_leaks=1
|
||||
test: CFLAGS += -DMG_ENABLE_IPV6=1 -fsanitize=address#,undefined
|
||||
test: mongoose.c mongoose.h clean Makefile test/unit_test.c
|
||||
test: mongoose.c mongoose.h Makefile test/unit_test.c
|
||||
$(CLANG) mongoose.c test/unit_test.c $(CFLAGS) -coverage $(LDFLAGS) -g -o unit_test
|
||||
ASAN_OPTIONS=$(ASAN_OPTIONS) $(DEBUGGER) ./unit_test
|
||||
|
||||
@@ -59,17 +59,17 @@ infer:
|
||||
infer run -- cc test/unit_test.c -c -W -Wall -Werror -Isrc -I. -O2 -DMG_ENABLE_MBEDTLS=1 -DMG_ENABLE_LINES -I/usr/local/Cellar/mbedtls/2.23.0/include -DMG_ENABLE_IPV6=1 -g -o /dev/null
|
||||
|
||||
#vc98: VCFLAGS += -DMG_ENABLE_IPV6=1
|
||||
vc98: clean Makefile mongoose.c mongoose.h test/unit_test.c
|
||||
vc98: Makefile mongoose.c mongoose.h test/unit_test.c
|
||||
$(VC98) wine cl mongoose.c test/unit_test.c $(VCFLAGS) ws2_32.lib /Fe$@.exe
|
||||
$(VC98) wine $@.exe
|
||||
|
||||
vc2017: CFLAGS += -DMG_ENABLE_IPV6=1
|
||||
vc2017: clean Makefile mongoose.c mongoose.h test/unit_test.c
|
||||
vc2017: Makefile mongoose.c mongoose.h test/unit_test.c
|
||||
$(VC2017) wine64 cl mongoose.c test/unit_test.c $(VCFLAGS) ws2_32.lib /Fe$@.exe
|
||||
$(VC2017) wine64 $@.exe
|
||||
|
||||
linux: CFLAGS += -DMG_ENABLE_IPV6=1 -fsanitize=address,undefined
|
||||
linux: clean Makefile mongoose.c mongoose.h test/unit_test.c
|
||||
linux: Makefile mongoose.c mongoose.h test/unit_test.c
|
||||
$(GCC) $(CC) mongoose.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -o unit_test_gcc
|
||||
$(GCC) ./unit_test_gcc
|
||||
|
||||
@@ -85,4 +85,3 @@ mongoose.h: $(HDRS) Makefile
|
||||
clean: EXAMPLE_TARGET = clean
|
||||
clean: ex
|
||||
rm -rf $(PROG) *.o *.dSYM unit_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out
|
||||
|
||||
+8
-4
@@ -2923,13 +2923,17 @@ void mg_timer_poll(unsigned long now_ms) {
|
||||
|
||||
#include <mbedtls/debug.h>
|
||||
#include <mbedtls/ssl.h>
|
||||
#include <mbedtls/version.h>
|
||||
#if MBEDTLS_VERSION_NUMBER > 0x02070000
|
||||
#include <mbedtls/net_sockets.h>
|
||||
|
||||
// Different versions have those in different files, so declare here
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN_C extern "C"
|
||||
#else
|
||||
#include <mbedtls/net.h>
|
||||
#define EXTERN_C
|
||||
#endif
|
||||
|
||||
EXTERN_C int mbedtls_net_recv(void *, unsigned char *, size_t);
|
||||
EXTERN_C int mbedtls_net_send(void *, const unsigned char *, size_t);
|
||||
|
||||
struct mg_tls {
|
||||
char *cafile; // CA certificate path
|
||||
mbedtls_x509_crt ca; // Parsed CA certificate
|
||||
|
||||
@@ -9,8 +9,14 @@
|
||||
#include <mbedtls/ssl.h>
|
||||
|
||||
// Different versions have those in different files, so declare here
|
||||
int mbedtls_net_recv(void *ctx, unsigned char *buf, size_t len);
|
||||
int mbedtls_net_send(void *ctx, const unsigned char *buf, size_t len);
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN_C extern "C"
|
||||
#else
|
||||
#define EXTERN_C
|
||||
#endif
|
||||
|
||||
EXTERN_C int mbedtls_net_recv(void *, unsigned char *, size_t);
|
||||
EXTERN_C int mbedtls_net_send(void *, const unsigned char *, size_t);
|
||||
|
||||
struct mg_tls {
|
||||
char *cafile; // CA certificate path
|
||||
|
||||
Reference in new issue
Block a user