diff --git a/.travis.yml b/.travis.yml index fdb6b76dac..8929a4c4cc 100755 --- a/.travis.yml +++ b/.travis.yml @@ -236,7 +236,7 @@ script: # Install FreeCAD and run unit tests. Test failures will fail the build ## - sudo make -j2 install - - ${INSTALLED_APP_PATH} --run-test 0 + - ${INSTALLED_APP_PATH} --console --run-test 0 - ${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log & - sleep 10 && pkill FreeCAD - cat /tmp/FreeCAD_installed.log diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 3f37233e6c..81b16ae1f0 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -2034,6 +2034,7 @@ void Application::ParseOptions(int ac, char ** av) } if (vm.count("console")) { + mConfig["Console"] = "1"; mConfig["RunMode"] = "Cmd"; } diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index 37b7f24b97..aeabd66c71 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -149,6 +149,7 @@ int main( int argc, char ** argv ) // Init phase =========================================================== // sets the default run mode for FC, starts with gui if not overridden in InitConfig... App::Application::Config()["RunMode"] = "Gui"; + App::Application::Config()["Console"] = "0"; // Inits the Application #if defined (FC_OS_WIN32) @@ -242,6 +243,9 @@ int main( int argc, char ** argv ) std::streambuf* oldcerr = std::cerr.rdbuf(&stdcerr); try { + // if console option is set then run in cmd mode + if (App::Application::Config()["Console"] == "1") + App::Application::runApplication(); if (App::Application::Config()["RunMode"] == "Gui" || App::Application::Config()["RunMode"] == "Internal") Gui::Application::runApplication();