Skip to content
pschatzmann edited this page Nov 1, 2026 · 2 revisions

The tests run on the desktop and need nothing but a C++17 compiler and cmake: no Bluetooth.

cmake -S tests -B build-tests && cmake --build build-tests
ctest --test-dir build-tests --output-on-failure

(or cmake -S . -B build -DTINYCTS_BUILD_TESTS=ON)

Test Checks
test_types Encoding and decoding of Current Time, Local Time Information and Reference Time Information (known vectors, round trips, 1970-2100 against gmtime_r, invalid dates)
test_timesources Software clock (also across the overflow of millis()), system clock, adapter
test_serverbase The logic of the server: UTC or local time, writes (refused, converted to UTC), time zone, notification interval
test_clientbase The logic of the client: extrapolation, round trip correction, local time, matching of the wanted device
test_namespace TinyCTS.h uses the namespace

What the tests do not cover

The Bluetooth backends are not part of the automatic tests. They were compiled for ESP32 (NimBLE), Pico W, Nano 33 BLE and Uno R4 WiFi (ArduinoBLE), and the Linux backend was run against BlueZ (registration, scan). The backends for macOS and Windows have not been compiled or run, and no backend has been tested with a second Bluetooth device.

Clone this wiki locally