2360
2360
modified by plugins will not be tested, and tests provided by plugins will
2363
Tests that need working space on disk use a common temporary directory,
2364
typically inside $TMPDIR or /tmp.
2364
2367
bzr selftest ignore
2365
2368
run only tests relating to 'ignore'
2366
2369
bzr --no-plugins selftest -v
2367
2370
disable plugins and list tests as they're run
2369
For each test, that needs actual disk access, bzr create their own
2370
subdirectory in the temporary testing directory (testXXXX.tmp).
2371
By default the name of such subdirectory is based on the name of the test.
2372
If option '--numbered-dirs' is given, bzr will use sequent numbers
2373
of running tests to create such subdirectories. This is default behavior
2374
on Windows because of path length limitation.
2376
2372
# NB: this is used from the class without creating an instance, which is
2377
2373
# why it does not have a self parameter.
2397
2393
help='stop when one test fails',
2398
2394
short_name='1',
2400
Option('keep-output',
2401
help='keep output directories when tests fail'),
2402
2396
Option('transport',
2403
2397
help='Use a different transport by default '
2404
2398
'throughout the test suite.',
2410
2404
Option('cache-dir', type=str,
2411
2405
help='a directory to cache intermediate'
2412
2406
' benchmark steps'),
2413
Option('clean-output',
2414
help='clean temporary tests directories'
2415
' without running tests'),
2416
2407
Option('first',
2417
2408
help='run all tests, but run specified tests first',
2418
2409
short_name='f',
2420
Option('numbered-dirs',
2421
help='use numbered dirs for TestCaseInTempDir'),
2422
2411
Option('list-only',
2423
2412
help='list the tests instead of running them'),
2424
2413
Option('randomize', type=str, argname="SEED",
2432
2421
encoding_type = 'replace'
2434
2423
def run(self, testspecs_list=None, verbose=None, one=False,
2435
keep_output=False, transport=None, benchmark=None,
2436
lsprof_timed=None, cache_dir=None, clean_output=False,
2437
first=False, numbered_dirs=None, list_only=False,
2424
transport=None, benchmark=None,
2425
lsprof_timed=None, cache_dir=None,
2426
first=False, list_only=False,
2438
2427
randomize=None, exclude=None):
2439
2428
import bzrlib.ui
2440
2429
from bzrlib.tests import selftest
2441
2430
import bzrlib.benchmarks as benchmarks
2442
2431
from bzrlib.benchmarks import tree_creator
2445
from bzrlib.tests import clean_selftest_output
2446
clean_selftest_output()
2449
warning("notice: selftest --keep-output "
2450
"is no longer supported; "
2451
"test output is always removed")
2453
if numbered_dirs is None and sys.platform == 'win32':
2454
numbered_dirs = True
2456
2433
if cache_dir is not None:
2457
2434
tree_creator.TreeCreator.CACHE_ROOT = osutils.abspath(cache_dir)
2458
2435
print '%10s: %s' % ('bzr', osutils.realpath(sys.argv[0]))
2474
2451
verbose = False
2475
2452
benchfile = None
2477
result = selftest(verbose=verbose,
2454
result = selftest(verbose=verbose,
2478
2455
pattern=pattern,
2479
stop_on_failure=one,
2456
stop_on_failure=one,
2480
2457
transport=transport,
2481
2458
test_suite_factory=test_suite_factory,
2482
2459
lsprof_timed=lsprof_timed,
2483
2460
bench_history=benchfile,
2484
2461
matching_tests_first=first,
2485
numbered_dirs=numbered_dirs,
2486
2462
list_only=list_only,
2487
2463
random_seed=randomize,
2488
2464
exclude_pattern=exclude