Index: AUTHORS
===================================================================
--- AUTHORS	(revision 16338)
+++ AUTHORS	(working copy)
@@ -535,6 +535,8 @@
     Cheng Zhang
     Zlatko Mašek <zlatko.masek@gmail.com>
     Ryan Niemeyer <https://profiles.google.com/ryan.niemeyer/about>
+    Mikołaj Siedlarek <mikolaj.siedlarek@gmail.com>
+    Dmitry Jemerov <intelliyole@gmail.com>
 
 A big THANK YOU goes to:
 
Index: docs/topics/testing.txt
===================================================================
--- docs/topics/testing.txt	(revision 16338)
+++ docs/topics/testing.txt	(working copy)
@@ -1744,6 +1744,27 @@
     write your own test runner, ensure accept and handle the ``**kwargs``
     parameter.
 
+    .. versionadded:: 1.4
+
+    Your test runner may define some command-line options which will be fed
+    into the ``OptionParser`` of ``test`` management command. If you need such
+    functionality, see the ``option_list`` attribute. Options you declare
+    will be provided to your test runner's constructor as additional keyword
+    arguments.
+
+Attributes
+~~~~~~~~~~
+
+.. versionadded:: 1.4
+
+.. attribute:: DjangoTestSuiteRunner.option_list
+
+    This is the tuple of ``optparse`` options which will be fed into the management
+    command's ``OptionParser`` for parsing arguments.
+
+Methods
+~~~~~~~
+
 .. method:: DjangoTestSuiteRunner.run_tests(test_labels, extra_tests=None, **kwargs)
 
     Run the test suite.
Index: docs/ref/django-admin.txt
===================================================================
--- docs/ref/django-admin.txt	(revision 16338)
+++ docs/ref/django-admin.txt	(working copy)
@@ -964,6 +964,12 @@
 Use the :djadminopt:`--failfast` option to stop running tests and report the failure
 immediately after a test fails.
 
+.. versionadded:: 1.4
+.. django-admin-option:: --testrunner
+
+The :djandminopt:`--testrunner` option can be used to override the test runner class
+specified by the :setting:`TEST_RUNNER` setting.
+
 testserver <fixture fixture ...>
 --------------------------------
 
Index: django/test/utils.py
===================================================================
--- django/test/utils.py	(revision 16338)
+++ django/test/utils.py	(working copy)
@@ -118,8 +118,11 @@
     warnings.filters = state[:]
 
 
-def get_runner(settings):
-    test_path = settings.TEST_RUNNER.split('.')
+def get_runner(settings, test_runner_class=None):
+    if not test_runner_class:
+        test_runner_class = settings.TEST_RUNNER
+
+    test_path = test_runner_class.split('.')
     # Allow for Python 2.5 relative paths
     if len(test_path) > 1:
         test_module_name = '.'.join(test_path[:-1])
Index: django/core/management/commands/test.py
===================================================================
--- django/core/management/commands/test.py	(revision 16338)
+++ django/core/management/commands/test.py	(working copy)
@@ -1,29 +1,56 @@
+from django.conf import settings
 from django.core.management.base import BaseCommand
-from optparse import make_option
+from optparse import make_option, OptionParser
 import sys
+from django.test.utils import get_runner
 
 class Command(BaseCommand):
     option_list = BaseCommand.option_list + (
         make_option('--noinput', action='store_false', dest='interactive', default=True,
             help='Tells Django to NOT prompt the user for input of any kind.'),
         make_option('--failfast', action='store_true', dest='failfast', default=False,
-            help='Tells Django to stop running the test suite after first failed test.')
+            help='Tells Django to stop running the test suite after first failed test.'),
+        make_option('--testrunner', action='store', dest='testrunner',
+            help='Tells Django to use specified test runner class instead of the one '+
+                 'specified by the TEST_RUNNER setting.')
     )
     help = 'Runs the test suite for the specified applications, or the entire site if no apps are specified.'
     args = '[appname ...]'
 
     requires_model_validation = False
 
+    def run_from_argv(self, argv):
+        """
+        Pre-parse the command line to extract the value of the --testrunner
+        option. This allows a test runner to define additional command line
+        arguments.
+        """
+        self.test_runner = None
+        option = '--testrunner='
+        for arg in argv[2:]:
+            if arg.startswith(option):
+                self.test_runner = arg[len(option):]
+                break
+        super(Command, self).run_from_argv(argv)
+
+    def create_parser(self, prog_name, subcommand):
+        test_runner_class = get_runner(settings, self.test_runner)
+        options = self.option_list + getattr(test_runner_class, 'option_list', ())
+        return OptionParser(prog=prog_name,
+                            usage=self.usage(subcommand),
+                            version=self.get_version(),
+                            option_list=options)
+
     def handle(self, *test_labels, **options):
         from django.conf import settings
         from django.test.utils import get_runner
 
