You've already forked godot
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user