annotate tests/run.py @ 326:33736e2e25f0

alternate approach for supporting svn schemes for repository paths We now intercept the operations in the local repo class, and handle the relevant operation ourselves. This frees us from wrapping all relevant commands and replicating their functionality. The implementation is incomplete; only one test has been modified to use the standard Mercurial API with the changed URLs. Once changed, those tests will likely reveal bugs or missing features in the new wrappers. Also, new wrappers will be needed for handling conversion flags such as -A/--authormap.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 07 May 2009 20:50:53 +0200
parents ce676eff002b
children 46e69be8e2c8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 import os
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2 import sys
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3 import unittest
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6
169
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents: 168
diff changeset
7 import test_binaryfiles
153
46f6b872c988 tests: Fix some missing suite definitions so that running the full testsuite
Augie Fackler <durin42@gmail.com>
parents: 126
diff changeset
8 import test_diff
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents: 169
diff changeset
9 import test_externals
117
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents: 96
diff changeset
10 import test_fetch_branches
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 import test_fetch_command
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12 import test_fetch_command_regexes
125
c35f59aa200e Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents: 117
diff changeset
13 import test_fetch_exec
168
4f26fa049452 authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents: 155
diff changeset
14 import test_fetch_mappings
67
e319c9168910 hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents: 23
diff changeset
15 import test_fetch_renames
126
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 125
diff changeset
16 import test_fetch_symlinks
88
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents: 83
diff changeset
17 import test_fetch_truncated
283
521d9c1bb11d Implement -u/--update support when pulling.
Martijn Pieters <mj@zopatista.com>
parents: 235
diff changeset
18 import test_pull
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
19 import test_push_command
83
6c9b7cf1c5aa push_cmd: delete empty svn directories, refactor directory creation
Patrick Mezard <pmezard@gmail.com>
parents: 67
diff changeset
20 import test_push_renames
6c9b7cf1c5aa push_cmd: delete empty svn directories, refactor directory creation
Patrick Mezard <pmezard@gmail.com>
parents: 67
diff changeset
21 import test_push_dirs
96
9b5e528f67f8 Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents: 88
diff changeset
22 import test_push_eol
155
ba801f44d240 utility_commands: Implement rebuildmeta so that metadata can be rebuilt.
Augie Fackler <durin42@gmail.com>
parents: 153
diff changeset
23 import test_rebuildmeta
23
1f8854804795 Add tests for tags and fix a bug in the tag-finding code that was found by the tests.
Augie Fackler <durin42@gmail.com>
parents: 17
diff changeset
24 import test_tags
153
46f6b872c988 tests: Fix some missing suite definitions so that running the full testsuite
Augie Fackler <durin42@gmail.com>
parents: 126
diff changeset
25 import test_utility_commands
235
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents: 174
diff changeset
26 import test_urls
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
27
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
28 def suite():
169
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents: 168
diff changeset
29 return unittest.TestSuite([test_binaryfiles.suite(),
f1919e1c35bf fetch_command: cancel patching when encountering binary diffs
Patrick Mezard <pmezard@gmail.com>
parents: 168
diff changeset
30 test_diff.suite(),
174
f80132c5fea5 Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents: 169
diff changeset
31 test_externals.suite(),
153
46f6b872c988 tests: Fix some missing suite definitions so that running the full testsuite
Augie Fackler <durin42@gmail.com>
parents: 126
diff changeset
32 test_fetch_branches.suite(),
117
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents: 96
diff changeset
33 test_fetch_command.suite(),
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
34 test_fetch_command_regexes.suite(),
125
c35f59aa200e Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents: 117
diff changeset
35 test_fetch_exec.suite(),
168
4f26fa049452 authormap: Add tests, fix in stupid mode.
Augie Fackler <durin42@gmail.com>
parents: 155
diff changeset
36 test_fetch_mappings.suite(),
67
e319c9168910 hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents: 23
diff changeset
37 test_fetch_renames.suite(),
126
24a64fb0e74b run.py: register and develop test_fetch_symlinks
Patrick Mezard <pmezard@gmail.com>
parents: 125
diff changeset
38 test_fetch_symlinks.suite(),
88
3b60f223893a fetch_command: handle nullid parent in stupid non-diffy mode
Patrick Mezard <pmezard@gmail.com>
parents: 83
diff changeset
39 test_fetch_truncated.suite(),
283
521d9c1bb11d Implement -u/--update support when pulling.
Martijn Pieters <mj@zopatista.com>
parents: 235
diff changeset
40 test_pull.suite(),
17
31aa63ac778c Fix a stupid mistake. A reminder of why Nose is handy.
Augie Fackler <durin42@gmail.com>
parents: 16
diff changeset
41 test_push_command.suite(),
83
6c9b7cf1c5aa push_cmd: delete empty svn directories, refactor directory creation
Patrick Mezard <pmezard@gmail.com>
parents: 67
diff changeset
42 test_push_renames.suite(),
6c9b7cf1c5aa push_cmd: delete empty svn directories, refactor directory creation
Patrick Mezard <pmezard@gmail.com>
parents: 67
diff changeset
43 test_push_dirs.suite(),
96
9b5e528f67f8 Add a test to check EOLs are correctly converted
Patrick Mezard <pmezard@gmail.com>
parents: 88
diff changeset
44 test_push_eol.suite(),
155
ba801f44d240 utility_commands: Implement rebuildmeta so that metadata can be rebuilt.
Augie Fackler <durin42@gmail.com>
parents: 153
diff changeset
45 test_rebuildmeta.suite(),
23
1f8854804795 Add tests for tags and fix a bug in the tag-finding code that was found by the tests.
Augie Fackler <durin42@gmail.com>
parents: 17
diff changeset
46 test_tags.suite(),
153
46f6b872c988 tests: Fix some missing suite definitions so that running the full testsuite
Augie Fackler <durin42@gmail.com>
parents: 126
diff changeset
47 test_utility_commands.suite(),
235
2969a20e0eef Add support for user:pass@url repositories to be hg-like
Daniel Tang <dytang@cs.purdue.edu>
parents: 174
diff changeset
48 test_urls.suite(),
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
49 ])
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
50
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
51 if __name__ == '__main__':
303
f423a8780832 Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 174
diff changeset
52 kwargs = { 'descriptions': 2 }
f423a8780832 Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 174
diff changeset
53 if '-v' in sys.argv:
f423a8780832 Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 174
diff changeset
54 kwargs['descriptions'] = 3
f423a8780832 Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 174
diff changeset
55 kwargs['verbosity'] = 2
f423a8780832 Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 174
diff changeset
56
f423a8780832 Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 174
diff changeset
57 runner = unittest.TextTestRunner(**kwargs)
16
48a44546c12f Add a basic system for running the hgsubversion tests (although not the svnwrap ones) without requiring Nose. Nose is still the recommended way to run the tests.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
58 runner.run(suite())