Skip to content

Add native module regression coverage#224

Draft
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/regression-test-coverage-3155
Draft

Add native module regression coverage#224
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/regression-test-coverage-3155

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 25, 2026

Risky behavior now covered

  • Native VM_Call must zero-fill missing vmMain arguments before invoking native entry points, preventing nargs=0 calls from passing stack garbage.
  • Pk3-backed native module extraction must keep its archived/default-on toggle, basename-only cache path, direct/vm/modules fallback order, CRC-checked cache reuse, direct Sys_FOpen/fwrite cache writes, and cache-before-loose FS_LoadLibrary ordering.

Test files added/updated

  • Added tests/scripts/test_native_module_regressions.sh.
  • Registered test_native_module_regressions in CMakeLists.txt.
  • Documented the script in tests/README.md.

Why this reduces regression risk

These guards cover recent native module fixes with crash/security/loading blast radius, without requiring game data, a display server, or a GPU. They make the intended invariants explicit in CTest so future edits to VM calls or pk3 native library extraction fail deterministically.

Validation

  • tests/scripts/test_native_module_regressions.sh
  • cmake -S . -B build-coverage-tests -DBUILD_TESTING=ON -DBUILD_UNIT_TESTS=OFF && ctest --test-dir build-coverage-tests -R test_native_module_regressions --output-on-failure
Open in Web View Automation 

Co-authored-by: Tim Fox <timfox@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant