Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/scripting/bin/subunitrun

    r414 r745  
    1 #!/usr/bin/python
     1#!/usr/bin/env python
    22
    33# Simple subunit testrunner for python
     
    2222# Find right directory when running from source tree
    2323sys.path.insert(0, "bin/python")
    24 sys.path.insert(1, "../lib/subunit/python")
    2524
    26 from subunit import SubunitTestRunner
    27 from unittest import TestProgram
    2825import optparse
    29 import os
    30 from samba import param
     26import samba
     27samba.ensure_external_module("testtools", "testtools")
     28samba.ensure_external_module("subunit", "subunit/python")
     29from subunit.run import SubunitTestRunner
    3130import samba.getopt as options
    3231import samba.tests
     32
    3333
    3434parser = optparse.OptionParser("subunitrun [options] <tests>")
    3535credopts = options.CredentialsOptions(parser)
    3636parser.add_option_group(credopts)
    37 sambaopts = options.SambaOptions(parser)
    38 parser.add_option_group(sambaopts)
    39 parser.add_option_group(options.VersionOptions(parser))
     37try:
     38    from subunit.run import TestProgram
     39except ImportError:
     40    from unittest import TestProgram
     41else:
     42    parser.add_option('-l', '--list', dest='listtests', default=False,
     43                      help='List tests rather than running them.',
     44                      action="store_true")
    4045
    41 args = parser.parse_args()[1]
     46opts, args = parser.parse_args()
    4247
    43 samba.tests.cmdline_loadparm = sambaopts.get_loadparm()
    44 samba.tests.cmdline_credentials = credopts.get_credentials(samba.tests.cmdline_loadparm)
     48samba.tests.cmdline_credentials = credopts.get_credentials(samba.tests.env_loadparm())
     49if getattr(opts, "listtests", False):
     50    args.insert(0, "--list")
    4551
    4652runner = SubunitTestRunner()
Note: See TracChangeset for help on using the changeset viewer.