regression.py
changeset 4326 179f86838e62
parent 4308 b8528d30dfb3
child 4332 a1c7bc503a0c
     1.1 --- a/regression.py	Thu Apr 02 13:16:13 2009 +0100
     1.2 +++ b/regression.py	Mon Apr 13 23:10:37 2009 +0100
     1.3 @@ -6,7 +6,6 @@
     1.4  import errno
     1.5  
     1.6  # WAF modules
     1.7 -import Build
     1.8  import Options
     1.9  import Utils
    1.10  import Task
    1.11 @@ -66,9 +65,11 @@
    1.12      after = 'cc cxx cc_link cxx_link'
    1.13      color = 'BLUE'
    1.14  
    1.15 -    def __init__(self, env, test_name, test_scripts_dir, build_traces_dir, reference_traces):
    1.16 -        super(regression_test_task, self).__init__()
    1.17 +    def __init__(self, bld, env, test_name, test_scripts_dir, build_traces_dir, reference_traces):
    1.18 +        self.bld = bld
    1.19 +        self.generator = self
    1.20          self.env = env
    1.21 +        super(regression_test_task, self).__init__(generator=self, env=env)
    1.22          self.test_name = test_name
    1.23          self.test_scripts_dir = test_scripts_dir
    1.24          self.build_traces_dir = build_traces_dir
    1.25 @@ -77,6 +78,9 @@
    1.26      def __str__(self):
    1.27          return 'regression-test (%s)\n' % self.test_name
    1.28  
    1.29 +    def runnable_status(self):
    1.30 +        return Task.RUN_ME
    1.31 +
    1.32      def run(self):
    1.33          """Run a single test"""
    1.34          sys.path.insert(0, self.test_scripts_dir)
    1.35 @@ -119,7 +123,7 @@
    1.36          if Options.options.regression_generate:
    1.37              # clean the target dir
    1.38              try:
    1.39 -                shutil.rmtree(trace_output_path)
    1.40 +                shutil.rmtree(reference_traces_path)
    1.41              except OSError, ex:
    1.42                  if ex.errno not in [errno.ENOENT]:
    1.43                      raise
    1.44 @@ -206,13 +210,17 @@
    1.45      after = 'regression_test_task'
    1.46      color = 'BLUE'
    1.47  
    1.48 -    def __init__(self, test_tasks):
    1.49 -        super(regression_test_collector_task, self).__init__()
    1.50 +    def __init__(self, bld, test_tasks):
    1.51 +        self.bld = bld
    1.52 +        super(regression_test_collector_task, self).__init__(generator=self)
    1.53          self.test_tasks = test_tasks
    1.54  
    1.55      def __str__(self):
    1.56          return 'regression-test-collector\n'
    1.57  
    1.58 +    def runnable_status(self):
    1.59 +        return Task.RUN_ME
    1.60 +
    1.61      def run(self):
    1.62          failed_tests = [test for test in self.test_tasks if test.result is not None and test.result != 0]
    1.63          skipped_tests = [test for test in self.test_tasks if test.result is None]
    1.64 @@ -256,5 +264,7 @@
    1.65      build_traces_dir = bld.path.find_or_declare('regression/traces').abspath(bld.env)
    1.66      tasks = []
    1.67      for test in tests:
    1.68 -        tasks.append(regression_test_task(bld.env, test, test_scripts_dir, build_traces_dir, reference_traces))
    1.69 -    regression_test_collector_task(tasks)
    1.70 +        task = regression_test_task(bld, bld.env, test, test_scripts_dir, build_traces_dir, reference_traces)
    1.71 +        #bld.task_manager.add_task(task)
    1.72 +        tasks.append(task)
    1.73 +    regression_test_collector_task(bld, tasks)