wscript
changeset 3812 6d89a22bc669
parent 3763 2796e67069ee
parent 3793 71d93292bc49
child 3901 8b1dc7ff3ce5
equal deleted inserted replaced
3790:2643f6bc623c 3812:6d89a22bc669
   820 class Regression(object):
   820 class Regression(object):
   821     def __init__(self, testdir):
   821     def __init__(self, testdir):
   822         self.testdir = testdir
   822         self.testdir = testdir
   823         self.env = Params.g_build.env_of_name('default')
   823         self.env = Params.g_build.env_of_name('default')
   824 
   824 
   825     def run_test(self, verbose, generate, refDirName, testName, arguments=[], pyscript=None):
   825     def run_test(self, verbose, generate, refDirName, testName, arguments=[], pyscript=None, refTestName=None):
   826         """
   826         """
   827         @param verbose: enable verbose execution
   827         @param verbose: enable verbose execution
   828 
   828 
   829         @param generate: generate new traces instead of comparing with the reference
   829         @param generate: generate new traces instead of comparing with the reference
   830 
   830 
   835         @arguments: list of extra parameters to pass to the program to be tested
   835         @arguments: list of extra parameters to pass to the program to be tested
   836 
   836 
   837         @pyscript: if not None, the test is written in Python and this
   837         @pyscript: if not None, the test is written in Python and this
   838         parameter contains the path to the python script, relative to
   838         parameter contains the path to the python script, relative to
   839         the project root dir
   839         the project root dir
       
   840 
       
   841         @param refTestName: if not None, this is the name of the directory under refDirName
       
   842         that contains the reference traces. Otherwise "refDirname/testName + .ref" is used.
   840 
   843 
   841         """
   844         """
   842         if not isinstance(arguments, list):
   845         if not isinstance(arguments, list):
   843             raise TypeError
   846             raise TypeError
   844         
   847         
   845         refTestDirName = os.path.join(refDirName, (testName + ".ref"))
   848         if refTestName is None:
       
   849             refTestDirName = os.path.join(refDirName, (testName + ".ref"))
       
   850         else:
       
   851             refTestDirName = os.path.join(refDirName, refTestName)
   846 
   852 
   847         if not os.path.exists(refDirName):
   853         if not os.path.exists(refDirName):
   848             print"No reference trace repository"
   854             print"No reference trace repository"
   849             return 1
   855             return 1
   850 
   856