##// 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
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
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 1 # When --inotify is activated, help output and config changes:
18 debugcomplete =
19 empty =
20 fncache =
21 globalopts =
22 help =
23 hgrc =
24 inherit-mode =
25 qrecord =
26 strict =
2 test-debugcomplete
3 test-empty
4 test-fncache
5 test-globalopts
6 test-help
7 test-hgrc
8 test-inherit-mode
9 test-qrecord
10 test-strict
27 11
28 12 # --inotify activates de facto the inotify extension. It does not play well
29 13 # with inotify-specific tests, which activate/desactivate inotify at will:
30 inotify =
31 inotify-debuginotify =
32 inotify-dirty-dirstate =
33 inotify-issue1208 =
34 inotify-issue1371 =
35 inotify-issue1542 =
36 inotify-issue1556 =
37 inotify-lookup =
14 test-inotify
15 test-inotify-debuginotify
16 test-inotify-dirty-dirstate
17 test-inotify-issue1208
18 test-inotify-issue1371
19 test-inotify-issue1542
20 test-inotify-issue1556
21 test-inotify-lookup
@@ -41,7 +41,6
41 41 # completes fairly quickly, includes both shell and Python scripts, and
42 42 # includes some scripts that run daemon processes.)
43 43
44 from ConfigParser import ConfigParser
45 44 import difflib
46 45 import errno
47 46 import optparse
@@ -134,8 +133,7 def parseargs():
134 133 parser.add_option("--inotify", action="store_true",
135 134 help="enable inotify extension when running tests")
136 135 parser.add_option("--blacklist", action="append",
137 help="skip tests listed in the specified section of "
138 "the blacklist file")
136 help="skip tests listed in the specified blacklist file")
139 137
140 138 for option, default in defaults.items():
141 139 defaults[option] = int(os.environ.get(*default))
@@ -202,12 +200,22 def parseargs():
202 200 if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
203 201 parser.error('--py3k-warnings can only be used on Python 2.6+')
204 202 if options.blacklist:
205 configparser = ConfigParser()
206 configparser.read("blacklist")
207 203 blacklist = dict()
208 for section in options.blacklist:
209 for (item, value) in configparser.items(section):
210 blacklist["test-" + item] = section
204 for filename in options.blacklist:
205 try:
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 219 options.blacklist = blacklist
212 220
213 221 return (options, args)
@@ -744,9 +752,9 def runtests(options, tests):
744 752
745 753 for test in tests:
746 754 if options.blacklist:
747 section = options.blacklist.get(test)
748 if section is not None:
749 skips.append((test, "blacklisted (%s section)" % section))
755 filename = options.blacklist.get(test)
756 if filename is not None:
757 skips.append((test, "blacklisted (%s)" % filename))
750 758 skipped += 1
751 759 continue
752 760
General Comments 0
You need to be logged in to leave comments. Login now