[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Sun Nov 13 11:39:03 MST 2011


The branch, master has been updated
       via  86afe83 waf: Factor checking for undefined symbol flags out into separate method.
       via  af5c6fb waf: Simplify handling of python modules.
       via  126209d Revert 9a5ae8edd6d006c078b3af8fdfd84677a63276b1.
       via  3585abc pytdb: Shorter description which fits on a single line.
       via  a4c2ba6 testtools: Import new upstream snapshot.
       via  9250177 subunit: Import new upstream snapshot.
       via  0966be4 wafsamba: Support allow_undefined_symbols in SAMBA_SUBSYSTEM.
       via  2f29133 wafsambaa: Support libraries that don't have the same name as their pkg-config file.
       via  c526078 ldb: Only check for pkg-config file when checking for system ldb.
       via  b929cd2 tevent: Only check for pkg-config file when checking for system tevent.
       via  774f856 tdb: Only check for pkg-config file when checking for system tdb.
       via  39ba9b9 talloc: Only check for pkg-config file when checking for system talloc.
       via  2c388a4 subunit: Only check for pkg-config file and use proper pkg-config file name.
       via  f429b16 wafsamba: add CHECK_BUNDLED_SYSTEM_PKG function.
       via  5e8dee8 tevent: Only build pytevent if the system doesn't provide it.
       via  8aa988a ldb: Use pyembed rather than pyext for ldb-util library.
       via  011707d tevent: remove unnecessary enablement.
       via  22c88fb pytalloc-util: Don't mark as python extension, use pyembed instead.
       via  312fd94 waf: Don't link python modules against libpython2.x, consistent with other Python modules.
       via  c529c12 upgrade: use logger.warning.
      from  576ea40 samba-tool: allow dbcheck to correct the originating_change_time of the deleted object container

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 86afe83d867229b11fd4ec9cb6e29af698cacdef
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 13 18:01:09 2011 +0100

    waf: Factor checking for undefined symbol flags out into separate method.
    
    Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date: Sun Nov 13 19:38:38 CET 2011 on sn-devel-104

commit af5c6fba68a05e9e196f4e9133b07cb1d62cc981
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 13 17:50:52 2011 +0100

    waf: Simplify handling of python modules.

commit 126209d2e593be55c69ce9ae9462ea441bbb3ce1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 13 17:29:10 2011 +0100

    Revert 9a5ae8edd6d006c078b3af8fdfd84677a63276b1.

commit 3585abcd4cc1b6ffeeb7f64abe3d21a12f9633f6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 13 17:20:57 2011 +0100

    pytdb: Shorter description which fits on a single line.

commit a4c2ba66cb420d35789e55f604599a84c8d570a7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 13 17:18:10 2011 +0100

    testtools: Import new upstream snapshot.

commit 9250177ae71e37fe1a132fe198cac4f3512bc4c7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 13 17:17:54 2011 +0100

    subunit: Import new upstream snapshot.

commit 0966be49a0b7d1cea7d8afc9b0c313a8198bde66
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 20:24:35 2011 +0100

    wafsamba: Support allow_undefined_symbols in SAMBA_SUBSYSTEM.

commit 2f2913349146e03b498f305f046c92344508da69
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:56:01 2011 +0100

    wafsambaa: Support libraries that don't have the same name as their pkg-config file.

commit c5260788067a3fe1e2f10120e99a16e7cd28bac9
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:36:39 2011 +0100

    ldb: Only check for pkg-config file when checking for system ldb.

commit b929cd2c096d4184bec193dd762acdf4710a7d2c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:36:28 2011 +0100

    tevent: Only check for pkg-config file when checking for system tevent.

commit 774f85649b5d9f8872ebfdd359964330b4ff436a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:36:18 2011 +0100

    tdb: Only check for pkg-config file when checking for system tdb.

commit 39ba9b93d795f8add40fb13434e8a4dd259f9c24
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:36:07 2011 +0100

    talloc: Only check for pkg-config file when checking for system talloc.

commit 2c388a40cc375de62c960251b47fb5e6822002b7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:35:48 2011 +0100

    subunit: Only check for pkg-config file and use proper pkg-config file name.

commit f429b166b6e9c3da086ab53cbf5ebfdc1516cb17
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:35:11 2011 +0100

    wafsamba: add CHECK_BUNDLED_SYSTEM_PKG function.

commit 5e8dee8d96a7522cdcde57dbbf93fbe9c614992e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 16:14:33 2011 +0100

    tevent: Only build pytevent if the system doesn't provide it.

commit 8aa988a455f1165f59e19eb39f5fd2b0c39231f6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 15:51:16 2011 +0100

    ldb: Use pyembed rather than pyext for ldb-util library.

commit 011707dee8a7c0bd1ee6768023e7d91a8988009b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 15:50:54 2011 +0100

    tevent: remove unnecessary enablement.

commit 22c88fbc1d7d0444261c950c3ead7076f933a178
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 15:38:45 2011 +0100

    pytalloc-util: Don't mark as python extension, use pyembed instead.

commit 312fd94002cd576140e5d90ef70ea2dd053c949a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Nov 12 05:20:10 2011 +0100

    waf: Don't link python modules against libpython2.x, consistent with other Python modules.
    
    Rather, rely just on waf's pyext feature. This fixes a warning from dh_python2.

commit c529c12c7d644bb2d7391a5d736ee9e6b12d6ab6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Nov 11 18:32:55 2011 +0100

    upgrade: use logger.warning.

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py              |   12 +++
 buildtools/wafsamba/samba_bundled.py               |   72 +++++++++++++++++--
 buildtools/wafsamba/samba_python.py                |   25 ++-----
 buildtools/wafsamba/wafsamba.py                    |   16 +++--
 lib/ldb/wscript                                    |    8 ++-
 lib/subunit/NEWS                                   |   37 ++++++----
 lib/subunit/c/wscript                              |    2 +-
 lib/subunit/configure.ac                           |    2 +-
 lib/subunit/python/subunit/run.py                  |    2 +
 lib/subunit/python/subunit/tests/__init__.py       |    2 +
 lib/subunit/python/subunit/tests/test_run.py       |   52 ++++++++++++++
 .../python/subunit/tests/test_test_protocol.py     |   17 +++--
 lib/subunit/setup.py                               |    2 +-
 lib/talloc/wscript                                 |    8 ++-
 lib/tdb/pytdb.c                                    |    3 +-
 lib/tdb/wscript                                    |    4 +-
 lib/testtools/NEWS                                 |    5 ++
 lib/testtools/testtools/matchers.py                |    2 +-
 lib/testtools/testtools/testresult/real.py         |   10 +++
 lib/testtools/testtools/tests/test_matchers.py     |   10 ++--
 lib/testtools/testtools/tests/test_testcase.py     |    4 +-
 lib/testtools/testtools/tests/test_testresult.py   |    7 ++
 lib/tevent/wscript                                 |   18 +++--
 source4/scripting/python/samba/netcmd/domain.py    |    8 +-
 source4/scripting/python/wscript_build             |    2 +-
 wscript                                            |   10 +---
 26 files changed, 247 insertions(+), 93 deletions(-)
 create mode 100644 lib/subunit/python/subunit/tests/test_run.py


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 909e836..1ea818e 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -712,3 +712,15 @@ def SETUP_CONFIGURE_CACHE(conf, enable):
         preproc.recursion_limit = 1
     # in either case we don't need to scan system includes
     preproc.go_absolute = False
+
+
+ at conf
+def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
+    # we don't want any libraries or modules to rely on runtime
+    # resolution of symbols
+    if sys.platform != "openbsd4":
+        conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
+
+    if sys.platform != "openbsd4" and conf.env.undefined_ignore_ldflags == []:
+        if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
+            conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 39edad0..95d0c7d 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -82,6 +82,64 @@ def LIB_MUST_BE_BUNDLED(conf, libname):
             libname in conf.env.BUNDLED_LIBS)
 
 
