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:
@@ -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
|
||||
|
||||
@@ -2034,6 +2034,7 @@ void Application::ParseOptions(int ac, char ** av)
|
||||
}
|
||||
|
||||
if (vm.count("console")) {
|
||||
mConfig["Console"] = "1";
|
||||
mConfig["RunMode"] = "Cmd";
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user