Skip to content

tests: cover native VM module alias order#246

Draft
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/missing-test-coverage-2fd6
Draft

tests: cover native VM module alias order#246
cursor[bot] wants to merge 1 commit into
next-gen-5from
cursor/missing-test-coverage-2fd6

Conversation

@cursor

@cursor cursor Bot commented Jun 7, 2026

Copy link
Copy Markdown

Risky behavior now covered

  • Native VM logical alias probing now has deterministic unit coverage for qagame -> game -> server, game/server, cgame/client, ui/frontend, reverse aliases, case-insensitive recognition, output limits, and custom-module fallback behavior.

Test files added/updated

  • Updated tests/unit/test_vm_native_module.c with alias-order cases.
  • Updated CMakeLists.txt so unit_vm_native_module links the minimal qcommon stubs and production Q_stricmp implementation.
  • Updated tests/README.md to document the unit target.
  • Extracted VM_BuildNativeModuleLoadOrder() into src/qcommon/vm_native_module.c and wired loadNative() to consume it, so tests cover the production ordering table.

Why this reduces regression risk

  • Native module alias loading is a core compatibility path for full conversions and renamed native modules; a silent ordering/name regression can prevent game, cgame, or UI modules from loading and fall back unexpectedly.
  • The test is pure, deterministic, and independent of filesystem or dlopen behavior while still exercising the production alias helper used by loadNative().

Validation

  • cmake -S . -B build-coverage-tests -DBUILD_TESTING=ON -DBUILD_UNIT_TESTS=ON
  • cmake --build build-coverage-tests --target unit_vm_native_module
  • ctest --test-dir build-coverage-tests -R unit_vm_native_module --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