Testing
Build and run the C++ harness, select cases and preserve packet layout contracts.
Run C++ tests
From the repository root:
CHUDCS2_BUILD_TESTS defaults to OFF. CMake builds unit_tests from the existing harness in tests/cpp/test_main.cpp when enabled. The registered cases run without CS2, a display or root access.
List registered cases without running them:
Run only configuration and packet bounds cases:
The harness covers distance calculations, ESP limits, packet bounds, flash alpha, hitbox parsing, BVH raycasts, color conversion, configuration, trigger math, proximity beeps, smoke wireframes, hit features, menu search, focus monitoring and offset scanning. AimAssist tests are registered when its implementation is present.
Add a regression case
Tests are opt-in. Add one for non-obvious pure logic, parsing, a data contract or a specific regression. Extend tests/cpp/test_main.cpp and register the case with add_test in CMakeLists.txt. State why the case is needed in the commit message.
Do not add tests that launch the overlay, need CS2, a display, root or network access, assert log strings, or compile source at runtime. Keep the existing C++ harness. Do not introduce a new framework or Python suite.
Packet alignment
Keep packed definitions and size assertions in src/overlay/game_reader.hpp synchronized with the C++ harness. See Packet layout.
The current tree has no Python E2E suite or shared-memory simulation fixtures. The test_shm_reader_bounds name refers to internal packet bounds.
Documentation checks
The documentation site has a separate Bun workflow. See Documentation development for checks and editor setup.
Was this page helpful?
Last updated on