~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/test_mode.py

  • Committer: patrick crews
  • Date: 2011-01-15 21:27:41 UTC
  • mto: (2119.2.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2121.
  • Revision ID: gleebix@gmail.com-20110115212741-htz3af0cib4fwdlv
Updated tree so that test-run.pl and test-run.py may live together in peace for a time

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/python
 
2
# -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
3
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
4
#
 
5
# Copyright (C) 2010 Patrick Crews
 
6
#
 
7
"""test_mode.py
 
8
   code for dealing with testing modes
 
9
   A given mode should have a systemInitializer, testManager, and testExecutor
 
10
   that define how to setup, manage, and execute test cases
 
11
 
 
12
"""
 
13
 
 
14
# imports
 
15
import sys
 
16
 
 
17
def handle_mode(variables, system_manager):
 
18
    """ Deals with the 'mode' option and returns
 
19
        the appropriate code objects for the test-runner to play with
 
20
 
 
21
    """
 
22
    # drizzle-test-run mode - the default
 
23
    if variables['mode'] == 'dtr':
 
24
        # DTR mode - this is what we are coding to initially
 
25
        # We are just setting the code up this way to hopefully make
 
26
        # other coolness easier in the future
 
27
 
 
28
        system_manager.logging.info("Using testing mode: %s" %variables['mode'])
 
29
 
 
30
        # Set up our testManager
 
31
        from drizzle_test_run.dtr_test_management import testManager
 
32
        test_manager = testManager( variables['verbose'], variables['debug'] 
 
33
                                  , variables['engine'], variables['dotest']
 
34
                                  , variables['skiptest'], variables['suitelist']
 
35
                                  , variables['suitepaths'], system_manager
 
36
                                  , variables['test_cases'])
 
37
 
 
38
        # get our mode-specific testExecutor
 
39
        from drizzle_test_run.dtr_test_execution import dtrTestExecutor
 
40
        
 
41
        return (test_manager, dtrTestExecutor)
 
42
 
 
43
    else:
 
44
        system_manager.logging.error("unknown mode argument: %s" %variables['mode'])
 
45
        sys.exit(1)