Skip to content

tests: guard native module loading regressions#217

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

tests: guard native module loading regressions#217
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/regression-test-coverage-acba

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 17, 2026

Summary

  • Add a deterministic source-guard regression test for native VM module loading behavior.
  • Register test_native_module_regressions with CTest.

Risky behavior now covered

  • com_nativeLibraryExtractPk3 remains default-on, archived, documented, and logged at startup.
  • pk3-backed native libraries keep basename-only vm/native_cache/ extraction under fs_homepath/fs_game.
  • cached native libraries are reused only after length and CRC checks.
  • .so cache writes continue using direct Sys_FOpen/fwrite instead of FS_WriteFile, which rejects native library paths.
  • FS_LoadLibrary tries the pk3 cache before loose filesystem paths.
  • native VM_Call zero-fills missing vmMain argument slots before invoking DLL entrypoints.

Test files added/updated

  • Added tests/scripts/test_native_module_regressions.sh
  • Updated CMakeLists.txt

Why this reduces regression risk

These checks cover recent production-only changes in native module extraction and VM argument passing, both of which affect startup/loading paths for pk3-delivered native modules and can fail only on specific packaging or low-argument native entry calls.

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