Skip to content

Commit 732c35c

Browse files
committed
fix tests
1 parent b95022a commit 732c35c

File tree

10 files changed

+58
-2136
lines changed

10 files changed

+58
-2136
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ jobs:
357357
matrix:
358358
ssl: ["", -DMG_TLS=MG_TLS_BUILTIN]
359359
example:
360-
- path: tutorials/http/device-dashboard/microchip/same54-xpro
360+
- path: http/device-dashboard/microchip/same54-xpro
361361
- path: nxp/rt1020-evk-make-freertos-builtin
362362
- path: nxp/rt1060-evk-make-freertos-builtin
363363
- path: nxp/rt1170-evk-make-freertos-builtin

mongoose.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9763,6 +9763,9 @@ void mg_timer_poll(struct mg_timer **head, uint64_t now_ms) {
97639763
*
97649764
*******************************************************************************/
97659765

9766+
9767+
9768+
#if MG_TLS == MG_TLS_BUILTIN
97669769
/******************************************************************************/
97679770
#define AES_DECRYPTION 1 // whether AES decryption is supported
97689771
/******************************************************************************/
@@ -9772,9 +9775,6 @@ void mg_timer_poll(struct mg_timer **head, uint64_t now_ms) {
97729775

97739776

97749777

9775-
9776-
9777-
#if MG_TLS == MG_TLS_BUILTIN
97789778
/******************************************************************************
97799779
* AES_INIT_KEYGEN_TABLES : MUST be called once before any AES use
97809780
******************************************************************************/

src/tls_aes128.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
*
2121
*******************************************************************************/
2222

23+
#include "arch.h"
24+
#include "tls.h"
25+
#if MG_TLS == MG_TLS_BUILTIN
2326
/******************************************************************************/
2427
#define AES_DECRYPTION 1 // whether AES decryption is supported
2528
/******************************************************************************/
2629

2730
#define MG_ENCRYPT 1 // specify whether we're encrypting
2831
#define MG_DECRYPT 0 // or decrypting
2932

30-
#include "arch.h"
31-
#include "tls.h"
3233
#include "tls_aes128.h"
3334

34-
#if MG_TLS == MG_TLS_BUILTIN
3535
/******************************************************************************
3636
* AES_INIT_KEYGEN_TABLES : MUST be called once before any AES use
3737
******************************************************************************/

test/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ROOT_DIR = $(realpath $(CWD)/..)
1010
ENV ?= -e Tmp=. -e WINEDEBUG=-all
1111
DOCKER_BIN ?= docker
1212
DOCKER ?= $(DOCKER_BIN) run --platform linux/amd64 --rm $(ENV) -v $(ROOT_DIR):$(ROOT_DIR) -w $(CWD)
13+
IS_DOCKER = 0
1314
VCFLAGS = /nologo /W3 /O2 /MD /I. $(DEFS) $(TFLAGS)
1415
IPV6 ?= 1
1516
ASAN ?= -fsanitize=address,undefined,alignment -fno-sanitize-recover=all -fno-omit-frame-pointer -fno-common
@@ -132,7 +133,15 @@ test: Makefile mongoose.h $(SRCS) tls_multirec/server
132133
ASAN_OPTIONS=$(ASAN_OPTIONS) $(RUN) ./unit_test
133134

134135
tls_multirec/server: FORCE
136+
ifneq "$(SSL)" ""
137+
ifeq "$(IS_DOCKER)" "0"
135138
$(MAKE) -C tls_multirec CC=gcc
139+
else
140+
$(MAKE) -C tls_multirec CC="$(CC)" MINUSC=tls_multirec/
141+
endif
142+
else
143+
true
144+
endif
136145

137146
FORCE:
138147
true
@@ -164,6 +173,8 @@ armhf: test
164173

165174
s390: ASAN=
166175
s390: IPV6=0
176+
s390: IS_DOCKER=1
177+
s390: CFLAGS += -Wno-stringop-overflow
167178
s390: CC = $(DOCKER) mdashnet/s390 cc
168179
s390: RUN = $(DOCKER) mdashnet/s390
169180
s390: test

test/tls_multirec/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
CFLAGS = -W -Wall -Wextra -g -I. # Build options
1+
# When running inside a container, we lose the -C information because $(CC) sets the path inside the container,
2+
# so, call with MINUSC=<path>/
3+
CFLAGS = -g -I. # This is a known version, no need to check
24
CFLAGS_MONGOOSE += -DMG_ENABLE_LINES=1 -DMG_ENABLE_IPV6=1
35
CFLAGS_EXTRA ?= -DMG_TLS=MG_TLS_BUILTIN
46

57
server: main.c patched_mongoose.c mongoose.h Makefile
6-
$(CC) main.c patched_mongoose.c $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) -o $@
8+
$(CC) $(MINUSC)main.c $(MINUSC)patched_mongoose.c $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) -o $(MINUSC)$@
79

810
clean:
911
rm -f server

test/tls_multirec/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void cb(struct mg_connection *c, int ev, void *ev_data) {
6363
mg_tls_init(c, &opts);
6464
}
6565
if (ev == MG_EV_HTTP_MSG) {
66-
struct mg_http_message *hm = ev_data;
66+
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
6767

6868
if (mg_match(hm->uri, mg_str("/upload"), NULL)) {
6969
// Serve file upload

tutorials/tcp/modbus-dashboard/Makefile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
PROG ?= ./example # Program we are building
2-
PACK ?= ./pack # Packing executable
32
DELETE = rm -rf # Command to remove files
4-
GZIP ?= gzip # For compressing files in web_root/
53
OUT ?= -o $(PROG) # Compiler argument for output file
64
SOURCES = main.c mongoose.c net.c packed_fs.c # Source code files
75
CFLAGS = -W -Wall -Wextra -g -I. # Build options
6+
NPX ?= npx
87

98
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
109
CFLAGS_MONGOOSE += -DMG_ENABLE_PACKED_FS=1
1110

1211
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
1312
PROG = example.exe # Use .exe suffix for the binary
14-
PACK = pack.exe # Packing executable
1513
CC = gcc # Use MinGW gcc compiler
1614
CFLAGS += -lws2_32 # Link against Winsock library
1715
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
18-
GZIP = echo # No gzip on Windows
1916
endif
2017

2118
# Default target. Build and run program
@@ -32,14 +29,11 @@ web_root/bundle.js:
3229

3330
# Create optimised CSS. Prerequisite: npm -g i tailwindcss tailwindcss-font-inter
3431
web_root/main.css: web_root/index.html $(wildcard web_root/*.js)
35-
npx tailwindcss -o $@ --minify
32+
$(NPX) tailwindcss -o $@ --minify
3633

3734
# Generate packed filesystem for serving Web UI
3835
packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile web_root/main.css web_root/bundle.js
39-
$(GZIP) web_root/*
40-
$(CC) ../../../test/pack.c -o $(PACK)
41-
$(PACK) web_root/* certs/* > $@
42-
$(GZIP) -d web_root/*
36+
node pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) certs/* > $@
4337

4438
mbedtls:
4539
git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../http/device-dashboard/pack.js

0 commit comments

Comments
 (0)