~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/test_mgmt/test_management.py

  • Committer: Mark Atwood
  • Date: 2011-10-11 22:37:47 UTC
  • mfrom: (2429.2.1 dbqp_revamp)
  • Revision ID: me@mark.atwood.name-20111011223747-vomebzgvnxxysqrm
mergeĀ lp:~patrick-crews/drizzle/dbqp_revamp

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
    """
42
42
 
43
 
    def __init__( self, verbose, debug, default_engine, dotest, skiptest
44
 
                , reorder, suitelist, suitepaths, system_manager
45
 
                , test_cases, mode):
 
43
    def __init__( self, variables, system_manager):
46
44
 
47
45
        self.system_manager = system_manager
48
46
        self.time_manager = system_manager.time_manager
49
47
        self.logging = system_manager.logging
50
 
        if verbose:
 
48
        if variables['verbose']:
51
49
            self.logging.verbose("Initializing test manager...")
52
50
 
53
 
        if dotest:
54
 
            dotest = dotest.strip()
55
 
        if skiptest:
56
 
            skiptest = skiptest.strip()
57
51
        self.skip_keys = [ 'system_manager'
 
52
                         , 'verbose'
 
53
                         , 'debug'
58
54
                         ]
59
55
        self.test_list = []
60
56
        self.first_test = 1
61
57
        self.total_test_count = 0
62
58
        self.executed_tests = {} # We have a hash of 'status':[test_name..]
63
59
        self.executing_tests = {}
64
 
        self.verbose = verbose
65
 
        self.debug = debug
66
 
        self.default_engine = default_engine
67
 
        self.dotest = dotest
68
 
        self.skiptest = skiptest
69
 
        self.reorder = reorder
70
 
        self.suitelist = suitelist
71
 
        self.mode = mode
72
 
        
73
 
        self.code_tree = self.system_manager.code_tree
74
 
        self.suitepaths = suitepaths + self.code_tree.suite_paths
75
 
        self.testdir = self.code_tree.testdir
76
 
        self.desired_tests = test_cases
77
 
        self.mutex = thread.allocate_lock()
78
 
        
79
 
        if self.debug:
80
 
            self.logging.debug(self)
 
60
        self.verbose = variables['verbose']
 
61
        self.debug = variables['debug']
 
62
        self.default_engine = variables['defaultengine']
 
63
        self.dotest = variables['dotest']
 
64
        if self.dotest:
 
65
            self.dotest = self.dotest.strip()
 
66
        self.skiptest = variables['skiptest']
 
67
        if self.skiptest:
 
68
            self.skiptest = self.skiptest.strip()
 
69
        self.reorder = variables['reorder']
 
70
        self.suitelist = variables['suitelist']
 
71
        self.mode = variables['mode']
 
72
        
 
73
        self.suitepaths = variables['suitepaths']
 
74
        self.testdir = variables['testdir']
 
75
        self.desired_tests = variables['test_cases']
 
76
        
 
77
        self.logging.debug_class(self)
81
78
 
82
79
    def add_test(self, new_test_case):
83
80
        """ Add a new testCase to our self.test_list """
84
 
        if self.debug: pass
 
81
 
85
82
        self.test_list.append(new_test_case)
86
83
        
87
84
    def gather_tests(self):
120
117
        self.total_test_count = len(self.test_list)     
121
118
        self.logging.info("Found %d test(s) for execution" %(self.total_test_count))
122
119
        
123
 
        if self.debug:
124
 
            self.logging.debug("Found tests:")
125
 
            self.logging.debug("%s" %(self.print_test_list()))
 
120
        self.logging.debug("Found tests:")
 
121
        self.logging.debug("%s" %(self.print_test_list()))
126
122
 
127
123
    def find_suite_path(self, suitename):
128
124
        """ We have a suitename, we need to locate the path to
160
156
           to the rest of the test-runner
161
157
        
162
158
        """
163
 
        if self.verbose:
164
 
                self.logging.verbose("Processing suite: %s" %(suite))
 
159
        self.logging.verbose("Processing suite: %s" %(suite))
165
160
 
166
161
    def has_tests(self):
167
162
        """Return 1 if we have tests in our testlist, 0 otherwise"""