fixes #0002959: GUI tests aren't run when tests are started via command line

This commit is contained in:
wmayer
2017-10-09 19:17:31 +02:00
parent 4bc216371a
commit ca9f583ff0
2 changed files with 8 additions and 1 deletions

View File

@@ -1011,6 +1011,12 @@ void MainWindow::processMessages(const QList<QByteArray> & msg)
void MainWindow::delayedStartup()
{
// automatically run unit tests in Gui
if (App::Application::Config()["RunMode"] == "Internal") {
Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADTest"));
return;
}
// processing all command line files
try {
std::list<std::string> files = App::Application::getCmdLineFiles();

View File

@@ -242,7 +242,8 @@ int main( int argc, char ** argv )
std::streambuf* oldcerr = std::cerr.rdbuf(&stdcerr);
try {
if (App::Application::Config()["RunMode"] == "Gui")
if (App::Application::Config()["RunMode"] == "Gui" ||
App::Application::Config()["RunMode"] == "Internal")
Gui::Application::runApplication();
else
App::Application::runApplication();