|
@@ -30,6 +30,8 @@
|
|
|
|
|
|
#include "test_main.h"
|
|
|
|
|
|
+#include "core/error/error_macros.h"
|
|
|
+#include "core/io/dir_access.h"
|
|
|
#include "modules/modules_enabled.gen.h"
|
|
|
|
|
|
#ifdef TOOLS_ENABLED
|
|
@@ -232,6 +234,15 @@ 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<DirAccess> da;
|
|
|
+ if (DirAccess::exists(test_path)) {
|
|
|
+ da = DirAccess::open(test_path);
|
|
|
+ ERR_FAIL_COND_V(da.is_null(), 0);
|
|
|
+ ERR_FAIL_COND_V_MSG(da->erase_contents_recursive() != OK, 0, "Failed to delete files");
|
|
|
+ }
|
|
|
+
|
|
|
// Run custom test tools.
|
|
|
if (test_commands) {
|
|
|
for (const KeyValue<String, TestFunc> &E : (*test_commands)) {
|