Skip to content

Add pk3 native library cache regression coverage#219

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

Add pk3 native library cache regression coverage#219
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/regression-test-coverage-3aec

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 18, 2026

Summary

  • Adds test_pk3_native_library_cache to guard pk3-backed native module extraction/cache invariants in src/qcommon/files.c.
  • Registers the script with CTest and updates tests/README.md.

Risky behavior now covered

  • com_nativeLibraryExtractPk3 remains archived, default-on, described, and logged at startup.
  • pk3 native-module loading remains gated by the kill-switch, filters .so/.dll inputs, caches by basename under vm/native_cache/, probes direct/vm//modules/ pk3 paths in order, rejects implicit fallbacks for explicit paths, and loads cached files only after size and CRC checks.
  • FS_LoadLibrary continues trying the pk3 cache before loose filesystem paths.

Test files added/updated

  • Added tests/scripts/test_pk3_native_library_cache.sh
  • Updated CMakeLists.txt
  • Updated tests/README.md

Why this reduces regression risk

This path has filesystem side effects, native loader behavior, CRC reuse checks, and mod-loading compatibility impact. The source-guard test is deterministic and headless-friendly while pinning the invariants most likely to regress during future loader or filesystem edits.

Validation

  • tests/scripts/test_pk3_native_library_cache.sh
  • cmake -S . -B build-coverage-tests -DBUILD_TESTING=ON -DBUILD_UNIT_TESTS=OFF && ctest --test-dir build-coverage-tests -R test_pk3_native_library_cache --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