Commit c0fdd369 authored by Robert Bradshaw's avatar Robert Bradshaw

Use bugs list instead of bugs directory.

parent 96928c33
...@@ -10,7 +10,7 @@ from distutils.command.build_ext import build_ext as _build_ext ...@@ -10,7 +10,7 @@ from distutils.command.build_ext import build_ext as _build_ext
distutils_distro = Distribution() distutils_distro = Distribution()
TEST_DIRS = ['compile', 'errors', 'run', 'pyregr'] TEST_DIRS = ['compile', 'errors', 'run', 'pyregr']
TEST_RUN_DIRS = ['run', 'pyregr', 'bugs'] TEST_RUN_DIRS = ['run', 'pyregr']
# Lists external modules, and a matcher matching tests # Lists external modules, and a matcher matching tests
# which should be excluded if the module is not present. # which should be excluded if the module is not present.
...@@ -91,8 +91,6 @@ class TestBuilder(object): ...@@ -91,8 +91,6 @@ class TestBuilder(object):
def build_suite(self): def build_suite(self):
suite = unittest.TestSuite() suite = unittest.TestSuite()
test_dirs = TEST_DIRS test_dirs = TEST_DIRS
if self.test_bugs and 'bugs' not in test_dirs:
test_dirs.append('bugs')
filenames = os.listdir(self.rootdir) filenames = os.listdir(self.rootdir)
filenames.sort() filenames.sort()
for filename in filenames: for filename in filenames:
...@@ -466,6 +464,18 @@ class VersionDependencyExcluder: ...@@ -466,6 +464,18 @@ class VersionDependencyExcluder:
return True return True
return False return False
class FileListExcluder:
def __init__(self, list_file):
self.excludes = {}
for line in open(list_file).readlines():
line = line.strip()
if line and line[0] != '#':
self.excludes[line.split()[0]] = True
def __call__(self, testname):
return testname.split('.')[-1] in self.excludes
if __name__ == '__main__': if __name__ == '__main__':
from optparse import OptionParser from optparse import OptionParser
parser = OptionParser() parser = OptionParser()
...@@ -583,7 +593,7 @@ if __name__ == '__main__': ...@@ -583,7 +593,7 @@ if __name__ == '__main__':
if options.tickets: if options.tickets:
for ticket_number in options.tickets: for ticket_number in options.tickets:
test_bugs = True test_bugs = True
cmd_args.append('bugs.*T%s$' % ticket_number) cmd_args.append('.*T%s$' % ticket_number)
if not test_bugs: if not test_bugs:
for selector in cmd_args: for selector in cmd_args:
if selector.startswith('bugs'): if selector.startswith('bugs'):
...@@ -604,6 +614,9 @@ if __name__ == '__main__': ...@@ -604,6 +614,9 @@ if __name__ == '__main__':
if options.exclude: if options.exclude:
exclude_selectors += [ re.compile(r, re.I|re.U).search for r in options.exclude ] exclude_selectors += [ re.compile(r, re.I|re.U).search for r in options.exclude ]
if not test_bugs:
exclude_selectors += [ FileListExcluder("tests/bugs.txt") ]
languages = [] languages = []
if options.use_c: if options.use_c:
languages.append('c') languages.append('c')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment