~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/test-run.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
 
 
8
""" test-run.py
 
9
 
 
10
Main script for the Drizzle test-runner
 
11
 
 
12
"""
 
13
 
 
14
# imports
 
15
import os
 
16
import sys
 
17
import lib.test_run_options as test_run_options
 
18
from lib.test_mode import handle_mode
 
19
from lib.server_mgmt.server_management import serverManager
 
20
from lib.sys_mgmt.system_management import systemManager
 
21
from lib.test_mgmt.execution_management import executionManager
 
22
 
 
23
# functions
 
24
 
 
25
 
 
26
# main
 
27
 
 
28
try:
 
29
    variables = test_run_options.variables
 
30
 
 
31
    # Some system-level work is constant regardless
 
32
    # of the test to be run
 
33
    system_manager = systemManager(variables)
 
34
 
 
35
    # Create our server_manager
 
36
    server_manager = serverManager(system_manager, variables)
 
37
 
 
38
    # Get our mode-specific test_manager and test_executor
 
39
    (test_manager,test_executor) = handle_mode(variables, system_manager)
 
40
 
 
41
    # Gather our tests for execution
 
42
    test_manager.gather_tests()
 
43
 
 
44
    # Initialize test execution manager
 
45
    execution_manager = executionManager(server_manager, system_manager
 
46
                                    , test_manager, test_executor
 
47
                                    , variables)
 
48
 
 
49
    # Execute our tests!
 
50
    execution_manager.execute_tests()
 
51
 
 
52
except Exception, e:
 
53
    print Exception, e
 
54
 
 
55
finally:
 
56
    # Cleanup
 
57
    server_manager.cleanup()
 
58