Show More
@@ -0,0 +1,14 b'' | |||||
|
1 | # ConfigParser format | |||
|
2 | # Definitions of blacklists for run-tests.py | |||
|
3 | # | |||
|
4 | # Identify in config sections a list of tests you want to be skipped. | |||
|
5 | # Section names are meant to be used as targets for run-tests.py --blacklist | |||
|
6 | # option. | |||
|
7 | # "test-" prefixes should be omitted from test names. Values are not used. | |||
|
8 | # | |||
|
9 | # e.g. if your file looks like: | |||
|
10 | ## [example] | |||
|
11 | ## hgrc = | |||
|
12 | ## help = "this string is not used" | |||
|
13 | # then calling "run-tests.py --blacklist example" will exclude test-hgrc and | |||
|
14 | # test-help from the list of tests to run. |
@@ -41,6 +41,7 b'' | |||||
41 | # completes fairly quickly, includes both shell and Python scripts, and |
|
41 | # completes fairly quickly, includes both shell and Python scripts, and | |
42 | # includes some scripts that run daemon processes.) |
|
42 | # includes some scripts that run daemon processes.) | |
43 |
|
43 | |||
|
44 | from ConfigParser import ConfigParser | |||
44 | import difflib |
|
45 | import difflib | |
45 | import errno |
|
46 | import errno | |
46 | import optparse |
|
47 | import optparse | |
@@ -132,6 +133,9 b' def parseargs():' | |||||
132 | help="enable Py3k warnings on Python 2.6+") |
|
133 | help="enable Py3k warnings on Python 2.6+") | |
133 | parser.add_option("--inotify", action="store_true", |
|
134 | parser.add_option("--inotify", action="store_true", | |
134 | help="enable inotify extension when running tests") |
|
135 | help="enable inotify extension when running tests") | |
|
136 | parser.add_option("--blacklist", action="append", | |||
|
137 | help="skip tests listed in the specified section of " | |||
|
138 | "the blacklist file") | |||
135 |
|
139 | |||
136 | for option, default in defaults.items(): |
|
140 | for option, default in defaults.items(): | |
137 | defaults[option] = int(os.environ.get(*default)) |
|
141 | defaults[option] = int(os.environ.get(*default)) | |
@@ -197,6 +201,14 b' def parseargs():' | |||||
197 | if options.py3k_warnings: |
|
201 | if options.py3k_warnings: | |
198 | if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0): |
|
202 | if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0): | |
199 | parser.error('--py3k-warnings can only be used on Python 2.6+') |
|
203 | parser.error('--py3k-warnings can only be used on Python 2.6+') | |
|
204 | if options.blacklist: | |||
|
205 | configparser = ConfigParser() | |||
|
206 | configparser.read("blacklist") | |||
|
207 | blacklist = dict() | |||
|
208 | for section in options.blacklist: | |||
|
209 | for (item, value) in configparser.items(section): | |||
|
210 | blacklist["test-" + item] = section | |||
|
211 | options.blacklist = blacklist | |||
200 |
|
212 | |||
201 | return (options, args) |
|
213 | return (options, args) | |
202 |
|
214 | |||
@@ -730,6 +742,13 b' def runtests(options, tests):' | |||||
730 | fails = [] |
|
742 | fails = [] | |
731 |
|
743 | |||
732 | for test in tests: |
|
744 | for test in tests: | |
|
745 | if options.blacklist: | |||
|
746 | section = options.blacklist.get(test) | |||
|
747 | if section is not None: | |||
|
748 | skips.append((test, "blacklisted (%s section)" % section)) | |||
|
749 | skipped += 1 | |||
|
750 | continue | |||
|
751 | ||||
733 | if options.retest and not os.path.exists(test + ".err"): |
|
752 | if options.retest and not os.path.exists(test + ".err"): | |
734 | skipped += 1 |
|
753 | skipped += 1 | |
735 | continue |
|
754 | continue |
General Comments 0
You need to be logged in to leave comments.
Login now