From 9edf738a64cc127d91e7d1977d6cd6ffb32afeaf Mon Sep 17 00:00:00 2001 From: Andres Cera Date: Mon, 8 Jun 2026 04:19:24 -0500 Subject: [PATCH] test(srt): enable ctest in CI Add a self-contained ctest workflow that builds libsrt with the gtest unit/bonding suite (ENABLE_UNITTESTS) plus developer test apps (ENABLE_TESTING) and runs the full suite via ctest --test-dir build. The upstream cxx11 job couples ctest to the SonarCloud build-wrapper; this job is a plain regression gate. Document the command in AGENTS.md. Baseline: 286/286 passed (1 disabled: CTimer.SleeptoAccuracy). --- .github/workflows/ctest.yaml | 28 ++++++++++++++++++++++++++++ AGENTS.md | 12 ++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/ctest.yaml diff --git a/.github/workflows/ctest.yaml b/.github/workflows/ctest.yaml new file mode 100644 index 000000000..ff2518fcc --- /dev/null +++ b/.github/workflows/ctest.yaml @@ -0,0 +1,28 @@ +name: ctest + +# CERALIVE addition: build libsrt with the developer test apps and the +# GoogleTest unit/bonding suite enabled, then run the full ctest suite. +# The upstream cxx11 workflow also runs ctest, but couples it to the +# SonarCloud build-wrapper; this job is a self-contained regression gate. + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + types: [opened, synchronize, reopened] + +jobs: + ctest: + name: ubuntu ctest + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: deps + run: sudo apt-get update && sudo apt-get install -y libssl-dev + - name: configure + run: cmake -B build -DENABLE_TESTING=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON + - name: build + run: cmake --build build -j$(nproc) + - name: test + run: ctest --test-dir build --output-on-failure diff --git a/AGENTS.md b/AGENTS.md index 99e323212..205673777 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,6 +19,18 @@ Provides `libsrt` at compile time to `ceracoder` and `srtla`. `irl-srt-server` u Standard CMake. Consumed as a submodule by `ceracoder` and `srtla` — do not build standalone unless testing. +## TEST (ctest) + +The GoogleTest unit + bonding suite is gated on `ENABLE_UNITTESTS` (with `ENABLE_CXX11`, ON by default); `ENABLE_TESTING` additionally builds the developer test apps. Both are OFF by default. Run the full suite with: + +```bash +cmake -B build -DENABLE_TESTING=ON -DENABLE_UNITTESTS=ON -DENABLE_BONDING=ON +cmake --build build -j$(nproc) +ctest --test-dir build --output-on-failure +``` + +Baseline: **286/286 passed** (1 disabled: `CTimer.SleeptoAccuracy`). CI runs this via `.github/workflows/ctest.yaml`. Note: `ENABLE_TESTING=ON` alone registers no ctest tests — `ENABLE_UNITTESTS=ON` is what wires the gtest suite into ctest. + ## WHERE TO LOOK | Need | Location |