TestCenter Reference
Config.py
Go to the documentation of this file.
1 #@PydevCodeAnalysisIgnore
2 # Already ported to Python 3
3 from __future__ import print_function
4 
5 # **InsertLicense** code author="Gereon A. Frey"
6 
8 
9 
10 # -- local imports
11 try:
12  import mevis
13  mevisAvailable = hasattr(mevis, 'MLAB') and hasattr(mevis.MLAB, 'isDebug') and mevis.MLAB.isDebug() is not None
14 except ImportError:
15  mevisAvailable = False
16 
17 from . import Utils
18 from .Utils import deprecated
19 
20 # -- system imports
21 import os
22 import sys
23 import tempfile
24 
25 import xml.etree.cElementTree as etree
26 
27 if sys.version_info.major >= 3:
28  unicode = str
29 
30 def getConfigFilePath (isTestCaseManager=False):
31  if Utils.isMac:
32  if mevisAvailable:
33  path = os.path.join( mevis.MLABFileManager.getUserApplicationSupportDirectory(), 'Settings' )
34 
35  else:
36  path = os.path.join( os.environ['HOME'], 'Library', 'Application Support', 'MeVisLab', 'Settings' )
37 
38  elif Utils.isWindows:
39  path = os.path.join( os.environ[ 'LOCALAPPDATA' ], 'MeVis', 'MeVisLab' )
40 
41  elif Utils.isLinux:
42  if mevisAvailable:
43  path = mevis.MLABFileManager.getUserApplicationSupportDirectory()
44 
45  else:
46  path = os.path.join( os.environ['HOME'], '.local', 'share', 'MeVis', 'MeVisLab' )
47 
48  else:
49  path = os.getcwd()
50 
51  if ( not os.path.isdir( path )):
52  os.makedirs( path )
53 
54  filePattern = "test_case_manager_cfg_{}.xml" if isTestCaseManager else "tc_cfg_{}.xml"
55  return os.path.join( path, filePattern.format( sys.platform ))
56 
57 
58 def verifyConfiguration (cfgFile):
59  if not os.path.isfile(cfgFile):
60  Configuration(cfgFile)
61  return False
62  return True
63 
64 
66  pass
67 
68 
69 class ReportConfig(object):
70  def getReportDir(): # @NoSelf
71  reportDir = ""
72  if Utils.isWindows:
73  reportDir = os.path.join(os.getenv("USERPROFILE"), "TestCenterReports")
74  elif Utils.isMac:
75  if mevisAvailable:
76  reportDir = os.path.join(mevis.MLABFileManager.getUserApplicationSupportDirectory(), "TestCenterReports")
77  else:
78  reportDir = os.path.join(os.environ['HOME'], 'Library', 'Application Support', 'MeVisLab', 'TestCenterReports')
79  elif Utils.isLinux:
80  reportDir = os.path.join(os.getenv("HOME"), "TestCenterReports")
81 
82  return reportDir
83 
84 
85  def __init__(self,
86  directory = getReportDir(),
87  name = "Report",
88  timestampTemplate = "_%y_%m_%d__%H_%M",
89  appendTestCaseName = False,
90  appendTimestamp = False,
91  collapseFunctions = False,
92  showFailedFuctionsOnly = False,
93  hideInfoMessages = False,
94  hideSystemMessages = False):
95  self.directory = directory
96  self.name = name
97  self.timestampTemplate = timestampTemplate
98  self.appendTestCaseName = appendTestCaseName
99  self.appendTimestamp = appendTimestamp
100  self.collapseFunctions = collapseFunctions
101  self.showFailedFunctionsOnly = showFailedFuctionsOnly
102  self.hideInfoMessages = hideInfoMessages
103  self.hideSystemMessages = hideSystemMessages
106 
107 class Configuration (object):
108  def __init__ (self, filePath=None, autoSave=True, isTestCaseManager=False):
109  """ Loads configuration from given file or creates configuration with default values.
110  If a configuration is created and @a autoSave is True then the configuration is
111  automatically saved. Otherwise, you have to save is explicitly.
112  """
113  self.__setDefaultValues()
114 
115  # The default config file name is tc_cfg_<platform>.xml which can be
116  # overwritten by explicitly specifying a filePath.
117  if not filePath:
118  filePath = getConfigFilePath(isTestCaseManager=isTestCaseManager)
119 
120  cfgFileToLoad = filePath
121  if not os.path.isfile(cfgFileToLoad):
122  # for backward compatibility: read settings from config file of automated test center
123  cfgFileToLoad = getConfigFilePath(isTestCaseManager=False)
124 
125  if os.path.isfile(cfgFileToLoad):
126  self.__load(cfgFileToLoad)
127 
128  if autoSave and not os.path.isfile(filePath):
129  if mevisAvailable:
130  warningTemplate = "Config file <a href='mlab-open:{filePath}'>{fileName}</a> does not exist: creating it."
131  mevis.MLAB.logHTML(warningTemplate.format(filePath=filePath,
132  fileName=os.path.basename(filePath)))
133  else:
134  print("Config file %s does not exist: creating it." % (filePath))
135  self.save(filePath)
136 
137  self.__configFilePath = os.path.abspath(filePath)
138 
139 
142  def __setDefaultValues (self):
143  def getArguments():
144  arguments = ["-nosplash", "-noide", "-quick"]
145 
146  if Utils.isMac:
147  arguments.append("-unique")
148 
149  return arguments
150 
151  def getMLABBinariesPath():
152  executablePath = ""
153  if mevisAvailable:
154  if Utils.isWindows:
155  executablePath = os.path.dirname(mevis.MLABFileManager.getExecutable("MeVisLab"))
156  elif Utils.isMac:
157  executablePath = mevis.MLABFileManager.macGetBundleDir()
158  elif Utils.isLinux:
159  executablePath = os.path.dirname(mevis.MLABFileManager.getExecutable("MeVisLab"))
160  else:
161  # check public sdk location relative to this file
162  thisDir = os.path.dirname(os.path.abspath(__file__))
163  thisMLABRoot = os.path.join(thisDir, '..', '..', '..', '..', '..', '..')
164  if Utils.isWindows:
165  path = os.path.abspath(os.path.join(thisMLABRoot, 'MeVisLab', 'IDE', 'bin'))
166  if os.path.isfile(os.path.join(path, 'MeVisLab.exe')):
167  executablePath = path
168  elif Utils.isMac:
169  # MLAB_ROOT is MeVisLab.app/Contents/Packages
170  path = os.path.abspath(os.path.join(thisMLABRoot, '..', '..'))
171  if os.path.isdir(os.path.join(path, 'Contents')):
172  executablePath = path
173  else:
174  path = os.path.join(os.environ['HOME'], 'Applications', 'MeVisLab.app')
175  if os.path.isdir(path):
176  executablePath = path
177  elif Utils.isLinux:
178  path = os.path.abspath(os.path.join(thisMLABRoot, '..', 'bin'))
179  if os.path.isfile(os.path.join(path, 'MeVisLab')):
180  executablePath = path
181 
182  return executablePath
183 
184 
185  if Utils.isUnsupportedPlatform:
186  raise Exception("Unsupported platform (%s)" % (sys.platform))
187 
189  self.__MLABArguments = getArguments()
190  self.__MLABCompileMode = "Automatic"
191  self.__resultOutputDirectory = os.path.join(tempfile.gettempdir(), "TestCenter")
192  self.__xmlResultFileName = "tc_result.xml"
193  self.__MLABSlaveLogFileName = "mevislab_slave.log"
195  # Number of TestCases after which MLAB is restarted during the execution of multiple
196  # tests. If this is set to zero, MLAB is not restarted at all.
197  self.__mMLABRestartInterval = 1
198  # If a test is configured with a timeout above this value, do not execute it and let it fail.
199  self.__maxTestTimeoutSeconds = 0
200 
202 
203  self.__usePythonCoverage = False
204  # Controls if the python coverage measured during the execution of tests is accumulated
205  # into one report (True) or if for every test a separate report is generated (False).
206  self.__useGlobalPythonCoverage = False
207  # All files matching one of these expressions
208  # are excluded from the coverage for that test run.
209  exclusionExpressions = ["*/TestSupport/*",
210  "*/TestCenterAdvanced/*",
211  "*/MLABPythonTools/*",
212  "*/*.script*",
213  "*/*.def*",
214  "*/IDE/mevislabInternal.py",
215  "*/__mevislabBootstrap.py",
216  "*/Standard/Modules/Scripts/python/PackageSorter.py",
217  "*/BuildTools/Scripts/MeVisPython.py",
218  "*\@@scriptconsole*"]
219 
220  #convert to native path format
222  os.path.normpath(expression) for expression in exclusionExpressions
223  ]
224 
225  # C++ coverage tool
226  self.__useBullseyeCoverage = False
227 
228  self.__ipcConnectionTimeout = 2
229 
230  self.__report = ReportConfig()
231 
232 
233 
236  def __load (self, filename):
237  if not os.path.isfile(filename):
238  raise Exception("Given file does not exist: %s" % (filename))
239 
240  xmlTree = etree.parse(filename)
241  xmlRoot = xmlTree.getroot()
242 
243  self.fetchMLABSettings(xmlRoot)
244  self.fetchReportSettings(xmlRoot)
245  self.fetchCoverageSettings(xmlRoot)
246  self.fetchTestCaseManagerSettings(xmlRoot)
247  self.fetchIPCSettings(xmlRoot)
248 
249 
250  @staticmethod
251  def nodeHasValidText(node):
252  return node is not None and node.text is not None
253 
254 
255  def fetchMLABSettings(self, xmlRoot):
256  node = xmlRoot.find("mlab/executable")
257  if self.nodeHasValidText(node):
258  self.__MLABExecutablePath = node.text
259 
260  if node is not None:
261  mode = node.get("compilemode")
262  if mode:
263  self.__MLABCompileMode = mode
264  elif node.get("usedebug") == "True":
265  self.__MLABCompileMode = "Debug"
266  else:
267  self.__MLABCompileMode = "Automatic"
268 
269  node = xmlRoot.find("mlab/arguments")
270  if self.nodeHasValidText(node):
271  self.__MLABArguments = node.text.split(",")
272 
273  node = xmlRoot.find("mlab/resultdir")
274  if self.nodeHasValidText(node):
275  self.__resultOutputDirectory = node.text
276 
277  node = xmlRoot.find("mlab/resultfile")
278  if self.nodeHasValidText(node):
279  self.__xmlResultFileName = node.text
280 
281  node = xmlRoot.find("mlab/slavelogfile")
282  if self.nodeHasValidText(node):
283  self.__MLABSlaveLogFileName = node.text
284 
285  node = xmlRoot.find("mlab/timeout")
286  if self.nodeHasValidText(node):
287  self.__defaultTestTimeoutSeconds = int(node.text)
288 
289  node = xmlRoot.find("mlab/restartinterval")
290  if self.nodeHasValidText(node):
291  self.__mMLABRestartInterval = int(node.text)
292 
293  node = xmlRoot.find("mlab/MaximumTestTimeout")
294  if self.nodeHasValidText(node):
295  self.__maxTestTimeoutSeconds = int(node.text)
296 
297 
298  def fetchReportSettings(self, xmlRoot):
299  self.fetchReportNodeSettings(xmlRoot)
300 
301  node = xmlRoot.find("report/directory")
302  if self.nodeHasValidText(node):
303  self.__report.directory = node.text
304 
305  node = xmlRoot.find("report/name")
306  if self.nodeHasValidText(node):
307  self.__report.name = node.text
308 
309  node = xmlRoot.find("report/timestamp")
310  if self.nodeHasValidText(node):
311  self.__report.timestampTemplate = node.text
312 
313 
314  def fetchReportNodeSettings(self, xmlRoot):
315  reportNode = xmlRoot.find("report")
316  if not reportNode is None:
317  self.__report.appendTestCaseName = self.getBoolean(reportNode,
318  self.__report.appendTestCaseName,
319  "appendTestCaseName")
320  self.__report.appendTimestamp = self.getBoolean(reportNode,
321  self.__report.appendTimestamp,
322  "appendTimestamp")
323  self.__report.collapseFunctions = self.getBoolean(reportNode,
324  self.__report.collapseFunctions,
325  "collapseFunctions")
326  self.__report.showFailedFunctionsOnly = self.getBoolean(reportNode,
327  self.__report.showFailedFunctionsOnly,
328  "showFailedOnly")
329  self.__report.hideInfoMessages = self.getBoolean(reportNode,
330  self.__report.hideInfoMessages,
331  "hideInfos")
332  self.__report.hideSystemMessages = self.getBoolean(reportNode,
333  self.__report.hideSystemMessages,
334  "hideSystemMessages")
335  self.__report.maxInfoMessagesPerTestFunction = self.getInteger(reportNode,
336  self.__report.maxInfoMessagesPerTestFunction,
337  "maxInfoMessagesPerTestFunction")
338  self.__report.maxErrorMessagesPerTestFunction = self.getInteger(reportNode,
339  self.__report.maxErrorMessagesPerTestFunction,
340  "maxErrorMessagesPerTestFunction")
341 
342  @staticmethod
343  def getBoolean(node, default, attributeName):
344  boolean = default
345 
346  attributeValue = node.get(attributeName)
347  if attributeValue is not None:
348  boolean = attributeValue == "True"
349 
350  return boolean
351 
352  @staticmethod
353  def getInteger(node, default, attributeName):
354  result = default
355 
356  attributeValue = node.get(attributeName)
357  if attributeValue is not None:
358  try:
359  result = int(attributeValue)
360  except:
361  print("Error: Can't parse %s with value %s as int." % (attributeName, attributeValue))
362  return result
363 
364  def fetchTestCaseManagerSettings(self, xmlRoot):
365  node = xmlRoot.find("TestCaseManager")
366  if not node is None:
367  b = self.getBoolean(node, True, "reloadPythonModulesBeforeTestExecution")
369 
370  def storeTestCaseManagerSettings(self, xmlRoot):
371  node = etree.SubElement(xmlRoot, "TestCaseManager")
372  node.set("reloadPythonModulesBeforeTestExecution", str(self.__shouldReloadPythonModulesWhenReloadingTestCases))
373 
374 
375  def fetchCoverageSettings(self, xmlRoot):
376  coverageNode = xmlRoot.find("Coverage")
377  if not coverageNode is None:
378  self.fetchBullseyeCoverageSettings(coverageNode)
379  self.fetchPythonCoverageSettings(coverageNode)
380 
381  def fetchBullseyeCoverageSettings(self, coverageNode):
382  bullseyeNode = coverageNode.find("Bullseye")
383  if bullseyeNode is not None:
384  self.fetchUseBullseyeCoverage(bullseyeNode)
385 
386  def fetchUseBullseyeCoverage(self, bullseyeNode):
387  self.__useBullseyeCoverage = self.getBoolean(bullseyeNode,
389  "enabled")
390 
391  def fetchPythonCoverageSettings(self, coverageNode):
392  pythonCoverageNode = coverageNode.find("Python")
393  if pythonCoverageNode is not None:
394  self.fetchUsePythonCoverage(pythonCoverageNode)
395  self.fetchUseGlobalPythonCoverage(pythonCoverageNode)
396  self.fetchPythonCoverageExclusionExpressions(pythonCoverageNode)
397 
398  def fetchUsePythonCoverage(self, pythonCoverageNode):
399  self.__usePythonCoverage = self.getBoolean(pythonCoverageNode,
400  self.__usePythonCoverage,
401  "enabled")
402 
403  def fetchUseGlobalPythonCoverage(self, pythonCoverageNode):
404  self.__useGlobalPythonCoverage = self.getBoolean(pythonCoverageNode,
406  "global")
407 
408 
410  default = set(self.__pythonCoverageExclusionExpressions)
411  loaded = set([expression.text for expression in coverageNode.findall("ExclusionExpression")])
412  #build union of default and loaded expressions using set type
413  self.__pythonCoverageExclusionExpressions = list(default | loaded)
414  #replace forward slashes with system default
415  self.__pythonCoverageExclusionExpressions = [os.path.normpath(expression)
416  for expression in self.__pythonCoverageExclusionExpressions]
417 
418  def fetchIPCSettings(self, xmlRoot):
419  node = xmlRoot.find("IPCConnectionTimeout")
420  if self.nodeHasValidText(node):
421  self.__ipcConnectionTimeout = int(node.text)
422 
423 
426  def save (self, filename = None):
427  xmlRoot = etree.Element("Configuration")
428  xmlTree = etree.ElementTree(xmlRoot)
429 
430  mlabNode = etree.SubElement(xmlRoot, "mlab")
431 
432  etree.SubElement(mlabNode, "slavelogfile").text = self.__MLABSlaveLogFileName
433  node = etree.SubElement(mlabNode, "executable")
434  node.set("compilemode", self.__MLABCompileMode)
435  node.text = self.__MLABExecutablePath
436  etree.SubElement(mlabNode, "arguments").text = ",".join(self.__MLABArguments)
437  etree.SubElement(mlabNode, "resultdir").text = self.__resultOutputDirectory
438  etree.SubElement(mlabNode, "resultfile").text = self.__xmlResultFileName
439  etree.SubElement(mlabNode, "timeout").text = str(self.__defaultTestTimeoutSeconds)
440  etree.SubElement(mlabNode, "MaximumTestTimeout").text = str(self.__maxTestTimeoutSeconds)
441  etree.SubElement(mlabNode, "restartinterval").text = str(self.__mMLABRestartInterval)
442 
443  reportNode = etree.SubElement(xmlRoot, "report")
444 
445  etree.SubElement(reportNode, "directory").text = self.__report.directory
446  etree.SubElement(reportNode, "name").text = self.__report.name
447  etree.SubElement(reportNode, "timestamp").text = self.__report.timestampTemplate
448 
449  reportNode.set("appendTestCaseName", unicode(self.__report.appendTestCaseName))
450  reportNode.set("appendTimestamp", unicode(self.__report.appendTimestamp))
451  reportNode.set("collapseFunctions", unicode(self.__report.collapseFunctions))
452  reportNode.set("showFailedOnly", unicode(self.__report.showFailedFunctionsOnly))
453  reportNode.set("hideInfos", unicode(self.__report.hideInfoMessages))
454  reportNode.set("hideSystemMessages", unicode(self.__report.hideSystemMessages))
455  reportNode.set("maxErrorMessagesPerTestFunction", unicode(self.__report.maxErrorMessagesPerTestFunction))
456  reportNode.set("maxInfoMessagesPerTestFunction", unicode(self.__report.maxInfoMessagesPerTestFunction))
457 
458  coverageNode = etree.SubElement(xmlRoot, "Coverage")
459 
460  pythonCoverageNode = etree.SubElement(coverageNode, "Python")
461  pythonCoverageNode.set("enabled", str(self.__usePythonCoverage))
462  pythonCoverageNode.set("global", str(self.__useGlobalPythonCoverage))
463 
464  for expression in self.__pythonCoverageExclusionExpressions:
465  etree.SubElement(pythonCoverageNode, "ExclusionExpression").text = expression
466 
467  bullseNode = etree.SubElement(coverageNode, "Bullseye")
468  bullseNode.set("enabled", str(self.__useBullseyeCoverage))
469 
470  ipcConnectionTimeoutNode = etree.SubElement(xmlRoot, "IPCConnectionTimeout")
471  ipcConnectionTimeoutNode.text = str(self.__ipcConnectionTimeout)
472 
473  self.storeTestCaseManagerSettings(xmlRoot)
474 
475  Utils.indentXML(xmlRoot)
476 
477  if filename == None:
478  filename = self.__configFilePath
479 
480  try:
481  xmlTree.write(filename)
482  except Exception as e:
483  mevis.MLAB.logWarningHTML("Unable to write config file: %s.\n%s" % (filename, e))
484 
485 
487  return os.path.join(self.__resultOutputDirectory, self.__MLABSlaveLogFileName)
488 
489 
490  def setResultDir (self, directory):
491  self.__resultOutputDirectory = directory
492 
493 
494  def getResultDir (self):
495  return self.__resultOutputDirectory
496 
497 
498  def getResultFile (self):
499  return os.path.join(self.__resultOutputDirectory, self.__xmlResultFileName)
500 
501 
503  return os.path.expandvars(self.__MLABExecutablePath)
504 
505  @staticmethod
506  def findMLABExecutable(basePath, executableName, subPath):
507  """
508  Searches for the executable in the basePath and all levels of the provided
509  subPath in a 'deepest first' manner
510  """
511  path = os.path.normpath(subPath)
512  pathComponents = path.split(os.sep)
513  pathComponents.append(executableName)
514 
515  executablePath = None
516  while pathComponents:
517  candidate = os.path.join(basePath, *pathComponents)
518  if os.path.isfile(candidate):
519  executablePath = candidate
520  break
521 
522  pathComponents.pop(0)
523 
524  if executablePath is None:
526 
527  return os.path.normpath(candidate)
528 
529 
531  expandedMLABPath = self.getMLABBinariesPath()
532  if not Utils.isMac:
533  if Utils.isWindows:
534  mlabExecutableName = "MeVisLab_d.exe" if self.useMLABDebugVersion() else "MeVisLab.exe"
535  elif Utils.isLinux:
536  mlabExecutableName = "MeVisLab_d" if self.useMLABDebugVersion() else "MeVisLab"
537 
538  command = [self.findMLABExecutable(expandedMLABPath, mlabExecutableName, "Packages/MeVisLab/IDE/bin")]
539  else:
540  executablePath = self.findMLABExecutable(expandedMLABPath, "MeVisLab", "Contents/MacOS")
541  command = [executablePath, "-debug" if self.useMLABDebugVersion() else "-release"]
542 
543  return command
544 
545 
546  def getMLABArguments (self):
547  return self.__MLABArguments
548 
549 
550  def getMLABCompileMode (self):
551  return self.__MLABCompileMode
552 
553 
555  if self.__MLABCompileMode == "Debug":
556  return True
557  elif self.__MLABCompileMode == "Release":
558  return False
559  else:
560  return mevisAvailable and mevis.MLAB.isDebug()
561 
562  def setMLABUseDebug (self, useDebug):
563  if useDebug:
564  self.__MLABCompileMode = "Debug"
565  else:
566  self.__MLABCompileMode = "Release"
567 
568 
571 
572  def setTestCaseManagerOptions(self, shouldReloadPythonModulesWhenReloadingTestCases):
573  self.__shouldReloadPythonModulesWhenReloadingTestCases = shouldReloadPythonModulesWhenReloadingTestCases
574 
575 
576  def getMLABTestCenterCommand (self, macroName):
577  return ( self.getMLABExecutableCommand()
578  + self.getMLABArguments()
579  + ['-nomateconnection', '-runmacro', macroName, '-c', self.__configFilePath])
580 
581 
582  def setMLABExecutablePath (self, executablePath):
583  if executablePath:
584  self.__MLABExecutablePath = executablePath
585 
586 
587  def setMLABArguments (self, arguments):
588  self.__MLABArguments = arguments
589 
590 
591  def setMLABCompileMode (self, value):
592  self.__MLABCompileMode = value
593 
594 
596  return self.__defaultTestTimeoutSeconds
597 
598 
599  def getConfigFilePath (self):
600  return self.__configFilePath
601 
602  @deprecated
603  def getConfigFile(self):
604  return getConfigFilePath()
605 
606  def getReportOptions(self):
607  return self.__report
608 
609  def setReportOptions (self,
610  directory,
611  name,
612  timestampTemplate,
613  appendTestCaseName,
614  appendTimestamp,
615  collapseFunctions,
616  showFailedFunctionsOnly,
617  hideInfoMessages,
618  hideSystemMessages):
619  self.__report = ReportConfig(directory,
620  name,
621  timestampTemplate,
622  appendTestCaseName,
623  appendTimestamp,
624  collapseFunctions,
625  showFailedFunctionsOnly,
626  hideInfoMessages,
627  hideSystemMessages)
628 
629  def getReportDirectory (self):
630  return self.__report.directory
631 
632 
633  def getReportName (self):
634  return self.__report.name
635 
636 
638  return self.__report.timestampTemplate
639 
640 
642  return self.__report.appendTestCaseName
643 
644 
646  return self.__report.appendTimestamp
647 
648 
649  def collapseFunctions (self):
650  return self.__report.collapseFunctions
651 
652 
654  return self.__report.showFailedFunctionsOnly
655 
656 
657  def hideInfoMessages (self):
658  return self.__report.hideInfoMessages
659 
660 
661  def hideSystemMessages (self):
662  return self.__report.hideSystemMessages
663 
664 
667 
668 
670  return self.__usePythonCoverage
671 
672 
674  return self.__useGlobalPythonCoverage
675 
676 
677  def setPythonCoverageEnabled (self, value):
678  self.__usePythonCoverage = True if value else False
679 
680 
682  return self.__useBullseyeCoverage
683 
684 
685  def setBullseyeCoverageEnabled (self, value):
686  self.__useBullseyeCoverage = True if value else False
687 
688 
690  return self.__mMLABRestartInterval
691 
692 
694  return self.__maxTestTimeoutSeconds
695 
697  return self.__ipcConnectionTimeout
698 
def __init__(self, directory=getReportDir(), name="Report", timestampTemplate="_%y_%m_%d__%H_%M", appendTestCaseName=False, appendTimestamp=False, collapseFunctions=False, showFailedFuctionsOnly=False, hideInfoMessages=False, hideSystemMessages=False)
Definition: Config.py:94
def verifyConfiguration(cfgFile)
Definition: Config.py:58
def setResultDir(self, directory)
Definition: Config.py:490
def save(self, filename=None)
Save the configuration variables set to the file with the given name.
Definition: Config.py:426
def setMLABUseDebug(self, useDebug)
Definition: Config.py:562
def fetchUsePythonCoverage(self, pythonCoverageNode)
Definition: Config.py:398
def shouldReloadPythonModulesWhenReloadingTestCases(self)
Definition: Config.py:569
def __init__(self, filePath=None, autoSave=True, isTestCaseManager=False)
Definition: Config.py:108
def setPythonCoverageEnabled(self, value)
Definition: Config.py:677
def fetchCoverageSettings(self, xmlRoot)
Definition: Config.py:375
def fetchPythonCoverageSettings(self, coverageNode)
Definition: Config.py:391
def getInteger(node, default, attributeName)
Definition: Config.py:353
def __load(self, filename)
Load the configuration values from the given file.
Definition: Config.py:236
def fetchMLABSettings(self, xmlRoot)
Definition: Config.py:255
def fetchBullseyeCoverageSettings(self, coverageNode)
Definition: Config.py:381
def fetchUseBullseyeCoverage(self, bullseyeNode)
Definition: Config.py:386
def getMLABTestCenterCommand(self, macroName)
Definition: Config.py:576
def findMLABExecutable(basePath, executableName, subPath)
Definition: Config.py:506
def __setDefaultValues(self)
Set the default configuration values.
Definition: Config.py:142
def storeTestCaseManagerSettings(self, xmlRoot)
Definition: Config.py:370
def getConfigFilePath(isTestCaseManager=False)
Definition: Config.py:30
def fetchReportSettings(self, xmlRoot)
Definition: Config.py:298
def setMLABArguments(self, arguments)
Definition: Config.py:587
def fetchIPCSettings(self, xmlRoot)
Definition: Config.py:418
def fetchTestCaseManagerSettings(self, xmlRoot)
Definition: Config.py:364
def setReportOptions(self, directory, name, timestampTemplate, appendTestCaseName, appendTimestamp, collapseFunctions, showFailedFunctionsOnly, hideInfoMessages, hideSystemMessages)
Definition: Config.py:618
def setTestCaseManagerOptions(self, shouldReloadPythonModulesWhenReloadingTestCases)
Definition: Config.py:572
def setMLABExecutablePath(self, executablePath)
Definition: Config.py:582
def getBoolean(node, default, attributeName)
Definition: Config.py:343
def fetchReportNodeSettings(self, xmlRoot)
Definition: Config.py:314
def setBullseyeCoverageEnabled(self, value)
Definition: Config.py:685
def fetchPythonCoverageExclusionExpressions(self, coverageNode)
Definition: Config.py:409
def fetchUseGlobalPythonCoverage(self, pythonCoverageNode)
Definition: Config.py:403