File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 3030
3131#include " test_main.h"
3232
33+ #include " core/error/error_macros.h"
34+ #include " core/io/dir_access.h"
3335#include " modules/modules_enabled.gen.h"
3436
3537#ifdef TOOLS_ENABLED
@@ -232,6 +234,15 @@ int test_main(int argc, char *argv[]) {
232234
233235 WorkerThreadPool::get_singleton ()->init ();
234236
237+ String test_path = OS::get_singleton ()->get_cache_path ().path_join (" godot_test" );
238+
239+ Ref<DirAccess> da;
240+ if (DirAccess::exists (test_path)) {
241+ da = DirAccess::open (test_path);
242+ ERR_FAIL_COND_V (da.is_null (), 0 );
243+ ERR_FAIL_COND_V_MSG (da->erase_contents_recursive () != OK, 0 , " Failed to delete files" );
244+ }
245+
235246 // Run custom test tools.
236247 if (test_commands) {
237248 for (const KeyValue<String, TestFunc> &E : (*test_commands)) {
You can’t perform that action at this time.
0 commit comments