Merge pull request #6942 from aws-lumberyard-dev/Atom/guthadam/atom_tools_application_pyexit
Atom Tools: Bind exit function for python tests
This commit is contained in:
+1
@@ -111,6 +111,7 @@ namespace AtomToolsFramework
|
||||
virtual void ProcessCommandLine(const AZ::CommandLine& commandLine);
|
||||
|
||||
static void PyIdleWaitFrames(uint32_t frames);
|
||||
static void PyExit();
|
||||
|
||||
AzToolsFramework::TraceLogger m_traceLogger;
|
||||
|
||||
|
||||
@@ -130,10 +130,13 @@ namespace AtomToolsFramework
|
||||
->Attribute(AZ::Script::Attributes::Category, "Editor")
|
||||
->Attribute(AZ::Script::Attributes::Module, "atomtools.general");
|
||||
};
|
||||
// The reflection here is based on patterns in CryEditPythonHandler::Reflect
|
||||
|
||||
addGeneral(behaviorContext->Method(
|
||||
"idle_wait_frames", &AtomToolsApplication::PyIdleWaitFrames, nullptr,
|
||||
"Waits idling for a frames. Primarily used for auto-testing."));
|
||||
addGeneral(behaviorContext->Method(
|
||||
"exit", &AtomToolsApplication::PyExit, nullptr,
|
||||
"Exit application. Primarily used for auto-testing."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,4 +567,9 @@ namespace AtomToolsFramework
|
||||
Ticker ticker(&loop, frames);
|
||||
loop.exec();
|
||||
}
|
||||
|
||||
void AtomToolsApplication::PyExit()
|
||||
{
|
||||
AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::ExitMainLoop);
|
||||
}
|
||||
} // namespace AtomToolsFramework
|
||||
|
||||
Reference in New Issue
Block a user