Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 13 / 0 / 13
Functions: 100.0% 4 / 0 / 4
Branches: 35.0% 7 / 0 / 20

OMCompiler/SimulationRuntime/cpp/Core/SimulationSettings/Factory.cpp
Line Branch Exec Source
1 /*
2 * This file belongs to the OpenModelica Run-Time System
3 *
4 * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), c/o Linköpings
5 * universitet, Department of Computer and Information Science, SE-58183 Linköping, Sweden. All rights
6 * reserved.
7 *
8 * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE
9 * AGPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. ANY
10 * USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S
11 * ACCEPTANCE OF THE BSD NEW LICENSE OR THE OSMC PUBLIC LICENSE OR THE AGPL
12 * VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
13 *
14 * The OpenModelica software and the OSMC (Open Source Modelica Consortium) Public License
15 * (OSMC-PL) are obtained from OSMC, either from the above address, from the URLs:
16 * http://www.openmodelica.org or https://github.com/OpenModelica/ or
17 * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica distribution. GNU
18 * AGPL version 3 is obtained from: https://www.gnu.org/licenses/licenses.html#GPL. The BSD NEW
19 * License is obtained from: http://www.opensource.org/licenses/BSD-3-Clause.
20 *
21 * This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY
23 * SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF
24 * OSMC-PL.
25 *
26 */
27
28 /** @addtogroup coreSimulationSettings
29 *
30 * @{
31 */
32
33 #include <Core/ModelicaDefine.h>
34 #include <Core/Modelica.h>
35
36 #include <Core/SimulationSettings/Factory.h>
37 #include <Core/SimulationSettings/GlobalSettings.h>
38
39 #define BOOST_NO_WCHAR
40
41 40 SettingsFactory::SettingsFactory(PATH libraries_path, PATH config_path, PATH modelicasystem_path)
42
3/9
✓ Branch 2 taken 40 times.
✓ Branch 4 taken 40 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 40 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
200 : SolverSettingsPolicy(libraries_path, modelicasystem_path, config_path)
43 {
44 40 }
45
46
1/2
✓ Branch 0 taken 40 times.
✗ Branch 1 not taken.
80 SettingsFactory::~SettingsFactory(void)
47 {
48 80 }
49
50 40 shared_ptr<IGlobalSettings> SettingsFactory::createSolverGlobalSettings()
51 {
52 80 _global_settings = shared_ptr<IGlobalSettings>(new GlobalSettings());
53 40 loadGlobalSettings(_global_settings);
54 40 return _global_settings;
55 }
56
57 40 shared_ptr<ISolverSettings> SettingsFactory::createSelectedSolverSettings()
58 {
59 40 string solver_name = _global_settings->getSelectedSolver();
60
3/9
✓ Branch 2 taken 40 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 40 times.
✓ Branch 6 taken 40 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
160 _solver_settings = createSolverSettings(solver_name,_global_settings);
61 40 return _solver_settings;
62 }
63 /** @} */ // end of coreSimulationSettings
64