diff --git a/Testing/TestScripts/Regression/Commands.py b/Testing/TestScripts/Regression/Commands.py index 9fdd760e..a250c5af 100755 --- a/Testing/TestScripts/Regression/Commands.py +++ b/Testing/TestScripts/Regression/Commands.py @@ -53,8 +53,9 @@ def fullTestFolder(rootFolder): return(os.path.join(rootFolder,"CMSIS","DSP","Testing","fulltests")) class BuildConfig: - def __init__(self,toUnset,rootFolder,buildFolder,compiler,toolchain,core,cmake): + def __init__(self,toUnset,toSet,rootFolder,buildFolder,compiler,toolchain,core,cmake): self._toUnset = toUnset + self._toSet = toSet self._buildFolder = buildFolder self._rootFolder = os.path.abspath(rootFolder) self._dspFolder = os.path.join(self._rootFolder,"CMSIS","DSP") @@ -102,14 +103,30 @@ class BuildConfig: def saveEnv(self): if self._toUnset is not None: for v in self._toUnset: - self._savedEnv[v] = os.environ[v] + if v in os.environ: + self._savedEnv[v] = os.environ[v] + else: + self._savedEnv[v] = None del os.environ[v] + if self._toSet is not None: + for v in self._toSet: + for varName in v: + if varName in os.environ: + self._savedEnv[varName] = os.environ[varName] + else: + self._savedEnv[varName] = None + os.environ[varName] = v[varName] + + def restoreEnv(self): - if self._toUnset is not None: - for v in self._toUnset: - os.environ[v] = self._savedEnv[v] + for v in self._savedEnv: + if self._savedEnv[v] is not None: + os.environ[v] = self._savedEnv[v] + else: + if v in os.environ: + del os.environ[v] self._savedEnv = {} # Build for a folder diff --git a/Testing/runAllTests.py b/Testing/runAllTests.py index 08f9f986..e67531a1 100755 --- a/Testing/runAllTests.py +++ b/Testing/runAllTests.py @@ -108,10 +108,17 @@ def buildAndTest(compiler): configNb = configNb + 1 buildStr = "build_%s_%s_%d" % (compiler,core,configNb) toUnset = None + toSet = None + if compiler in config['UNSET']: if core in config['UNSET'][compiler]: toUnset = config['UNSET'][compiler][core] - build = BuildConfig(toUnset,args.r, + + if compiler in config['SET']: + if core in config['SET'][compiler]: + toSet = config['SET'][compiler][core] + + build = BuildConfig(toUnset,toSet,args.r, buildStr, config['COMPILERS'][core][compiler], config['TOOLCHAINS'][compiler],