79 def inner(testCaseClass):
81 runningInsideMeVisLab = hasattr(globals.get(
'ctx'),
'name')
82 if runningInsideMeVisLab:
85 MLABTC_DISABLED_TEST_FUNCTIONS = globals.get(
'MLABTC_DISABLED_TEST_FUNCTIONS', [])
87 skip = name.startswith(
'DISABLED_')
or name
in MLABTC_DISABLED_TEST_FUNCTIONS
88 m = NormalTestRegExp.match(name)
91 testCaseClass.addTest(testName, skip)
93 m = IterativeTestRegExp.match(name)
96 testDict = globals[name]()[0]
97 if isinstance(testDict, (list, tuple)):
99 width = len(str(len(testDict)-1))
100 testDict = [str(n).zfill(width)
for n
in range(len(testDict))]
102 testName =
'%s_%s' % (basename, key)
103 testCaseClass.addTest(testName, skip)
236 buildSystemRoot = os.path.join(mlabroot,
'MeVis',
'BuildSystem',
'Sources')
237 sys.path.insert(0, buildSystemRoot)
239 import BuildSystem.SystemUtils
242 sys.path.remove(buildSystemRoot)
244 testCenterEnvironment = dict(os.environ)
245 if testCenterEnvironment.get(
'PYCHARM_HOSTED') ==
'1':
247 del testCenterEnvironment[
'PYTHONPATH']
249 requiredPackages = [
'MeVis/ThirdParty',
'MeVis/Foundation',
'MeVisLab/IDE']
250 additionalBinPaths = [os.path.join(mlabroot, package,
'bin')
for package
in requiredPackages]
251 additionalBinPaths.append(os.path.join(mlabroot,
'MeVis/ThirdParty/Sources/Qt4/qt/bin'))
252 additionalLibPaths = [os.path.join(mlabroot, package,
'lib')
for package
in requiredPackages]
253 additionalLibPaths.append(os.path.join(mlabroot,
'MeVis/ThirdParty/Python'))
254 additionalLibPaths.append(os.path.join(mlabroot,
'MeVis/ThirdParty/Sources/Qt4/qt/lib'))
255 additionalBinPaths = [os.path.normpath(path)
for path
in additionalBinPaths]
256 additionalLibPaths = [os.path.normpath(path)
for path
in additionalLibPaths]
257 BuildSystem.SystemUtils.addPathsToExecutableSearchPaths(additionalBinPaths, environmentDict=testCenterEnvironment)
258 BuildSystem.SystemUtils.addPathsToLibrarySearchPaths(additionalLibPaths, environmentDict=testCenterEnvironment)
260 return testCenterEnvironment