Non-PHOLD testing infrastructure - #206
Merged
caitlinross merged 6 commits intoJun 15, 2026
Merged
Conversation
Replaces the unconditional ENABLE_TESTING() / include(CTest) block with a project-scoped knob that defaults ON at top level (honoring an explicit BUILD_TESTING=OFF) and OFF when ROSS is consumed via add_subdirectory()/FetchContent. ROSS_TEST_SCHEDULERS and ROSS_TEST_INSTRUMENTATION early-return when the knob is OFF, so a parent superbuild's ambient enable_testing() scope can't pull phold's add_test() calls in by accident.
Stand up the tests/ directory and bring in the first non-phold test. The driver itself is the smallest useful ROSS program: tw_init, register one no-op LP via the shared tests/helpers/test_lp_minimal table, tw_run with zero events, tw_end. Exit code is the pass signal; no assertion helper yet, deferred until a driver needs one. Registered under --synch=1/4/6 so the RollbackCheck path runs on every driver by construction. Multi-rank variants land later.
Plain assert(cond && "msg") tells you the file:line and the verbatim
expression but never the runtime values, so a ctest failure log forces
a rerun under gdb to see which delivery went wrong or how many events
were lost. The new macro takes a printf-style format so the dynamic
context lands in the log on the first run, e.g.
[ROSS_TEST] FAIL splay_order_test.c:73 (s->delivery_count == (int) N_EVENTS): delivered 17 events, expected 20
The captured #expr keeps the source-level condition visible alongside
the message so they stay in sync.
Aborts via MPI_Abort(MPI_COMM_WORLD, 1) rather than abort() so any
multi-rank test failure doesn't strand non-faulting ranks until ctest's
timeout fires. Safe any time after tw_init -- tw_init brings MPI_Init
up first thing. fflush(stderr) before abort because ctest block-buffers
the redirected stderr and an aborting process doesn't flush on the way
out.
caitlinross
force-pushed
the
cmake-initial-test-refresh
branch
from
June 15, 2026 21:36
690e65c to
9c987d4
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #206 +/- ##
==========================================
+ Coverage 47.86% 48.75% +0.89%
==========================================
Files 37 41 +4
Lines 4745 4816 +71
Branches 857 860 +3
==========================================
+ Hits 2271 2348 +77
+ Misses 2469 2463 -6
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stands up a
tests/directory for subsystem driver tests so regressions incore pieces (rand, queue, lifecycle) surface without depending on phold.
Mostly scaffolding, plus three small drivers
to demonstrate. We can continue to add more tests in the future to better test out
various parts of ROSS.
Scaffolding
ROSS_BUILD_TESTINGgatesinclude(CTest)andadd_subdirectory(tests);defaults on at top level, off under
add_subdirectory/FetchContent.PHOLD binaries still build with
-DROSS_BUILD_TESTING=OFF, just withouttest registration.
tests/CMakeLists.txtexposesROSS_DRIVER_TEST(name [SCHEDULERS ...]),which registers one ctest entry per single-rank scheduler. Drivers with
event-handler side effects that don't survive replay can opt down to
SCHEDULERS Sequential.tests/helpers/test_lp_minimal.{c,h}-- shared no-op LP type for driversthat don't need custom handlers.
tests/helpers/test_assert.h--ROSS_TEST_ASSERT(expr, fmt, ...)macrowith printf-style value interpolation and
MPI_Abortso the nextmulti-rank driver lands without rework.
Drivers
lifecycle_test-- engine boot/teardown with zero events; smallest ROSSprogram possible. Mostly validates the scaffolding itself.
rand_reverse_test-- rand-clcg4 round-trip symmetry (forward draws +matching
tw_rand_reverse_unifrestoreCgandcount), plusper-distribution cost checks for
tw_rand_integer/_exponential/_ulong.splay_order_test-- splay priority queue delivers a mix of distinct +tied timestamps in monotonically non-decreasing
recv_ts.Checklist
-Walland-WextraDocumentation/dev/, unless the change is invisible to anyone outside the PR (test refactors, internal renames, comment-only tweaks)