Skip to content

Split the grab-bag test files along their modules - #93

Merged
kahrendt merged 1 commit into
mainfrom
issue-45-split-tests
Oct 15, 2026
Merged

kahrendt merged 1 commit into
mainfrom
issue-45-split-tests

Conversation

@kahrendt

Copy link
Copy Markdown
Contributor

Summary

Splits the grab-bag test files so each module's tests live in the module's own file. Every test keeps its name and its realtime label, and the test count is unchanged (829 CTest tests, 68 realtime).

Change

  • test_server_roles.cpp: ServerGroups moves to the new test_server_groups.cpp. ServerDisconnect and ServerTrace join test_server_raw_client.cpp (goodbyes, and the trace of completed writes). Approval, the controller and metadata roles, and the in-process role tests stay. The raw-client role helpers they share (hello(), player_state(), connect(), next() and the rest) move to the new tests/raw_roles.h.
  • test_transport.cpp: the pure TransportUrl and TransportErrno tables (transport_url.cpp's functions) move to test_transport_url.cpp. The loopback and write-invariant tests stay.
  • test_server_players.cpp: its rig (the segments and feed, Player, StreamTrace, the output decode, the expect_* checks and Rig) moves to tests/players_rig.h.
  • Suites in other modules' files move to their own: SchedRunView goes to test_sched_run_view.cpp, ColorSchedule (ScheduledUpdates) to test_scheduled_updates.cpp and SourceFeed to test_source_feed.cpp.
  • Group: GroupStalls and GroupAudioThread (a group on core with its job on the audio threads) move from test_audio_workers_internals.cpp to test_group_internals.cpp. The -fno-access-control reason and the group_job.h paragraph move with them. Every Group test reaches private members, so there is no public test_group.cpp yet; the new file is the _internals one.
  • Small fixes found along the way: a pre-existing unused client_clock_us using is dropped, and <cstddef> is added where size_t was used without it.
  • Left out: the issue's optional portable seeded distributions. They are hygiene with no failing case.
  • CLAUDE.md lists the two new headers.

Tests

The change adds no tests; test bodies moved verbatim. Before and after, --gtest_list_tests gives the same set of names.

Closes #45

test_server_roles.cpp's ServerGroups suite gets its own file and its
disconnect and trace tests join the raw-client file, with the raw-client
role helpers in raw_roles.h. The transport's URL and errno tables leave the
loopback file, the in-process players' rig moves to players_rig.h, and the
run view, scheduled updates and source feed suites get their own files.
Group's tests move out of the audio workers file into
test_group_internals.cpp. Every test keeps its name and label.
@kahrendt
kahrendt marked this pull request as ready for review October 15, 2026 21:06
Copilot AI balanced review requested due to automatic review settings October 15, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found no blocking issues in the mechanical relocations, helper linkage, or build registration; tests were not run.

0 open findings

What changed in this PR

Reorganizes the server library's tests by module, addressing #45 without changing production code.

Changes:

  • Moves existing suites into focused test files, preserving names and realtime labels.
  • Extracts shared raw-client helpers and the player test harness.
  • Updates CMake registration, private-access flags, and helper documentation.
File Description
tests/​test_transport.cpp Retains loopback and write-invariant tests.
tests/​test_transport_url.cpp Receives URL and socket-error tests.
tests/​test_source_feed.cpp Receives SourceFeed tests.
tests/​test_source_decoder.cpp Retains decoder tests.
tests/​test_server_roles.cpp Retains approval and role tests.
tests/​test_server_raw_client.cpp Receives disconnect and write-trace tests.
tests/​test_server_players.cpp Uses the extracted player harness.
tests/​test_server_groups.cpp Receives server group tests.
tests/​test_scheduled_updates.cpp Receives color scheduling tests.
tests/​test_sched_run_view.cpp Receives run-view tests.
tests/​test_sched_admission.cpp Retains admission tests.
tests/​test_group_internals.cpp Receives group lifecycle and stall tests.
tests/​test_colors.cpp Retains color calculation tests.
tests/​test_audio_workers_internals.cpp Retains worker shutdown tests.
tests/​raw_roles.h Houses shared raw-client role helpers.
tests/​players_rig.h Houses the player harness and assertions.
tests/​CMakeLists.txt Registers new files and private-access flags.
CLAUDE.md Documents the extracted helper headers.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kahrendt
kahrendt enabled auto-merge (squash) October 15, 2026 21:15
@kahrendt
kahrendt merged commit 83b821d into main Oct 15, 2026
14 checks passed
@kahrendt
kahrendt deleted the issue-45-split-tests branch October 15, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split the grab-bag test files and add test_group.cpp

2 participants