Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/test_setup.cpp
Show All 31 Lines | |||||
#if OS_WIN | #if OS_WIN | ||||
#include "lib/sysdep/os/win/wdbg_heap.h" | #include "lib/sysdep/os/win/wdbg_heap.h" | ||||
#endif | #endif | ||||
#include "lib/timer.h" | #include "lib/timer.h" | ||||
#include "lib/sysdep/sysdep.h" | #include "lib/sysdep/sysdep.h" | ||||
#include "ps/Profiler2.h" | #include "ps/Profiler2.h" | ||||
#include "scriptinterface/ScriptEngine.h" | #include "scriptinterface/ScriptEngine.h" | ||||
#include "scriptinterface/ScriptRuntime.h" | #include "scriptinterface/ScriptContext.h" | ||||
class LeakReporter : public CxxTest::GlobalFixture | class LeakReporter : public CxxTest::GlobalFixture | ||||
{ | { | ||||
virtual bool tearDownWorld() | virtual bool tearDownWorld() | ||||
{ | { | ||||
// Enable leak reporting on exit. | // Enable leak reporting on exit. | ||||
// (This is done in tearDownWorld so that it doesn't report 'leaks' | // (This is done in tearDownWorld so that it doesn't report 'leaks' | ||||
// if the program is aborted before finishing cleanly.) | // if the program is aborted before finishing cleanly.) | ||||
Show All 26 Lines | #if OS_MACOSX || OS_BSD | ||||
// See comment in GameSetup.cpp FixLocales | // See comment in GameSetup.cpp FixLocales | ||||
setlocale(LC_CTYPE, "UTF-8"); | setlocale(LC_CTYPE, "UTF-8"); | ||||
#endif | #endif | ||||
ThreadUtil::SetMainThread(); | ThreadUtil::SetMainThread(); | ||||
g_Profiler2.Initialise(); | g_Profiler2.Initialise(); | ||||
m_ScriptEngine = new ScriptEngine; | m_ScriptEngine = new ScriptEngine; | ||||
g_ScriptRuntime = ScriptRuntime::CreateRuntime(); | g_ScriptContext = ScriptContext::CreateContext(); | ||||
return true; | return true; | ||||
} | } | ||||
virtual bool tearDownWorld() | virtual bool tearDownWorld() | ||||
{ | { | ||||
g_ScriptRuntime.reset(); | g_ScriptContext.reset(); | ||||
SAFE_DELETE(m_ScriptEngine); | SAFE_DELETE(m_ScriptEngine); | ||||
g_Profiler2.Shutdown(); | g_Profiler2.Shutdown(); | ||||
return true; | return true; | ||||
} | } | ||||
private: | private: | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator