~bzr-pqm/bzr/bzr.dev

5630.2.4 by John Arbash Meinel
Basically works in the case where the dirstate isn't corrupted.
1
# Copyright (C) 2005-2011 Canonical Ltd
1831.1.1 by Martin Pool
[merge] remove default ignore list & update
2
#
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
1831.1.1 by Martin Pool
[merge] remove default ignore list & update
7
#
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
1831.1.1 by Martin Pool
[merge] remove default ignore list & update
12
#
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
16
17
18
"""Black-box tests for bzr.
19
20
These check that it behaves properly when it's invoked through the regular
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
21
command-line interface. This doesn't actually run a new interpreter but
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
22
rather starts again from the run_bzr function.
23
"""
24
1692.3.3 by Robert Collins
Get run_bzr in tests to always assign a new, clean ui factory.
25
5283.4.1 by Martin Pool
Deprecate ExternalBase.check_output and update some callers to use scripts
26
from bzrlib.symbol_versioning import (
27
    deprecated_in,
28
    deprecated_method,
29
    )
5184.1.1 by Vincent Ladeuil
Random cleanups to catch up with copyright updates in trunk.
30
from bzrlib import tests
1570.1.2 by Robert Collins
Import bzrtools' 'fix' command as 'bzr reconcile.'
31
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
32
3302.9.6 by Vincent Ladeuil
bzrlib.tests.blackbox switched from test_suite() to load_tests().
33
def load_tests(basic_tests, module, loader):
34
    suite = loader.suiteClass()
35
    # add the tests for this module
36
    suite.addTests(basic_tests)
37
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
38
    prefix = 'bzrlib.tests.blackbox.'
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
39
    testmod_names = [
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
40
                     'test_add',
41
                     'test_added',
42
                     'test_alias',
43
                     'test_aliases',
44
                     'test_ancestry',
45
                     'test_annotate',
46
                     'test_branch',
47
                     'test_break_lock',
48
                     'test_breakin',
49
                     'test_bound_branches',
50
                     'test_bundle_info',
51
                     'test_cat',
52
                     'test_cat_revision',
53
                     'test_check',
54
                     'test_checkout',
55
                     'test_clean_tree',
56
                     'test_command_encoding',
57
                     'test_commit',
5455.1.6 by Vincent Ladeuil
Merge bzr.dev
58
                     'test_config',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
59
                     'test_conflicts',
60
                     'test_debug',
61
                     'test_deleted',
62
                     'test_diff',
63
                     'test_dump_btree',
64
                     'test_dpush',
65
                     'test_exceptions',
66
                     'test_export',
67
                     'test_filesystem_cicp',
68
                     'test_filtered_view_ops',
69
                     'test_find_merge_base',
70
                     'test_help',
71
                     'test_hooks',
72
                     'test_ignore',
73
                     'test_ignored',
74
                     'test_info',
75
                     'test_init',
76
                     'test_inventory',
77
                     'test_join',
78
                     'test_locale',
79
                     'test_log',
80
                     'test_logformats',
81
                     'test_lookup_revision',
82
                     'test_ls',
83
                     'test_lsprof',
84
                     'test_merge',
85
                     'test_merge_directive',
86
                     'test_missing',
87
                     'test_modified',
88
                     'test_mv',
89
                     'test_nick',
90
                     'test_non_ascii',
91
                     'test_outside_wt',
92
                     'test_pack',
93
                     'test_pull',
94
                     'test_push',
95
                     'test_reconcile',
96
                     'test_reconfigure',
97
                     'test_reference',
98
                     'test_remerge',
99
                     'test_remove',
100
                     'test_re_sign',
101
                     'test_remove_tree',
5630.2.8 by John Arbash Meinel
Rename the command to 'repair-workingtree' as mentioned by vila.
102
                     'test_repair_workingtree',
4597.9.19 by Vincent Ladeuil
resolve now reports conflicts resolved/remaining.
103
                     'test_resolve',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
104
                     'test_revert',
105
                     'test_revno',
106
                     'test_revision_history',
107
                     'test_revision_info',
108
                     'test_rmbranch',
109
                     'test_script',
110
                     'test_selftest',
111
                     'test_send',
112
                     'test_serve',
113
                     'test_shared_repository',
114
                     'test_shelve',
115
                     'test_sign_my_commits',
116
                     'test_split',
117
                     'test_status',
118
                     'test_switch',
119
                     'test_tags',
120
                     'test_testament',
121
                     'test_too_much',
122
                     'test_uncommit',
123
                     'test_unknowns',
124
                     'test_update',
125
                     'test_upgrade',
126
                     'test_version',
127
                     'test_version_info',
128
                     'test_versioning',
129
                     'test_view',
130
                     'test_whoami',
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
131
                     ]
3302.9.27 by Vincent Ladeuil
Fixed as per Ian's review.
132
    # add the tests for the sub modules
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
133
    suite.addTests(loader.loadTestsFromModuleNames(
134
            [prefix + module_name for module_name in testmod_names]))
1185.85.24 by John Arbash Meinel
Moved run_bzr_decode into TestCase
135
    return suite
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
136
137
5184.1.1 by Vincent Ladeuil
Random cleanups to catch up with copyright updates in trunk.
138
class ExternalBase(tests.TestCaseWithTransport):
5283.4.5 by Martin Pool
Update remaining subclasses of ExternalBase
139
    """Don't use this class anymore, use TestCaseWithTransport or similar"""
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
140
5283.4.1 by Martin Pool
Deprecate ExternalBase.check_output and update some callers to use scripts
141
    @deprecated_method(deprecated_in((2, 2, 0)))
1551.13.17 by Aaron Bentley
Move cat-revision tests out of test_revision_info
142
    def check_output(self, output, *args):
143
        """Verify that the expected output matches what bzr says.
144
145
        The output is supplied first, so that you can supply a variable
146
        number of arguments to bzr.
147
        """
2530.3.4 by Martin Pool
Deprecate run_bzr_captured in favour of just run_bzr
148
        self.assertEquals(self.run_bzr(*args)[0], output)