Skip to content
Open
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Updated to CAS BACnet Stack 6.x `83e04a2d` (6.1.2, 2026-12-02).

### Fixed

- On Windows, `tests/run_wire_tests.py` reports the three broadcast-capture Wire
Tests as SKIP (they need Linux or macOS) instead of FAILED, and still exits 0
when every test that can run passes.

## [1.2.1] - 2026-11-02

Built on CAS BACnet Stack 6.x (`1e7dffe2b`).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ through your firewall.
## Verify

**Automated, on the wire** - [`tests/`](tests/README.md) (Python 3 standard
library only; Linux/macOS - on Windows only `discovery_test.py`, `routing_table_test.py`
and `list_element_test.py` run, the others capture broadcasts). One command runs every Wire Test against the router
library only). On Windows the three scripts that capture the router's broadcasts are
reported as `SKIP`; run them on Linux or macOS. One command runs every Wire Test against the router
you built; the device behind port 2 is simulated in Python by the tests:

```bash
Expand Down
2 changes: 1 addition & 1 deletion submodules/cas-bacnet-stack
8 changes: 5 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ runs on its own with the same `--exe` / `--port` options. `--port` (default
second socket on the router's own UDP port (and the Peer in
`broadcast_forwarding_test.py` listens the same way). POSIX `SO_REUSEADDR` allows that; on
Windows `common/` binds with `SO_EXCLUSIVEADDRUSE` on purpose, which refuses it, so
`routing_test.py`, `router_discovery_test.py` and `broadcast_forwarding_test.py` stop
at their first bind there. `discovery_test.py`, `routing_table_test.py` and
`list_element_test.py` run on Windows too.
`routing_test.py`, `router_discovery_test.py` and `broadcast_forwarding_test.py` cannot
run there: on Windows `run_wire_tests.py` reports them as `SKIP` and ends with
`ALL WIRE TESTS PASSED (3 skipped on this platform)`. `discovery_test.py`,
`configuration_test.py`, `routing_table_test.py` and `list_element_test.py` run on
Windows too.

A `[KNOWN GAP]` line is a requirement the router does not meet yet because of a
defect outside this example (the stack or `common/`). It is reported on every
Expand Down
18 changes: 15 additions & 3 deletions tests/run_wire_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
python3 tests/run_wire_tests.py [--exe build/BACnetExampleBRTR] [--port 47880]

Exit code 0 = every check in every script passed. [KNOWN GAP] lines are reported
but do not fail the run (TODO.md). Linux/macOS: three scripts capture the router's
broadcasts on its own UDP ports, which needs POSIX SO_REUSEADDR.
but do not fail the run (TODO.md). Three scripts capture the router's broadcasts
on its own UDP ports, which needs POSIX SO_REUSEADDR: on Windows they are
reported as SKIP (tests/README.md "Linux/macOS") and do not fail the run.
"""
import subprocess
import sys
Expand All @@ -18,13 +19,21 @@
TESTS = Path(__file__).resolve().parent
SCRIPTS = ["discovery_test.py", "configuration_test.py", "routing_test.py", "router_discovery_test.py", "broadcast_forwarding_test.py", "routing_table_test.py",
"list_element_test.py"]
# These bind a second socket on the router's own UDP port to see what it broadcasts.
# Windows refuses that (common/ binds with SO_EXCLUSIVEADDRUSE), so run them on Linux/macOS.
NEEDS_POSIX = {"routing_test.py", "router_discovery_test.py", "broadcast_forwarding_test.py"}


def main():
args = setup.parser(__doc__).parse_args()
outcomes = []
skipped = []
for script in SCRIPTS:
print(f"\n===== {script} =====", flush=True)
if sys.platform == "win32" and script in NEEDS_POSIX:
print("SKIP: captures the router's broadcasts, which needs Linux/macOS (tests/README.md)")
skipped.append(script)
continue
run = subprocess.run([sys.executable, "-B", str(TESTS / script), "--exe", args.exe, "--port", str(args.port)],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
print(run.stdout, end="", flush=True)
Expand All @@ -34,8 +43,11 @@ def main():
print("\n===== summary =====")
for script, returncode, totals in outcomes:
print(f"{'PASS' if returncode == 0 else 'FAIL'} {script:28} {totals}")
for script in skipped:
print(f"SKIP {script:28} needs Linux/macOS")
failed = [script for script, returncode, _ in outcomes if returncode != 0]
print("ALL WIRE TESTS PASSED" if not failed else f"FAILED: {', '.join(failed)}")
passed = "ALL WIRE TESTS PASSED" + (f" ({len(skipped)} skipped on this platform)" if skipped else "")
print(passed if not failed else f"FAILED: {', '.join(failed)}")
return 1 if failed else 0


Expand Down
Loading