Skip to content

tests: guard pk3 native library cache#214

Draft
cursor[bot] wants to merge 5 commits into
next-gen-5from
cursor/regression-test-coverage-438c
Draft

tests: guard pk3 native library cache#214
cursor[bot] wants to merge 5 commits into
next-gen-5from
cursor/regression-test-coverage-438c

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 16, 2026

Summary

  • Add test_pk3_native_library_cache script coverage for pk3-backed native module extraction/cache behavior in src/qcommon/files.c.
  • Register the script with CTest and document it in tests/README.md.

Risky behavior now covered

  • com_nativeLibraryExtractPk3 remains default-on, archived, described, and logged at filesystem startup.
  • Native libraries extracted from pk3s keep the basename-only vm/native_cache/ path under fs_homepath/fs_gamedir.
  • Direct, vm/, and modules/ pk3 probes stay in order, cache reuse remains gated by length + CRC, and FS_LoadLibrary checks the pk3 cache before loose filesystem paths.

Test files added/updated

  • Added tests/scripts/test_pk3_native_library_cache.sh.
  • Updated CMakeLists.txt to register test_pk3_native_library_cache.
  • Updated tests/README.md with the new script test.

Why this reduces regression risk

This path touches native code loading and writable cache files. The test protects extension filtering, cache path construction, fallback ordering, and CRC validation without requiring game data or executing platform native loaders.

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 

cursoragent and others added 5 commits May 16, 2026 10:05
Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
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