diff --git a/buildingspy/development/regressiontest.py b/buildingspy/development/regressiontest.py index 0debe059..c29411dd 100644 --- a/buildingspy/development/regressiontest.py +++ b/buildingspy/development/regressiontest.py @@ -257,14 +257,7 @@ def __init__( self._rootPackage = os.path.join(self._libHome, 'Resources', 'Scripts', 'Dymola') # Set the reference results directory - if dir_ref is None: - self.dir_ref = os.path.join( - self._libHome, 'Resources', 'ReferenceResults', 'Dymola' - ) - else: - self.dir_ref = dir_ref - if not os.path.exists(self.dir_ref): - os.makedirs(self.dir_ref) + self.dir_ref = dir_ref # Set the tool if tool in ['dymola', 'omc', 'optimica', 'jmodelica']: @@ -437,6 +430,13 @@ def setLibraryRoot(self, rootDir): self._rootPackage = os.path.join(self._libHome, 'Resources', 'Scripts', 'Dymola') self.isValidLibrary(self._libHome) + if self.dir_ref is None: + self.dir_ref = os.path.join( + self._libHome, 'Resources', 'ReferenceResults', 'Dymola' + ) + if not os.path.exists(self.dir_ref): + os.makedirs(self.dir_ref) + def useExistingResults(self, dirs): """ This function allows to use existing results, as opposed to running a simulation.