mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1579] tests: resolve a writable temp dir instead of crashing on C:\Windows #1599
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1599
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1579
Author: @whoalin1
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:test-tempdir-robust📝 Commits (1)
f4a9068tests: resolve a writable temp dir instead of crashing on C:\Windows📊 Changes
48 files changed (+375 additions, -81 deletions)
View changed files
📝
runtime/CMakeLists.txt(+12 -1)📝
runtime/shims/d3d12_vulkan_device.cpp(+12 -2)📝
runtime/test/bink_audio_test.cpp(+2 -1)📝
runtime/test/bink_decode_test.cpp(+2 -1)📝
runtime/test/d3d12_bindless_churn_test.cpp(+7 -3)📝
runtime/test/d3d12_conservative_raster_test.cpp(+6 -2)📝
runtime/test/d3d12_conservative_tier2_test.cpp(+3 -2)📝
runtime/test/d3d12_conservative_tier3_test.cpp(+3 -2)📝
runtime/test/d3d12_depth24_draw_test.cpp(+6 -2)📝
runtime/test/d3d12_depth_resolve_test.cpp(+7 -2)📝
runtime/test/d3d12_execute_indirect_validation_test.cpp(+7 -3)📝
runtime/test/d3d12_existing_heap_test.cpp(+1 -0)📝
runtime/test/d3d12_f16_halves_test.cpp(+7 -2)📝
runtime/test/d3d12_geometry_test.cpp(+6 -2)📝
runtime/test/d3d12_indirect_dispatch_count_test.cpp(+7 -3)📝
runtime/test/d3d12_mesh_test.cpp(+6 -2)📝
runtime/test/d3d12_multi_viewport_test.cpp(+7 -3)📝
runtime/test/d3d12_present_test.cpp(+1 -0)📝
runtime/test/d3d12_queue_handover_test.cpp(+20 -7)📝
runtime/test/d3d12_shader_cache_test.cpp(+6 -1)...and 28 more files
📄 Description
Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7152024965
What
With
TMP/TEMP/USERPROFILEunset,GetTempPathWreturnsC:\Windows, which is not writable. Dozens of test binaries then die with0xc0000409(uncaughtstd::filesystemexception) instead of running or skipping — reproduced onmainasctest -R d3d12_mesh→ exit0xc0000409.runtime/test/test_temp_dir.hgains a writable-dir probe chain (LEONIDA_TEST_DIR→temp_directory_path→current_path, each proven by an actual create/write/delete) andensure_temp_env(), a pre-maininitializer that repairsTMP/TEMP/TMPDIRwhen the effective temp dir is not writable — which also fixes the loader's ownGetTempPathWclone dir, unreachable from test code.scratch_dir()/process_temp_dir()now resolve through it, covering everyScratchDiruser (~17 suites), and the ~15 sites that threw directly (create_directories,copy_file,ofstream,_sopen_scapture) getempty → SKIP(77)/loud-failure guards.d3d12_queue_handover_test's stderr capture no longer reads an empty file as "layer was silent".runtime/shims/d3d12_vulkan_device.cppdefault_shader_cache_dir()probes the temp-based dir and falls back tocwd/leonida_shader_cache— without itd3d12_shader_cachereached its disk section and returnedE_FAILunder a stripped env. Writable-temp behavior is byte-identical to before.runtime/CMakeLists.txt: the 14 ctest entries that executegta6rt/loader guests which the test exes' header cannot reach getENVIRONMENT "TMP=${CMAKE_CURRENT_BINARY_DIR};TEMP=${CMAKE_CURRENT_BINARY_DIR}"— verified failing before (run_tiny_*"home clone of gta6rt_tls_host.dll cannot be loaded",run_startup_cmdlineTLS index) and passing after, with the env stripped. The other gta6rt entries were run under the same stripped env and pass untouched (their guests never touch temp).Verification (native Windows 11, env stripped of TMP/TEMP/USERPROFILE/ TMPDIR — the failure environment itself)
0xc0000409.run_tiny_*+run_startup_cmdlinectest entries pass (were all failing).LEONIDA_VK_VALIDATIONnot needed (test-harness-only change plus a fallback path).Independent review: APPROVE after one fix round (the gta6rt ctest gap above was the reviewer's catch; verified and fixed).
AI-assisted (Devin).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.