+ at conf
+def CHECK_PREREQUISITES(conf, prereqs):
+    for syslib in TO_LIST(prereqs):
+        f = 'FOUND_SYSTEMLIB_%s' % syslib
+        if not f in conf.env:
+            return False
+    return True
+
+
+ at runonce
+ at conf
+def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
+        onlyif=None, implied_deps=None, pkg=None):
+    '''check if a library is available as a system library.
+
+    This only tries using pkg-config
+    '''
+    if conf.LIB_MUST_BE_BUNDLED(libname):
+        return False
+    found = 'FOUND_SYSTEMLIB_%s' % libname
+    if found in conf.env:
+        return conf.env[found]
+
+    # see if the library should only use a system version if another dependent
+    # system version is found. That prevents possible use of mixed library
+    # versions
+    if onlyif:
+        if not conf.CHECK_PREREQUISITES(onlyif):
+            if not conf.LIB_MAY_BE_BUNDLED(libname):
+                Logs.error('ERROR: Use of system library %s depends on missing system library %s' % (libname, syslib))
+                sys.exit(1)
+            conf.env[found] = False
+            return False
+
+    minversion = minimum_library_version(conf, libname, minversion)
+
+    msg = 'Checking for system %s' % libname
+    if minversion != '0.0.0':
+        msg += ' >= %s' % minversion
+
+    if pkg is None:
+        pkg = libname
+
+    if conf.check_cfg(package=pkg,
+                      args='"%s >= %s" --cflags --libs' % (pkg, minversion),
+                      msg=msg):
+        conf.SET_TARGET_TYPE(libname, 'SYSLIB')
+        conf.env[found] = True
+        if implied_deps:
+            conf.SET_SYSLIB_DEPS(libname, implied_deps)
+        return True
+    conf.env[found] = False
+    if not conf.LIB_MAY_BE_BUNDLED(libname):
+        Logs.error('ERROR: System library %s of version %s not found, and bundling disabled' % (libname, minversion))
+        sys.exit(1)
+    return False
+
+
 @runonce
 @conf
 def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
