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
20 changes: 13 additions & 7 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
name: C/C++ CI

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-24.04-arm, ubuntu-latest ]

steps:
- uses: actions/checkout@v6
- run: make
- name: Unit tests
- name: Set up build environment (Linux)
run: |
sudo apt-get update
sudo apt-get install check
if: runner.os == 'Linux'
- name: Set up build environment (macOS)
run: |
brew update
brew install check
if: runner.os == 'macOS'
- uses: actions/checkout@v6
- name: Build
run: make
- name: Unit tests
run: |
make clean
make units UNITS=1
./test/units.sh
if: runner.os == 'Linux'
15 changes: 8 additions & 7 deletions .github/workflows/cross-platform-actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: BSD, Haiku CI

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build:
Expand All @@ -12,23 +12,21 @@ jobs:
include:
- operating_system: freebsd
version: '15.0'
pkginstall: sudo pkg update && sudo pkg install -y gmake && export MAKE=gmake
pkginstall: sudo pkg update && sudo pkg install -y check gmake && export MAKE=gmake
- operating_system: haiku
version: 'r1beta5'
pkginstall: pkgman refresh
pkginstall: pkgman refresh && pkgman install -y check_devel
- operating_system: netbsd
version: '10.1'
pkginstall: sudo pkgin update && sudo pkgin -y install clang gmake && export MAKE=gmake
pkginstall: sudo pkgin update && sudo pkgin -y install check clang gmake && export MAKE=gmake
- operating_system: openbsd
version: '7.8'
pkginstall: sudo pkg_add -u && sudo pkg_add gmake && export MAKE=gmake
pkginstall: sudo pkg_add -u && sudo pkg_add check gmake && export MAKE=gmake
exclude:
- operating_system: haiku
architecture: arm64

steps:
- uses: actions/checkout@v6

- uses: cross-platform-actions/action@v0.32.0
with:
operating_system: ${{ matrix.operating_system }}
Expand All @@ -37,3 +35,6 @@ jobs:
run: |
${{ matrix.pkginstall }}
${MAKE:-make} CC=cc
${MAKE:-make} clean
${MAKE:-make} CC=cc units UNITS=1
./test/units.sh
8 changes: 3 additions & 5 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: MSYS2 CI

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -17,7 +16,6 @@ jobs:
defaults:
run:
shell: msys2 {0}

steps:
- uses: actions/checkout@v6
- uses: msys2/setup-msys2@v2
Expand All @@ -26,5 +24,5 @@ jobs:
update: true
install: make
pacboy: toolchain:p
- run: |
[[ ${{matrix.sys}} == clang* ]] && make CC=clang || make
- name: Build
run: make CC=cc
23 changes: 22 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ ifeq ($(OS),Darwin)
BREW_PREFIX_CHECK:=$(shell brew --prefix check)
UNIT_CFLAGS+=-I$(BREW_PREFIX_CHECK)/include
UNIT_LDFLAGS+=-L$(BREW_PREFIX_CHECK)/lib
else ifeq ($(OS),FreeBSD)
UNIT_CFLAGS+=-I/usr/local/include
UNIT_LDFLAGS+=-L/usr/local/lib
else ifeq ($(OS),Haiku)
UNIT_CFLAGS+=-I/system/develop/headers
UNIT_LDFLAGS+=-L/system/lib -lnetwork
else ifeq ($(OS),NetBSD)
UNIT_CFLAGS+=-I/usr/pkg/include
UNIT_LDFLAGS+=-L/usr/pkg/lib -Wl,-R/usr/pkg/lib
else ifeq ($(OS),OpenBSD)
UNIT_CFLAGS+=-I/usr/local/include
UNIT_LDFLAGS+=-L/usr/local/lib
else ifeq ($(OS),Linux)
UNIT_LDFLAGS+=-lsubunit
endif
Expand All @@ -37,9 +49,18 @@ STRIP?=0
RTOS?=0
GENERIC?=0
PTHREAD?=0
ADDRESS_SANITIZER?=1
GCOV?=0

ifeq ($(OS),Haiku)
ADDRESS_SANITIZER=0
else ifeq ($(OS),NetBSD)
ADDRESS_SANITIZER=0
else ifeq ($(OS),OpenBSD)
ADDRESS_SANITIZER=0
else
ADDRESS_SANITIZER?=1
endif

# Default compiled-in protocols
#
TCP?=1
Expand Down
2 changes: 1 addition & 1 deletion docs/user_manual/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

pdflatex user_doc.tex && pdflatex user_doc.tex && pdflatex user_doc.tex
2 changes: 1 addition & 1 deletion make-gnu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

make PTHREAD=1 TCP=1 UDP=1 VDE=1 \
RTOS=0 \
Expand Down
2 changes: 1 addition & 1 deletion mkdeps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ "$#" -eq 0 ]; then
echo "Supply PREFIX for building pico_defines.h"
Expand Down
2 changes: 1 addition & 1 deletion modules/pico_dev_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ static void ipcp_send_req(struct pico_device_ppp *ppp)

static void ipcp_reject_vj(struct pico_device_ppp *ppp, uint8_t *comp_req)
{
uint8_t ipcp_req[PPP_HDR_SIZE + PPP_PROTO_SLOT_SIZE + sizeof(struct pico_ipcp_hdr) + IPCP_VJ_LEN + PPP_FCS_SIZE + 1];
uint8_t ipcp_req[PPP_HDR_SIZE + PPP_PROTO_SLOT_SIZE + sizeof(struct pico_ipcp_hdr) + IPCP_VJ_LEN + PPP_FCS_SIZE + 1] = { 0 };
uint32_t prefix = PPP_HDR_SIZE + PPP_PROTO_SLOT_SIZE;
struct pico_ipcp_hdr *ih = (struct pico_ipcp_hdr *) (ipcp_req + prefix);
uint8_t *p = ipcp_req + prefix + sizeof(struct pico_ipcp_hdr);
Expand Down
2 changes: 1 addition & 1 deletion test/autotest.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -x
TFTP_EXEC_DIR="$(pwd)/build/test"
Expand Down
2 changes: 1 addition & 1 deletion test/coverage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
./test/units.sh || exit 1
./test/autotest.sh || exit 2
exit 0
2 changes: 1 addition & 1 deletion test/mkunits.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# By Daniele.
#set -x
filename=$1
Expand Down
2 changes: 1 addition & 1 deletion test/olsr_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

sudo vde_switch -t pic0 -s /tmp/pic0.ctl -d
sudo vde_switch -s /tmp/pic1.ctl -d
Expand Down
2 changes: 1 addition & 1 deletion test/perf.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
THRESHOLD=300
sh ./test/vde_sock_start_user.sh
sleep 2
Expand Down
2 changes: 1 addition & 1 deletion test/units.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
rm -f /tmp/pico-mem-report-*

ASAN_OPTIONS="detect_leaks=0" ./build/test/units || exit 1
Expand Down
2 changes: 1 addition & 1 deletion test/vde_sock_start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

gksu "vdecmd -s /tmp/pico.mgmt shutdown"
gksu "vdecmd -s /tmp/pico1.mgmt shutdown"
Expand Down
2 changes: 1 addition & 1 deletion test/vde_sock_start_user.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
function help(){
echo 'Cmd line arguments can be:'
echo 'start: to start the vde setup for the autotest.'
Expand Down