1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Use subfolder for temporary test files

This commit is contained in:
kobewi
2024-06-05 20:27:21 +02:00
parent 96a386f3c4
commit 5514b2c70c
8 changed files with 27 additions and 19 deletions

View File

@@ -30,6 +30,7 @@
#include "tests/test_utils.h"
#include "core/io/dir_access.h"
#include "core/os/os.h"
String TestUtils::get_data_path(const String &p_file) {
@@ -40,3 +41,9 @@ String TestUtils::get_data_path(const String &p_file) {
String TestUtils::get_executable_dir() {
return OS::get_singleton()->get_executable_path().get_base_dir();
}
String TestUtils::get_temp_path(const String &p_suffix) {
const String temp_base = OS::get_singleton()->get_cache_path().path_join("godot_test");
DirAccess::make_dir_absolute(temp_base); // Ensure the directory exists.
return temp_base.path_join(p_suffix);
}