~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/test_run_options.py

  • Committer: Andrew Hutchings
  • Date: 2011-02-01 10:23:22 UTC
  • mto: (2136.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2137.
  • Revision ID: andrew@linuxjedi.co.uk-20110201102322-oxztcyrjzg3c7yta
Fix counters cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
 
# -*- mode: python; indent-tabs-mode: nil; -*-
 
1
#! /usr/bin/python
 
2
# -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
3
3
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
4
#
5
5
# Copyright (C) 2010 Patrick Crews
51
51
    variables = {}
52
52
    variables = vars(args)
53
53
    variables['test_cases']= test_cases
54
 
    # This code should become a function once
55
 
    # enough thought has been given to it
56
 
    if variables['manualgdb']:
57
 
        variables['gdb']=True
58
 
    if variables['repeat'] <= 0:
59
 
        print "Setting --repeat=1.  You chose a silly value that I will ignore :P"
60
 
        variables['repeat'] = 1
61
 
    if variables['mode'] == 'randgen':
62
 
        print "Setting --no-secure-file-priv=True for randgen mode..."
63
 
        variables['nosecurefilepriv']=True
64
 
    if variables['mode'] == 'cleanup':
65
 
        print "Setting --start-dirty=True for cleanup mode..."
66
 
        variables['startdirty']=True
67
54
    return variables
68
55
 
69
56
# Create the CLI option parser
76
63
server_default = os.path.abspath(os.path.join(testdir_default,
77
64
                                       '../drizzled/drizzled'))
78
65
 
79
 
workdir_default = os.path.join(testdir_default,'workdir')
 
66
workdir_default = os.path.join(testdir_default,'dbqp_work')
80
67
 
81
68
clientbindir_default = os.path.abspath(os.path.join(testdir_default,
82
69
                                       '../client'))
125
112
    "--mode"
126
113
  , dest="mode"
127
114
  , default="dtr"
128
 
  , help="Testing mode.  We currently support dtr, randgen, and cleanup modes.  See docs for further details about individual modes [%default]"
 
115
  , help="Testing mode.  We only support dtr...for now >;) [%default]"
129
116
  )
130
117
 
131
118
system_control_group.add_option(
144
131
  , help="Don't try to cleanup from earlier runs (currently just a placeholder) [%default]"
145
132
  )
146
133
 
147
 
system_control_group.add_option(
148
 
    "--randgen-path"
149
 
  , dest="randgenpath"
150
 
  , action='store'
151
 
  , default=None
152
 
  , help = "The path to a randgen installation that can be used to execute randgen-based tests"
153
 
  )
154
 
 
155
134
parser.add_option_group(system_control_group)
156
135
 
157
136
# end system_control_group
203
182
  , help = "sort the testcases so that they are executed optimally for the given mode [%default]"
204
183
  )
205
184
 
206
 
test_control_group.add_option(
207
 
    "--repeat"
208
 
  , dest="repeat"
209
 
  , type='int'
210
 
  , action="store"
211
 
  , default=1
212
 
  , help = "Run each test case the specified number of times.  For a given sequence, the first test will be run n times, then the second, etc [%default]"
213
 
  )
 
185
 
214
186
 
215
187
parser.add_option_group(test_control_group)
216
188
# end test_control_group
319
291
  , help = "Turn off the use of --secure-file-priv=vardir for started servers"
320
292
  )
321
293
 
 
294
 
322
295
parser.add_option_group(environment_control_group)
323
296
# end environment control group
324
297
 
325
 
option_passing_group = optparse.OptionGroup(parser,
326
 
                          "Options to pass options on to the server")
327
 
 
328
 
option_passing_group.add_option(
329
 
    "--drizzled"
330
 
  , dest="drizzledoptions"
331
 
  , type='string'
332
 
  , action='append' 
333
 
  , default = []
334
 
  , help = "Pass additional options to the server.  Will be passed to all servers for all tests (mostly for --start-and-exit)"
335
 
  )
336
 
 
337
 
parser.add_option_group(option_passing_group)
338
 
# end option passing group
339
 
 
340
 
 
341
298
analysis_control_group = optparse.OptionGroup(parser, 
342
299
                            "Options for defining the tools we use for code analysis (valgrind, gprof, gcov, etc)")
343
300
 
369
326
  , help="Start the drizzled server(s) in gdb"
370
327
  )
371
328
 
372
 
debugger_control_group.add_option(
373
 
    "--manual-gdb"
374
 
  , dest="manualgdb"
375
 
  , action='store_true'
376
 
  , default=False
377
 
  , help="Allows you to start the drizzled server(s) in gdb manually (in another window, etc)"
378
 
  )
379
 
 
380
329
parser.add_option_group(debugger_control_group)
381
330
 
382
331
 
383
 
utility_group = optparse.OptionGroup(parser,
384
 
                  "Options to call additional utilities such as datagen")
385
 
 
386
 
utility_group.add_option(
387
 
    "--gendata"
388
 
  , dest="gendatafile"
389
 
  , action='store'
390
 
  , type='string'
391
 
  , default=None
392
 
  , help="Call the randgen's gendata utility to use the specified configuration file.  This will populate the server prior to any test execution")
393
 
 
394
 
parser.add_option_group(utility_group)
 
332
 
395
333
 
396
334
 
397
335
# supplied will be those arguments matching an option,