Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,15 @@ UNIT_TEST_SRCS:=src/test/unit/unit.c \
src/test/unit/unit_tests_tcp_flow.c \
src/test/unit/unit_tests_proto.c \
src/test/unit/unit_tests_multicast.c \
src/test/unit/unit_tests_tftp.c
src/test/unit/unit_tests_tftp.c \
src/test/unit/unit_tests_branches.c \
src/test/unit/unit_tests_socket_api_arms.c \
src/test/unit/unit_tests_tcp_state.c \
src/test/unit/unit_tests_poll_dispatcher.c \
src/test/unit/unit_tests_dhcp_edges.c \
src/test/unit/unit_tests_ip_arp_recv.c \
src/test/unit/unit_tests_dns_edges.c \
src/test/unit/unit_tests_misc_edges.c

unit: build/test/unit

Expand Down Expand Up @@ -574,6 +582,18 @@ autocov-multicast: unit-multicast $(COV_MCAST_UNIT)
--merge-mode-functions=merge-use-line-min \
--html-details -o build/coverage/multicast.html

cov-multicast: unit-multicast $(COV_MCAST_UNIT)
@echo "[RUN] unit multicast (coverage)"
@rm -f $(COV_DIR)/*.gcda
@$(COV_MCAST_UNIT)
@echo "[COV] gcovr multicast html"
@mkdir -p build/coverage
@gcovr -r . --exclude "src/test/unit/.*" \
--gcov-ignore-errors=no_working_dir_found \
--merge-mode-functions=merge-use-line-min \
--html-details -o build/coverage/multicast.html
@$(OPEN_CMD) build/coverage/multicast.html

# Install dynamic library to re-link linux applications
#
install:
Expand Down Expand Up @@ -672,7 +692,7 @@ build/test/test-wolfguard-interop: src/test/test_wolfguard_interop.c src/port/po
clean-test-wolfguard-interop:
@rm -f build/test/test-wolfguard-interop build/test/test_wolfguard_interop.o build/test/linux_tun.o

.PHONY: clean all static cppcheck cov autocov autocov-multicast unit-multicast unit-asan unit-ubsan unit-leaksan clean-unit \
.PHONY: clean all static cppcheck cov autocov autocov-multicast cov-multicast unit-multicast unit-asan unit-ubsan unit-leaksan clean-unit \
unit-esp-asan unit-esp-ubsan unit-esp-leaksan clean-unit-esp \
unit-wolfguard unit-wolfguard-asan unit-wolfguard-ubsan clean-unit-wolfguard \
test-wolfguard-loopback test-wolfguard-loopback-asan test-wolfguard-loopback-ubsan \
Expand Down
572 changes: 572 additions & 0 deletions src/test/unit/unit.c

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/test/unit/unit_esp.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* unit_esp.c
*
* Copyright (C) 2026 wolfSSL Inc.
* Copyright (C) 2024 wolfSSL Inc.
*
* This file is part of wolfIP TCP/IP stack.
*
Expand All @@ -18,7 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#ifndef WOLFIP_ESP
#define WOLFIP_ESP
#endif
Expand Down
21 changes: 21 additions & 0 deletions src/test/unit/unit_noeth.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* unit_noeth.c
*
* Copyright (C) 2024 wolfSSL Inc.
*
* This file is part of wolfIP TCP/IP stack.
*
* wolfIP is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfIP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#include "../../../config.h"
#ifdef ETHERNET
#undef ETHERNET
Expand Down
2 changes: 1 addition & 1 deletion src/test/unit/unit_shared.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* unit_shared.c
*
* Copyright (C) 2026 wolfSSL Inc.
* Copyright (C) 2024 wolfSSL Inc.
*
* This file is part of wolfIP TCP/IP stack.
*
Expand Down
21 changes: 21 additions & 0 deletions src/test/unit/unit_tests_api.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* unit_tests_api.c
*
* Copyright (C) 2024 wolfSSL Inc.
*
* This file is part of wolfIP TCP/IP stack.
*
* wolfIP is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfIP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

static struct wolfIP *poll_rearm_stack;
static int poll_rearm_cb_calls;
static int poll_rearm_recv_len;
Expand Down
Loading
Loading