Rev 4003: Allow extra options to bzrlib.tests.selftest from plugins. in http://people.ubuntu.com/~robertc/baz2.0/test-result-registry

Robert Collins robertc at robertcollins.net
Wed Feb 11 23:47:00 GMT 2009


At http://people.ubuntu.com/~robertc/baz2.0/test-result-registry

------------------------------------------------------------
revno: 4003
revision-id: robertc at robertcollins.net-20090211234655-zbnw36me1zfzorv0
parent: robertc at robertcollins.net-20090211222518-32dloushiwrnzurr
committer: Robert Collins <robertc at robertcollins.net>
branch nick: test-result-registry
timestamp: Thu 2009-02-12 10:46:55 +1100
message:
  Allow extra options to bzrlib.tests.selftest from plugins.
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2009-02-11 00:29:57 +0000
+++ b/bzrlib/builtins.py	2009-02-11 23:46:55 +0000
@@ -2912,6 +2912,10 @@
                      ]
     encoding_type = 'replace'
 
+    def __init__(self):
+        Command.__init__(self)
+        self.additional_selftest_args = {}
+
     def run(self, testspecs_list=None, verbose=False, one=False,
             transport=None, benchmark=None,
             lsprof_timed=None, cache_dir=None,
@@ -2949,22 +2953,24 @@
             test_suite_factory = None
             benchfile = None
         try:
-            result = selftest(verbose=verbose,
-                              pattern=pattern,
-                              stop_on_failure=one,
-                              transport=transport,
-                              test_suite_factory=test_suite_factory,
-                              lsprof_timed=lsprof_timed,
-                              bench_history=benchfile,
-                              matching_tests_first=first,
-                              list_only=list_only,
-                              random_seed=randomize,
-                              exclude_pattern=exclude,
-                              strict=strict,
-                              load_list=load_list,
-                              debug_flags=debugflag,
-                              starting_with=starting_with,
-                              )
+            selftest_kwargs = {"verbose":verbose,
+                              "pattern":pattern,
+                              "stop_on_failure":one,
+                              "transport":transport,
+                              "test_suite_factory":test_suite_factory,
+                              "lsprof_timed":lsprof_timed,
+                              "bench_history":benchfile,
+                              "matching_tests_first":first,
+                              "list_only":list_only,
+                              "random_seed":randomize,
+                              "exclude_pattern":exclude,
+                              "strict":strict,
+                              "load_list":load_list,
+                              "debug_flags":debugflag,
+                              "starting_with":starting_with
+                              }
+            selftest_kwargs.update(self.additional_selftest_args)
+            result = selftest(**selftest_kwargs)
         finally:
             if benchfile is not None:
                 benchfile.close()

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2009-02-11 22:25:18 +0000
+++ b/bzrlib/tests/__init__.py	2009-02-11 23:46:55 +0000
@@ -2565,6 +2565,7 @@
              load_list=None,
              debug_flags=None,
              starting_with=None,
+             runner_class=None,
              ):
     """Run the whole test suite under the enhanced runner"""
     # XXX: Very ugly way to do this...
@@ -2600,7 +2601,9 @@
                      list_only=list_only,
                      random_seed=random_seed,
                      exclude_pattern=exclude_pattern,
-                     strict=strict)
+                     strict=strict,
+                     runner_class=runner_class,
+                     )
     finally:
         default_transport = old_transport
         selftest_debug_flags = old_debug_flags




More information about the bazaar-commits mailing list