@@ -111,14 +169,12 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
     # system version is found. That prevents possible use of mixed library
     # versions
     if onlyif:
-        for syslib in TO_LIST(onlyif):
-            f = 'FOUND_SYSTEMLIB_%s' % syslib
-            if not f in conf.env:
-                if not conf.LIB_MAY_BE_BUNDLED(libname):
-                    Logs.error('ERROR: Use of system library %s depends on missing system library %s' % (libname, syslib))
-                    sys.exit(1)
-                conf.env[found] = False
-                return False
+        if not conf.CHECK_PREREQUISITES(onlyif):
+            if not conf.LIB_MAY_BE_BUNDLED(libname):
+                Logs.error('ERROR: Use of system library %s depends on missing system library %s' % (libname, syslib))
+                sys.exit(1)
+            conf.env[found] = False
+            return False
 
     minversion = minimum_library_version(conf, libname, minversion)
 
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index e9afa93..503fa75 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -34,22 +34,10 @@ def SAMBA_PYTHON(bld, name,
 
     source = bld.EXPAND_VARIABLES(source, vars=vars)
 
-    if realname is None:
-        # a SAMBA_PYTHON target without a realname is just a
-        # library with pyembed=True
-        bld.SAMBA_LIBRARY(name,
-                          source=source,
-                          deps=deps,
-                          public_deps=public_deps,
-                          includes=includes,
-                          cflags=cflags,
-                          local_include=local_include,
-                          vars=vars,
-                          pyembed=True,
-                          enabled=enabled)
-        return
-
-    link_name = 'python/%s' % realname
+    if realname is not None:
+        link_name = 'python/%s' % realname
+    else:
+        link_name = None
 
     bld.SAMBA_LIBRARY(name,
                       source=source,
@@ -57,13 +45,14 @@ def SAMBA_PYTHON(bld, name,
                       public_deps=public_deps,
                       includes=includes,
                       cflags=cflags,
-                      realname=realname,
                       local_include=local_include,
                       vars=vars,
+                      realname=realname,
                       link_name=link_name,
-                      pyembed=True,
+                      pyext=True,
                       target_type='PYTHON',
                       install_path='${PYTHONARCHDIR}',
+                      allow_undefined_symbols=True,
                       enabled=enabled)
 
 Build.BuildContext.SAMBA_PYTHON = SAMBA_PYTHON
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 876cec5..5e4f40d 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -172,7 +172,8 @@ def SAMBA_LIBRARY(bld, libname, source,
                         autoproto_extra_source=autoproto_extra_source,
                         depends_on     = depends_on,
                         hide_symbols   = hide_symbols,
-                        pyext          = pyext or (target_type == "PYTHON"),
+                        pyembed        = pyembed,
+                        pyext          = pyext,
                         local_include  = local_include,
                         global_include = global_include)
 
@@ -211,11 +212,9 @@ def SAMBA_LIBRARY(bld, libname, source,
     ldflags = TO_LIST(ldflags)
 
     features = 'cc cshlib symlink_lib install_lib'
-    if target_type == 'PYTHON':
+    if pyext:
         features += ' pyext'
-    if pyext or pyembed:
-        # this is quite strange. we should add pyext feature for pyext
-        # but that breaks the build. This may be a bug in the waf python tool
+    if pyembed:
         features += ' pyembed'
 
     if abi_directory:
@@ -492,7 +491,8 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
                     vars=None,
                     subdir=None,
                     hide_symbols=False,
-                    pyext=False):
+                    pyext=False,
+                    pyembed=False):
     '''define a Samba subsystem'''
 
     if not enabled:
@@ -519,6 +519,8 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
     features = 'cc'
     if pyext:
         features += ' pyext'
+    if pyembed:
+        features += ' pyembed'
 
     t = bld(
         features       = features,
@@ -533,7 +535,7 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
         global_include = global_include,
         samba_subsystem= subsystem_name,
         samba_use_hostcc = use_hostcc,
-        samba_use_global_deps = use_global_deps
+        samba_use_global_deps = use_global_deps,
         )
 
     if cflags_end is not None:
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 3772871..088292c 100755
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -50,11 +50,11 @@ def configure(conf):
     conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
 
     if not conf.env.standalone_ldb:
-        if conf.CHECK_BUNDLED_SYSTEM('ldb', minversion=VERSION,
+        if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION,
                                      onlyif='talloc tdb tevent',
                                      implied_deps='replace talloc tdb tevent'):
             conf.define('USING_SYSTEM_LDB', 1)
-        if conf.CHECK_BUNDLED_SYSTEM('pyldb-util', minversion=VERSION,
+        if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
                                      onlyif='talloc tdb tevent ldb',
                                      implied_deps='replace talloc tdb tevent ldb'):
             conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
@@ -75,6 +75,8 @@ def configure(conf):
 
     conf.SAMBA_CONFIG_H()
 
+    conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+
 def build(bld):
     bld.RECURSE('lib/tdb_compat')
     bld.RECURSE('lib/tevent')
@@ -120,7 +122,7 @@ def build(bld):
                           vnum=VERSION,
                           private_library=private_library,
                           pc_files='pyldb-util.pc',
-                          pyext=True,
+                          pyembed=True,
                           abi_directory='ABI',
                           abi_match='pyldb_*')
 
