From e7d31635ddcb7894def3c3e45f21494c3f008c29 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 23 May 2025 15:29:10 +0200 Subject: [PATCH] Don't hard-code test path when deleting test data --- tests/test_main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_main.cpp b/tests/test_main.cpp index f167f0b3fc..44d36a00ef 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -234,11 +234,9 @@ int test_main(int argc, char *argv[]) { WorkerThreadPool::get_singleton()->init(); - String test_path = OS::get_singleton()->get_cache_path().path_join("godot_test"); - - Ref da; - if (DirAccess::exists(test_path)) { - da = DirAccess::open(test_path); + { + const String test_path = TestUtils::get_temp_path(""); + Ref da = DirAccess::open(test_path); // get_temp_path() automatically creates the folder. ERR_FAIL_COND_V(da.is_null(), 0); ERR_FAIL_COND_V_MSG(da->erase_contents_recursive() != OK, 0, "Failed to delete files"); }