Mercurial > hgsubversion
annotate tests/run.py @ 1175:d6296f901fc7 stable
push: update push logic to match mercurial upstream
Commit e10000369b47 in upstream Mercurial changed the checkpush function
signature. So we need to update hgsubversion accordingly.
Ran the tests against the tip of the hg repo, against a version of hg from
January before the exchange module, and against a version of hg after
pushoperations was added but before checkpush used it, and the tests passed in
all cases.
author | Durham Goode <durham@fb.com> |
---|---|
date | Wed, 09 Apr 2014 16:17:13 -0700 |
parents | 025de18d652b |
children | 4217a050a088 |
rev | line source |
---|---|
1052
025de18d652b
tests: make our test runner executable
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1047
diff
changeset
|
1 #!/usr/bin/env python |
025de18d652b
tests: make our test runner executable
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1047
diff
changeset
|
2 |
610
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
3 import optparse |
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
|
4 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
|
5 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
|
6 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
|
7 |
727
e830b592917b
tests: fix test skipping in pure unittest
Augie Fackler <durin42@gmail.com>
parents:
713
diff
changeset
|
8 import test_util |
e830b592917b
tests: fix test skipping in pure unittest
Augie Fackler <durin42@gmail.com>
parents:
713
diff
changeset
|
9 test_util.SkipTest = None |
e830b592917b
tests: fix test skipping in pure unittest
Augie Fackler <durin42@gmail.com>
parents:
713
diff
changeset
|
10 |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
11 def tests(): |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
12 import test_binaryfiles |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
13 import test_diff |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
14 import test_externals |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
15 import test_fetch_branches |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
16 import test_fetch_command |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
17 import test_fetch_command_regexes |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
18 import test_fetch_exec |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
19 import test_fetch_mappings |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
20 import test_fetch_renames |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
21 import test_fetch_symlinks |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
22 import test_fetch_truncated |
919
92bd7b3678ea
Add a changegroup hook to update svn metadata
Brad Hall <bhall@fb.com>
parents:
911
diff
changeset
|
23 import test_hooks |
987
cf53cfaaa050
Fixes bug #358. Display correct error message if a svn pre-commit hook blocks the push
Anton Agafonov <equeny@fb.com>
parents:
932
diff
changeset
|
24 import test_svn_pre_commit_hooks |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
25 import test_pull |
932
dfb3afa6c619
stupid: Fail over to full revision when a PatchError is thrown (issue294)
Tim Delaney <timothy.c.delaney@gmail.com>
parents:
922
diff
changeset
|
26 import test_pull_fallback |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
27 import test_push_command |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
28 import test_push_renames |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
29 import test_push_dirs |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
30 import test_push_eol |
911
772280aed751
Honor SVN auto-props (solves issue #186)
Ronny Voelker <ronny.voelker@googlemail.com>
parents:
886
diff
changeset
|
31 import test_push_autoprops |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
32 import test_single_dir_clone |
1047
3092b3c109a8
tests: split single directory tests that push & clone in two modules
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1043
diff
changeset
|
33 import test_single_dir_push |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
34 import test_svnwrap |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
35 import test_tags |
684
8687c5aa4f35
Add svnrev, svnpath and svnuuid keyword.
Andi Albrecht <albrecht.andi@gmail.com>
parents:
682
diff
changeset
|
36 import test_template_keywords |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
37 import test_utility_commands |
713
69c0e7c4faf9
clone: call the wrapped function (fixes #181)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
697
diff
changeset
|
38 import test_unaffected_core |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
39 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
|
40 |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
41 sys.path.append(os.path.dirname(__file__)) |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
42 sys.path.append(os.path.join(os.path.dirname(__file__), 'comprehensive')) |
426
72e63999722f
tests: make comprehensive tests work properly with nose and run.py
Augie Fackler <durin42@gmail.com>
parents:
395
diff
changeset
|
43 |
1042
af84ef787d93
tests: move updatemeta & rebuildmeta tests into comprehensive
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
987
diff
changeset
|
44 import test_rebuildmeta |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
45 import test_stupid_pull |
1042
af84ef787d93
tests: move updatemeta & rebuildmeta tests into comprehensive
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
987
diff
changeset
|
46 import test_updatemeta |
886
d3ff5807f1bd
fold test_startrev and test_verify into a new test; test_verify_and_startrev
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
833
diff
changeset
|
47 import test_verify_and_startrev |
613
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
48 |
58f397523604
testrunner: delay and `simplify' importing of tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
610
diff
changeset
|
49 return locals() |
394
d70c8e45cb9e
tests: add -A option to run.py for running comprehensive tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
393
diff
changeset
|
50 |
d70c8e45cb9e
tests: add -A option to run.py for running comprehensive tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
393
diff
changeset
|
51 def comprehensive(mod): |
d70c8e45cb9e
tests: add -A option to run.py for running comprehensive tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
393
diff
changeset
|
52 dir = os.path.basename(os.path.dirname(mod.__file__)) |
d70c8e45cb9e
tests: add -A option to run.py for running comprehensive tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
393
diff
changeset
|
53 return dir == 'comprehensive' |
d70c8e45cb9e
tests: add -A option to run.py for running comprehensive tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
393
diff
changeset
|
54 |
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
|
55 if __name__ == '__main__': |
610
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
56 description = ("This script runs the hgsubversion tests. If no tests are " |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
57 "specified, all known tests are implied.") |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
58 parser = optparse.OptionParser(usage="%prog [options] [TESTS ...]", |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
59 description=description) |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
60 parser.add_option("-A", "--all", |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
61 dest="comprehensive", action="store_true", default=False, |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
62 help="include slow, but comprehensive tests") |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
63 parser.add_option("-v", "--verbose", |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
64 dest="verbose", action="store_true", default=False, |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
65 help="enable verbose output") |
614
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
66 parser.add_option("", "--no-demandimport", |
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
67 dest="demandimport", action="store_false", default=True, |
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
68 help="disable Mercurial demandimport loading") |
682
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
69 parser.add_option("", "--bindings", |
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
70 dest="bindings", action="store", default=None, |
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
71 choices=["swig", "subvertpy"], |
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
72 help="test using the specified bindings (swig or " |
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
73 "subvertpy)") |
688
073132fc27f1
tests: add --show-stdout option to run.py
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
684
diff
changeset
|
74 parser.add_option("", "--show-stdout", |
073132fc27f1
tests: add --show-stdout option to run.py
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
684
diff
changeset
|
75 dest="showstdout", action="store_true", default=False, |
073132fc27f1
tests: add --show-stdout option to run.py
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
684
diff
changeset
|
76 help="show stdout (hidden by default)") |
357
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
77 |
610
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
78 (options, args) = parser.parse_args() |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
79 |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
80 if options.verbose: |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
81 testargs = { 'descriptions': 3, 'verbosity': 2 } |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
82 else: |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
83 testargs = {'descriptions': 2} |
303
f423a8780832
Minor tweaks to how the tests are run.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
174
diff
changeset
|
84 |
615
edd112855189
tests/run.py: make sure our hgsubversion loads correctly
Augie Fackler <durin42@gmail.com>
parents:
614
diff
changeset
|
85 sys.path.append(os.path.dirname(os.path.dirname(__file__))) |
edd112855189
tests/run.py: make sure our hgsubversion loads correctly
Augie Fackler <durin42@gmail.com>
parents:
614
diff
changeset
|
86 |
614
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
87 if options.demandimport: |
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
88 from mercurial import demandimport |
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
89 demandimport.enable() |
4f6017ba4d3d
testrunner: use demandimport, with an option to disable it
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
613
diff
changeset
|
90 |
682
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
91 if options.bindings: |
697
e9306b23d323
testrunner: don't use os.putenv(), as it may not affect os.environ.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
688
diff
changeset
|
92 os.environ['HGSUBVERSION_BINDINGS'] = options.bindings |
682
52fbb272a147
tests: add an option to the test-runner for selecting bindings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
653
diff
changeset
|
93 |
644
95abc4cfc78f
tests: improve import logic
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
629
diff
changeset
|
94 # make sure our copy of hgsubversion gets imported by loading test_util |
95abc4cfc78f
tests: improve import logic
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
629
diff
changeset
|
95 import test_util |
95abc4cfc78f
tests: improve import logic
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
629
diff
changeset
|
96 test_util.TestBase |
95abc4cfc78f
tests: improve import logic
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
629
diff
changeset
|
97 |
338
47c0110046dc
tests: silence tests when using run.py
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
337
diff
changeset
|
98 # silence output when running outside nose |
688
073132fc27f1
tests: add --show-stdout option to run.py
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
684
diff
changeset
|
99 if not options.showstdout: |
073132fc27f1
tests: add --show-stdout option to run.py
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
684
diff
changeset
|
100 import tempfile |
073132fc27f1
tests: add --show-stdout option to run.py
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
684
diff
changeset
|
101 sys.stdout = tempfile.TemporaryFile() |
338
47c0110046dc
tests: silence tests when using run.py
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
337
diff
changeset
|
102 |
833
312b37bc5e20
tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents:
727
diff
changeset
|
103 all_tests = tests() |
357
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
104 |
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
105 args = [i.split('.py')[0].replace('-', '_') for i in args] |
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
106 |
1043
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
107 loader = unittest.TestLoader() |
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
108 suite = unittest.TestSuite() |
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
109 |
357
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
110 if not args: |
610
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
111 check = lambda x: options.comprehensive or not comprehensive(x) |
1043
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
112 suite.addTests(loader.loadTestsFromModule(m) |
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
113 for (n, m) in sorted(all_tests.iteritems()) |
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
114 if check(m)) |
357
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
115 else: |
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
116 for arg in args: |
610
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
117 if arg == 'test_util': |
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
118 continue |
833
312b37bc5e20
tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents:
727
diff
changeset
|
119 elif arg not in all_tests: |
393
e857e5cfc10f
tests: send warning to stderr instead of redirected stdout
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
357
diff
changeset
|
120 print >> sys.stderr, 'test module %s not available' % arg |
357
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
121 else: |
1043
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
122 suite.addTest(loader.loadTestsFromModule(all_tests[arg])) |
357
d19843ac13c9
Allow passing in module arguments to the test runs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
347
diff
changeset
|
123 |
610
300b917d23c5
testrunner: use optparse
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
577
diff
changeset
|
124 runner = unittest.TextTestRunner(**testargs) |
1043
69a9fb45cad5
tests: consolidate all test-loading into the test runner
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1042
diff
changeset
|
125 result = runner.run(suite) |
571
f3e5ef8760cb
tests.run: exit nonzero if tests did not pass
Augie Fackler <durin42@gmail.com>
parents:
426
diff
changeset
|
126 if not result.wasSuccessful(): |
f3e5ef8760cb
tests.run: exit nonzero if tests did not pass
Augie Fackler <durin42@gmail.com>
parents:
426
diff
changeset
|
127 sys.exit(1) |