diff --git a/lib/subunit/NEWS b/lib/subunit/NEWS
index 2edf736..713d272 100644
--- a/lib/subunit/NEWS
+++ b/lib/subunit/NEWS
@@ -5,6 +5,26 @@ subunit release notes
 NEXT (In development)
 ---------------------
 
+IMPROVEMENTS
+~~~~~~~~~~~~
+
+* Perl module now correctly outputs "failure" instead of "fail".  (Stewart Smith)
+
+* Shell functions now output timestamps. (Stewart Smith)
+
+BUG FIXES
+~~~~~~~~~
+
+* Add 'subunit --no-xfail', which will omit expected failures from the subunit
+  stream. (John Arbash Meinel, #623642)
+
+* Add 'subunit -F/--only-genuine-failures' which sets all of '--no-skips',
+  '--no-xfail', '--no-passthrough, '--no-success', and gives you just the
+  failure stream. (John Arbash Meinel)
+
+0.0.7
+-----
+
 The Subunit Python test runner ``python -m subunit.run`` can now report the
 test ids and also filter via a test id list file thanks to improvements in
 ``testtools.run``. See the testtools manual, or testrepository - a major
@@ -26,13 +46,9 @@ IMPROVEMENTS
 * Force flush of writes to stdout in c/tests/test_child.
   (Jelmer Vernooij, #687611)
 
-* Perl module now correctly outputs "failure" instead of "fail".  (Stewart Smith)
-
 * Provisional Python 3.x support.
   (Robert Collins, Tres Seaver, Martin[gz], #666819)
 
-* Shell functions now output timestamps. (Stewart Smith)
-
 * ``subunit.chunked.Decoder`` Python class takes a new ``strict`` option,
   which defaults to ``True``. When ``False``, the ``Decoder`` will accept
   incorrect input that is still unambiguous. i.e. subunit will not barf if
@@ -68,20 +84,11 @@ IMPROVEMENTS
 * The Python2.7 / testtools addUnexpectedSuccess API is now supported. This
   required adding a new status code to the protocol. (Robert Collins, #654474)
 
-BUG FIXES
-~~~~~~~~~
-
-* Add 'subunit --no-xfail', which will omit expected failures from the subunit
-  stream. (John Arbash Meinel, #623642)
-
-* Add 'subunit -F/--only-genuine-failures' which sets all of '--no-skips',
-  '--no-xfail', '--no-passthrough, '--no-success', and gives you just the
-  failure stream. (John Arbash Meinel)
-
 CHANGES
 ~~~~~~~
 
-* Newer testtools is needed as part of the Python 3 support. (Robert Collins)
+* testtools 0.9.11 or newer is new needed (due to the Python 3 support).
+  (Robert Collins)
 
 0.0.6
 -----
diff --git a/lib/subunit/c/wscript b/lib/subunit/c/wscript
index 3e5311d..f308b33 100644
--- a/lib/subunit/c/wscript
+++ b/lib/subunit/c/wscript
@@ -3,7 +3,7 @@
 import Options
 
 def configure(conf):
-	if conf.CHECK_BUNDLED_SYSTEM('subunit', checkfunctions='subunit_test_start', headers='subunit/child.h'):
+	if conf.CHECK_BUNDLED_SYSTEM_PKG('subunit', pkg='libsubunit'):
 		conf.define('USING_SYSTEM_SUBUNIT', 1)
 
 def build(bld):
diff --git a/lib/subunit/configure.ac b/lib/subunit/configure.ac
index 5696573..4375c37 100644
--- a/lib/subunit/configure.ac
+++ b/lib/subunit/configure.ac
@@ -1,6 +1,6 @@
 m4_define([SUBUNIT_MAJOR_VERSION], [0])
 m4_define([SUBUNIT_MINOR_VERSION], [0])
-m4_define([SUBUNIT_MICRO_VERSION], [6])
+m4_define([SUBUNIT_MICRO_VERSION], [7])
 m4_define([SUBUNIT_VERSION],
 m4_defn([SUBUNIT_MAJOR_VERSION]).m4_defn([SUBUNIT_MINOR_VERSION]).m4_defn([SUBUNIT_MICRO_VERSION]))
 AC_PREREQ([2.59])
diff --git a/lib/subunit/python/subunit/run.py b/lib/subunit/python/subunit/run.py
index 51d6837..ca5fe5c 100755
--- a/lib/subunit/python/subunit/run.py
+++ b/lib/subunit/python/subunit/run.py
@@ -23,6 +23,7 @@
 import sys
 
 from subunit import TestProtocolClient, get_default_formatter
+from subunit.test_results import AutoTimingTestResultDecorator
 from testtools.run import (
     BUFFEROUTPUT,
     CATCHBREAK,
@@ -39,6 +40,7 @@ class SubunitTestRunner(object):
     def run(self, test):
         "Run the given test case or test suite."
         result = TestProtocolClient(self.stream)
+        result = AutoTimingTestResultDecorator(result)
         test(result)
         return result
 
diff --git a/lib/subunit/python/subunit/tests/__init__.py b/lib/subunit/python/subunit/tests/__init__.py
index a78cec8..e0e1eb1 100644
--- a/lib/subunit/python/subunit/tests/__init__.py
+++ b/lib/subunit/python/subunit/tests/__init__.py
@@ -19,6 +19,7 @@ from subunit.tests import (
     test_chunked,
     test_details,
     test_progress_model,
+    test_run,
     test_subunit_filter,
     test_subunit_stats,
     test_subunit_tags,
@@ -38,4 +39,5 @@ def test_suite():
     result.addTest(test_subunit_filter.test_suite())
     result.addTest(test_subunit_tags.test_suite())
     result.addTest(test_subunit_stats.test_suite())
+    result.addTest(test_run.test_suite())
     return result
diff --git a/lib/subunit/python/subunit/tests/test_run.py b/lib/subunit/python/subunit/tests/test_run.py
new file mode 100644
index 0000000..5a96bcf
--- /dev/null
+++ b/lib/subunit/python/subunit/tests/test_run.py
@@ -0,0 +1,52 @@
+#
+#  subunit: extensions to python unittest to get test results from subprocesses.
+#  Copyright (C) 2011  Robert Collins <robertc at robertcollins.net>
+#
+#  Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
+#  license at the users choice. A copy of both licenses are available in the
+#  project source as Apache-2.0 and BSD. You may not use this file except in
+#  compliance with one of these two licences.
+#  
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
+#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+#  license you chose for the specific language governing permissions and
+#  limitations under that license.
+#
+
+from cStringIO import StringIO
+import unittest
+
+from testtools import PlaceHolder
+
+import subunit
+from subunit.run import SubunitTestRunner
+
+
+def test_suite():
+    loader = subunit.tests.TestUtil.TestLoader()
+    result = loader.loadTestsFromName(__name__)
+    return result
+
+
+class TimeCollectingTestResult(unittest.TestResult):
+
+    def __init__(self, *args, **kwargs):
+        super(TimeCollectingTestResult, self).__init__(*args, **kwargs)
+        self.time_called = []
+
+    def time(self, a_time):
+        self.time_called.append(a_time)
+
+
+class TestSubunitTestRunner(unittest.TestCase):
+
+    def test_includes_timing_output(self):
+        io = StringIO()
+        runner = SubunitTestRunner(stream=io)
+        test = PlaceHolder('name')
+        runner.run(test)
+        client = TimeCollectingTestResult()
+        io.seek(0)
+        subunit.TestProtocolServer(client).readFrom(io)
+        self.assertTrue(len(client.time_called) > 0)
diff --git a/lib/subunit/python/subunit/tests/test_test_protocol.py b/lib/subunit/python/subunit/tests/test_test_protocol.py
index 03d921a..c93aabd 100644
--- a/lib/subunit/python/subunit/tests/test_test_protocol.py
+++ b/lib/subunit/python/subunit/tests/test_test_protocol.py
@@ -22,11 +22,18 @@ from testtools import skipIf, TestCase
 from testtools.compat import _b, _u, BytesIO, StringIO
 from testtools.content import Content, TracebackContent
 from testtools.content_type import ContentType
-from testtools.tests.helpers import (
-    Python26TestResult,
-    Python27TestResult,
-    ExtendedTestResult,
-    )
+try:
+    from testtools.testresult.doubles import (
+        Python26TestResult,
+        Python27TestResult,
+        ExtendedTestResult,
+        )
+except ImportError:
+    from testtools.tests.helpers import (
+        Python26TestResult,
+        Python27TestResult,
+        ExtendedTestResult,
+        )
 
 import subunit
 from subunit import _remote_exception_str, _remote_exception_str_chunked
diff --git a/lib/subunit/setup.py b/lib/subunit/setup.py
index 2038d04..bb51a24 100755
--- a/lib/subunit/setup.py
+++ b/lib/subunit/setup.py
@@ -9,7 +9,7 @@ except ImportError:
 else:
     extra = {
         'install_requires': [
-            'testtools>=0.9.6',
+            'testtools>=0.9.11',
         ]
     }
 
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index dd83e16..447406b 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -44,10 +44,10 @@ def configure(conf):
     conf.env.disable_python = getattr(Options.options, 'disable_python', False)
 
     if not conf.env.standalone_talloc:
-        if conf.CHECK_BUNDLED_SYSTEM('talloc', minversion=VERSION,
+        if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
                                      implied_deps='replace'):
             conf.define('USING_SYSTEM_TALLOC', 1)
-        if conf.CHECK_BUNDLED_SYSTEM('pytalloc-util', minversion=VERSION,
+        if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
                                      implied_deps='talloc replace'):
             conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
 
@@ -67,6 +67,8 @@ def configure(conf):
 
     conf.SAMBA_CONFIG_H()


-- 
Samba Shared Repository


More information about the samba-cvs mailing list