mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #1600] tests: derive every test's scratch folder from test_temp_dir::temp_dir, not GetTempPath (TEST-TEMPDIR-STRIPPED-ENV) #1616
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#1616
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/1600
Author: @thiefyzheng
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/test-tempdir-stripped-env📝 Commits (1)
03d00aetests: derive every test's scratch folder from test_temp_dir::temp_dir, not GetTempPath (TEST-TEMPDIR-STRIPPED-ENV)📊 Changes
48 files changed (+142 additions, -70 deletions)
View changed files
📝
runtime/src/pe_loader.cpp(+9 -0)📝
runtime/test/bink_audio_test.cpp(+2 -1)📝
runtime/test/bink_decode_test.cpp(+2 -1)📝
runtime/test/d3d12_bindless_churn_test.cpp(+2 -1)📝
runtime/test/d3d12_conservative_raster_test.cpp(+2 -1)📝
runtime/test/d3d12_conservative_tier2_test.cpp(+2 -1)📝
runtime/test/d3d12_conservative_tier3_test.cpp(+2 -1)📝
runtime/test/d3d12_depth24_draw_test.cpp(+2 -1)📝
runtime/test/d3d12_depth_resolve_test.cpp(+2 -1)📝
runtime/test/d3d12_execute_indirect_validation_test.cpp(+2 -1)📝
runtime/test/d3d12_existing_heap_test.cpp(+4 -3)📝
runtime/test/d3d12_f16_halves_test.cpp(+2 -1)📝
runtime/test/d3d12_geometry_test.cpp(+2 -1)📝
runtime/test/d3d12_indirect_dispatch_count_test.cpp(+2 -1)📝
runtime/test/d3d12_mesh_test.cpp(+2 -1)📝
runtime/test/d3d12_multi_viewport_test.cpp(+2 -1)📝
runtime/test/d3d12_present_test.cpp(+2 -1)📝
runtime/test/d3d12_queue_handover_test.cpp(+9 -2)📝
runtime/test/d3d12_shader_cache_test.cpp(+2 -1)📝
runtime/test/d3d12_state_sweep_test.cpp(+2 -1)...and 28 more files
📄 Description
What
One entry added to
runtime/test/test_temp_dir.h—testfiles::temp_dir():LEONIDA_TEST_DIRwhen set, else the current directory when the temp environment is stripped (TMP, TEMP and USERPROFILE all unset on Windows), else the standard temp resolution. 45 test files and thetiny_gamefixture that calledGetTempPathA/GetTempPathW/temp_directory_pathdirectly now use it, andd3d12_queue_handover_test.cpp'scapture_stderrchecks its_sopen_sresult instead of silently returning empty stderr. One runtime source function needed the same fallback because tests exercise it:tls_host_clone_dirinruntime/src/pe_loader.cpp(theloader_tls*tests) — the only non-test change in this PR, called out deliberately.Claimed as TEST-TEMPDIR-STRIPPED-ENV on #14 (the finding is @whoalin1's, 02:37:44Z).
Why
With TMP/TEMP/USERPROFILE unset,
GetTempPathWreturnsC:\Windows\, and the throwingcreate_directories/copy_file/ofstreamonC:\Windows\leonida_*aborts with 0xc0000409 before the test body runs — the ~20d3d12_*sites of the finding plus the further direct users found by enumerating ("d3d12_mesh/bindless_churn/conservative_raster(+tier2/tier3)/depth24_draw/depth_resolve/execute_indirect_validation/f16_halves/geometry/indirect_dispatch_count/multi_viewport/shader_cache/state_sweep/stores_atomics/present/queue_handover/existing_heap + bink_audio/bink_decode/device_proxy/dstorage/file_system/int3_skip/kernel_writes/large_module_gate_loader(4)/module_names/pe_loader(fuzz/test/bounds)/pipeline_cache(file/seed)/shader_fixture_path/startup_trace/title_write_watch/unimplemented_policy/xbox_present/xdxr_build_output/xgameruntime(gamesave/test/user)/xmem + fixtures/tiny_game"). The helper used by 15 test files already existed; this PR is the mechanical consolidation the finding asked for.What I ran (Windows 11 VM, VS build of every affected target, current main lineage)
file_system_testruns all 505 checks, 0 failures;loader_testall 95 checks, 0 failed;xgameruntime_testexit 0. No 0xc0000409 anywhere in any run.C:\work\tdirunder a fully stripped environment, the process'sleonida_file_system_<pid>scratch folder was captured mid-run inside it and cleaned up after the 505-check pass.Notes for the reviewer
d3d12_mesh_test.cpp): the mesh test was merged by 3-way and keeps both changes.scripts/check_no_game_data.pyclean; synthetic fixtures only; no game data.AI-assisted: a pi coding agent operated by the repo contributor ran the enumeration, the Windows build and the three verification phases; the finding is @whoalin1's.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.