allow to set console and unit test option without overriding each other

start unit tests in command line mode because the python pivy package is missing
This commit is contained in:
wmayer
2017-10-10 20:40:09 +02:00
parent f50a19df2f
commit 0b7ce87340
3 changed files with 6 additions and 1 deletions

View File

@@ -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

View File

@@ -2034,6 +2034,7 @@ void Application::ParseOptions(int ac, char ** av)
}
if (vm.count("console")) {
mConfig["Console"] = "1";
mConfig["RunMode"] = "Cmd";
}

View File

@@ -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();