2
# -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
3
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
5
# Copyright (C) 2010 Patrick Crews
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
code for dealing with testing modes
23
A given mode should have a systemInitializer, testManager, and testExecutor
24
that define how to setup, manage, and execute test cases
31
def handle_mode(variables, system_manager):
32
""" Deals with the 'mode' option and returns
33
the appropriate code objects for the test-runner to play with
36
# drizzle-test-run mode - the default
37
if variables['mode'] == 'dtr':
38
# DTR mode - this is what we are coding to initially
39
# We are just setting the code up this way to hopefully make
40
# other coolness easier in the future
42
system_manager.logging.info("Using testing mode: %s" %variables['mode'])
44
# Set up our testManager
45
from drizzle_test_run.dtr_test_management import testManager
46
test_manager = testManager( variables['verbose'], variables['debug']
47
, variables['defaultengine'], variables['dotest']
48
, variables['skiptest'], variables['reorder']
49
, variables['suitelist'], variables['suitepaths']
50
, system_manager, variables['test_cases'])
52
# get our mode-specific testExecutor
53
from drizzle_test_run.dtr_test_execution import dtrTestExecutor
55
return (test_manager, dtrTestExecutor)
58
system_manager.logging.error("unknown mode argument: %s" %variables['mode'])