summaryrefslogtreecommitdiffstats
path: root/tests/test_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_utils.cpp')
-rw-r--r--tests/test_utils.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_utils.cpp b/tests/test_utils.cpp
index cbd6d1ffbb..9d41e74020 100644
--- a/tests/test_utils.cpp
+++ b/tests/test_utils.cpp
@@ -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);
+}