##// END OF EJS Templates
run-tests: split tests/blacklist in tests/blacklists/*...
Nicolas Dumazet -
r10300:c437745f default
parent child Browse files
Show More
@@ -0,0 +1,14 b''
1 Put here definitions of blacklists for run-tests.py
2
3 Create a file per blacklist. Each file should list the names of tests that you
4 want to be skipped.
5 File names are meant to be used as targets for run-tests.py --blacklist
6 option.
7 Lines starting with # are ignored. White spaces are stripped.
8
9 e.g. if you create a blacklist/example file containing:
10 test-hgrc
11 # some comment
12 test-help
13 then calling "run-tests.py --blacklist blacklists/example" will exclude
14 test-hgrc and test-help from the list of tests to run.
@@ -1,37 +1,21 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.
15
16 [inotify-failures]
17 # When --inotify is activated, help output and config changes:
1 # When --inotify is activated, help output and config changes:
18 debugcomplete =
2 test-debugcomplete
19 empty =
3 test-empty
20 fncache =
4 test-fncache
21 globalopts =
5 test-globalopts
22 help =
6 test-help
23 hgrc =
7 test-hgrc
24 inherit-mode =
8 test-inherit-mode
25 qrecord =
9 test-qrecord
26 strict =
10 test-strict
27
11
28 # --inotify activates de facto the inotify extension. It does not play well
12 # --inotify activates de facto the inotify extension. It does not play well
29 # with inotify-specific tests, which activate/desactivate inotify at will:
13 # with inotify-specific tests, which activate/desactivate inotify at will:
30 inotify =
14 test-inotify
31 inotify-debuginotify =
15 test-inotify-debuginotify
32 inotify-dirty-dirstate =
16 test-inotify-dirty-dirstate
33 inotify-issue1208 =
17 test-inotify-issue1208
34 inotify-issue1371 =
18 test-inotify-issue1371
35 inotify-issue1542 =
19 test-inotify-issue1542
36 inotify-issue1556 =
20 test-inotify-issue1556
37 inotify-lookup =
21 test-inotify-lookup
@@ -41,7 +41,6 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
45 import difflib
44 import difflib
46 import errno
45 import errno
47 import optparse
46 import optparse
@@ -134,8 +133,7 b' def parseargs():'
134 parser.add_option("--inotify", action="store_true",
133 parser.add_option("--inotify", action="store_true",
135 help="enable inotify extension when running tests")
134 help="enable inotify extension when running tests")
136 parser.add_option("--blacklist", action="append",
135 parser.add_option("--blacklist", action="append",
137 help="skip tests listed in the specified section of "
136 help="skip tests listed in the specified blacklist file")
138 "the blacklist file")
139
137
140 for option, default in defaults.items():
138 for option, default in defaults.items():
141 defaults[option] = int(os.environ.get(*default))
139 defaults[option] = int(os.environ.get(*default))
@@ -202,12 +200,22 b' def parseargs():'
202 if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
200 if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
203 parser.error('--py3k-warnings can only be used on Python 2.6+')
201 parser.error('--py3k-warnings can only be used on Python 2.6+')
204 if options.blacklist:
202 if options.blacklist:
205 configparser = ConfigParser()
206 configparser.read("blacklist")
207 blacklist = dict()
203 blacklist = dict()
208 for section in options.blacklist:
204 for filename in options.blacklist:
209 for (item, value) in configparser.items(section):
205 try:
210 blacklist["test-" + item] = section
206 path = os.path.expanduser(os.path.expandvars(filename))
207 f = open(path, "r")
208 except IOError, err:
209 if err.errno != errno.ENOENT:
210 raise
211 print "warning: no such blacklist file: %s" % filename
212 continue
213
214 for line in f.readlines():
215 line = line.strip()
216 if line and not line.startswith('#'):
217 blacklist[line] = filename
218
211 options.blacklist = blacklist
219 options.blacklist = blacklist
212
220
213 return (options, args)
221 return (options, args)
@@ -744,9 +752,9 b' def runtests(options, tests):'
744
752
745 for test in tests:
753 for test in tests:
746 if options.blacklist:
754 if options.blacklist:
747 section = options.blacklist.get(test)
755 filename = options.blacklist.get(test)
748 if section is not None:
756 if filename is not None:
749 skips.append((test, "blacklisted (%s section)" % section))
757 skips.append((test, "blacklisted (%s)" % filename))
750 skipped += 1
758 skipped += 1
751 continue
759 continue
752
760
General Comments 0
You need to be logged in to leave comments. Login now