-        verbosity = int(options.get('verbosity', 1))
-        interactive = options.get('interactive', True)
-        failfast = options.get('failfast', False)
-        TestRunner = get_runner(settings)
+        TestRunner = get_runner(settings, options.get('testrunner'))
+        options['verbosity'] = int(options.get('verbosity', 1))
+        options.setdefault('interactive', True)
+        options.setdefault('failfast', False)
 
-        test_runner = TestRunner(verbosity=verbosity, interactive=interactive, failfast=failfast)
+        test_runner = TestRunner(**options)
         failures = test_runner.run_tests(test_labels)
 
         if failures:
Index: tests/regressiontests/test_runner/tests.py
===================================================================
--- tests/regressiontests/test_runner/tests.py	(revision 16338)
+++ tests/regressiontests/test_runner/tests.py	(working copy)
@@ -2,12 +2,15 @@
 Tests for django test runner
 """
 import StringIO
+from optparse import make_option
 import warnings
 
 from django.core.exceptions import ImproperlyConfigured
+from django.core.management import call_command
 from django.test import simple
 from django.test.utils import get_warnings_state, restore_warnings_state
 from django.utils import unittest
+from regressiontests.admin_scripts.tests import AdminScriptTestCase
 
 
 class DjangoTestRunnerTests(unittest.TestCase):
@@ -128,3 +131,75 @@
 
         self.assertRaises(ImproperlyConfigured, simple.dependency_ordered, raw, dependencies=dependencies)
 
+
+class MockTestRunner(object):
+    invoked = False
+
+    def __init__(self, *args, **kwargs):
+        pass
+    
+    def run_tests(self, test_labels, extra_tests=None, **kwargs):
+        MockTestRunner.invoked = True
+
+
+class ManageCommandTests(unittest.TestCase):
+
+    def test_custom_test_runner(self):
+        call_command('test', 'sites',
+                     testrunner='regressiontests.test_runner.tests.MockTestRunner')
+        self.assertTrue(MockTestRunner.invoked,
+                        "The custom test runner has not been invoked")
+
+
+class CustomOptionsTestRunner(simple.DjangoTestSuiteRunner):
+    option_list = (
+        make_option('--option_a','-a', action='store', dest='option_a', default='1'),
+        make_option('--option_b','-b', action='store', dest='option_b', default='2'),
+        make_option('--option_c','-c', action='store', dest='option_c', default='3'),
+    )
+
+    def __init__(self, verbosity=1, interactive=True, failfast=True, option_a=None, option_b=None, option_c=None, **kwargs):
+        super(CustomOptionsTestRunner, self).__init__(verbosity=verbosity, interactive=interactive,
+                                                      failfast=failfast)
+        self.option_a = option_a
+        self.option_b = option_b
+        self.option_c = option_c
+
+    def run_tests(self, test_labels, extra_tests=None, **kwargs):
+        print "%s:%s:%s" % (self.option_a, self.option_b, self.option_c)
+
+
+class CustomTestRunnerOptionsTests(AdminScriptTestCase):
+
+    def setUp(self):
+        settings = {
+            'TEST_RUNNER': '\'regressiontests.test_runner.tests.CustomOptionsTestRunner\'',
+        }
+        self.write_settings('settings.py', sdict=settings)
+
+    def tearDown(self):
+        self.remove_settings('settings.py')
+
+    def test_default_options(self):
+        args = ['test', '--settings=settings']
+        out, err = self.run_django_admin(args)
+        self.assertNoOutput(err)
+        self.assertOutput(out, '1:2:3')
+
+    def test_default_and_given_options(self):
+        args = ['test', '--settings=settings', '--option_b=foo']
+        out, err = self.run_django_admin(args)
+        self.assertNoOutput(err)
+        self.assertOutput(out, '1:foo:3')
+
+    def test_option_name_and_value_separated(self):
+        args = ['test', '--settings=settings', '--option_b', 'foo']
+        out, err = self.run_django_admin(args)
+        self.assertNoOutput(err)
+        self.assertOutput(out, '1:foo:3')
+
+    def test_all_options_given(self):
+        args = ['test', '--settings=settings', '--option_a=bar', '--option_b=foo', '--option_c=31337']
+        out, err = self.run_django_admin(args)
+        self.assertNoOutput(err)
+        self.assertOutput(out, 'bar:foo:31337')
