mirror of https://github.com/coturn/coturn
Tag:
Branch:
Tree:
master
copilot/fix-1649
debian/buster
debian/buster-backports
debian/master
debian/stretch
debian/stretch-backports
dh2066
fix-oauth
fix_msvc_analyzer
input-validation
libevent.rpm
macos_upgrade
master
move_to_verbose
pristine-tar
sparc64
sparc64-rebase
sparc64-rebase-slim
test-uclient-coverage
try-fix-docker
turnbis
upstream/latest
wferi/callback
4.10.0
4.11.0
4.4.5.3
4.4.5.4
4.5.0.1
4.5.0.2
4.5.0.3
4.5.0.4
4.5.0.5
4.5.0.6
4.5.0.7
4.5.0.8
4.5.1.0
4.5.1.1
4.5.1.2
4.5.1.3
4.5.2
4.6.0
4.6.1
4.6.2
4.6.3
4.7.0
4.8.0
4.9.0
debian/4.5.0.2-3
debian/4.5.0.2-3_bpo8+1
debian/4.5.0.3-1
debian/4.5.0.4-1
debian/4.5.0.4-4
debian/4.5.0.5-1
debian/4.5.0.5-1+deb9u1
debian/4.5.0.5-1+deb9u2
debian/4.5.0.5-1+deb9u3
debian/4.5.0.6-1
debian/4.5.0.7-1
debian/4.5.0.8-1
debian/4.5.1.0-1
debian/4.5.1.0-1_bpo9+1
debian/4.5.1.1-1
debian/4.5.1.1-1.1
debian/4.5.1.1-1.1+deb10u1
debian/4.5.1.1-1.1+deb10u2
debian/4.5.1.1-1.2
debian/4.5.1.3-1
debian/4.5.2-1
debian/4.5.2-1_bpo10+1
debian/4.5.2-2
debian/4.5.2-3
docker/4.10.0-r0
docker/4.10.0-r1
docker/4.11.0-r0
docker/4.5.2-r0
docker/4.5.2-r1
docker/4.5.2-r10
docker/4.5.2-r11
docker/4.5.2-r12
docker/4.5.2-r13
docker/4.5.2-r14
docker/4.5.2-r2
docker/4.5.2-r3
docker/4.5.2-r4
docker/4.5.2-r5
docker/4.5.2-r6
docker/4.5.2-r7
docker/4.5.2-r8
docker/4.5.2-r9
docker/4.6.0-r0
docker/4.6.0-r1
docker/4.6.1-r0
docker/4.6.1-r1
docker/4.6.1-r2
docker/4.6.1-r3
docker/4.6.2-r0
docker/4.6.2-r1
docker/4.6.2-r10
docker/4.6.2-r11
docker/4.6.2-r12
docker/4.6.2-r13
docker/4.6.2-r2
docker/4.6.2-r3
docker/4.6.2-r4
docker/4.6.2-r5
docker/4.6.2-r6
docker/4.6.2-r7
docker/4.6.2-r8
docker/4.6.2-r9
docker/4.6.3-r0
docker/4.6.3-r1
docker/4.6.3-r2
docker/4.6.3-r3
docker/4.7.0-r0
docker/4.7.0-r1
docker/4.7.0-r2
docker/4.7.0-r3
docker/4.7.0-r4
docker/4.8.0-r0
docker/4.8.0-r1
docker/4.9.0-r0
upstream/4.0.0.0
upstream/4.0.0.1
upstream/4.0.0.2
upstream/4.0.1.2
upstream/4.0.1.3
upstream/4.1.0.1
upstream/4.1.0.2
upstream/4.1.1.1
upstream/4.1.2.1
upstream/4.2.1.2
upstream/4.2.2.2
upstream/4.2.3.1
upstream/4.3.1.1
upstream/4.3.1.2
upstream/4.3.1.3
upstream/4.3.2.1
upstream/4.3.2.2
upstream/4.3.3.1
upstream/4.4.1.1
upstream/4.4.1.2
upstream/4.4.2.1
upstream/4.4.2.2
upstream/4.4.2.3
upstream/4.4.4.1
upstream/4.4.4.2
upstream/4.4.5.1
upstream/4.4.5.2
upstream/4.4.5.3
upstream/4.4.5.4
upstream/4.5.0.1
upstream/4.5.0.2
upstream/4.5.0.3
upstream/4.5.0.4
upstream/4.5.0.5
upstream/4.5.0.6
upstream/4.5.0.7
upstream/4.5.0.8
upstream/4.5.1.0
upstream/4.5.1.1
upstream/4.5.1.3
upstream/4.5.2
${ noResults }
4 Commits (master)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
301d12fdda
|
HTTP parsing fixes (#1882)
|
2 weeks ago |
|
|
741b2983cc
|
Extend STUN client fuzz builder coverage (#1878)
|
3 weeks ago |
|
|
4ffa60d32e
|
Out of bound HTTP detection in parser (#1877)
|
3 weeks ago |
|
|
453afd1fdc
|
Add Unity-based unit test scaffolding (#1875)
## Summary Introduces an opt-in unit test layer for coturn using [Unity](https://github.com/ThrowTheSwitch/Unity) — a single-header pure-C test framework that matches coturn's C11 toolchain, portability bar, and zero-C++ production tree. - Unity v2.6.0 is fetched on demand via CMake `FetchContent` (nothing vendored). - Tests are gated behind `-DBUILD_TESTING=ON` (off by default), so the standard build and OSS-Fuzz pipeline are unaffected. - Two test binaries cover pure C-callable code in `libturnclient`: - `test_ioaddr` (6 cases) — `make_ioa_addr`, `addr_get_port`/`addr_set_port`, `addr_eq` variants, `addr_to_string`, IPv4/IPv6/garbage input - `test_stun_msg` (7 cases) — STUN header construction, request/indication/success/error response classification, transaction-ID round-trip, channel message parsing, truncated/zeroed buffer rejection - New `check` cmake target builds tests before running ctest (avoids the `make test` footgun where the auto-generated `test` target only runs already-built binaries). - Legacy `Makefile.in` gets a `unit-tests` target that bootstraps `build/unit-tests/` and delegates to the cmake `check` target. `make check` and `make test` now run the RFC 5769 conformance suite **plus** the Unity unit tests. - CLAUDE.md documents the new workflow plus the one-liner for adding a new `test_<name>.c`. ## Why The existing test story is shell-script integration suites under `examples/scripts/` — they exercise the binary end-to-end but can't pin down behavior of individual functions, can't run without a full build environment, and don't fail loudly when a unit-level invariant breaks. A lightweight unit layer gives us: - Targeted regression coverage for protocol parsing/encoding (the highest bug-yield area). - A natural home for tests of the kinds of subtle invariants already documented in CLAUDE.md (port-counter overflow safety, port-bounds inclusivity, HMAC buffer initialization). - Sub-second feedback for contributors. ## Usage ```bash # CMake direct cmake -S . -B build -DBUILD_TESTING=ON cmake --build build -j --target check # build + run all unit tests ctest --test-dir build --output-on-failure # run already-built tests # Legacy Makefile bridge (after ./configure) make unit-tests # bootstraps build/unit-tests/, builds + runs Unity tests make check # RFC 5769 conformance + unit tests ``` Adding a new test: 1. Drop `tests/test_<name>.c` 2. Append `coturn_add_test(test_<name>)` in `tests/CMakeLists.txt` 3. The `check` target picks it up automatically. ## Test plan - [x] Clean cmake build with `-DBUILD_TESTING=ON` succeeds; full source tree (turnserver, turnadmin, turnclient, turn_server, all turnutils) still builds - [x] `cmake --build build --target check` builds and runs both test binaries — 13/13 cases pass - [x] `ctest --verbose` shows per-case PASS lines for all 13 cases - [x] Default build (`-DBUILD_TESTING` unset) does not fetch Unity or build any test binary ## Notes for reviewers - Why Unity over GoogleTest/Catch2: pure C, single source file, no C++ toolchain dependency, runs anywhere coturn does (incl. exotic CMake targets like Solaris/AIX). GoogleTest would force `extern "C"` wrappers and a C++ compiler everywhere. |
3 weeks ago |