Commit 666e8d70 authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

Did some refactoring.

parent e1e7b956
...@@ -518,28 +518,26 @@ class ErrorWriter(object): ...@@ -518,28 +518,26 @@ class ErrorWriter(object):
class TestBuilder(object): class TestBuilder(object):
def __init__(self, rootdir, workdir, selectors, exclude_selectors, annotate, def __init__(self, rootdir, workdir, selectors, exclude_selectors, options,
cleanup_workdir, cleanup_sharedlibs, cleanup_failures, with_pyregr, languages, test_bugs, language_level,
with_pyregr, cython_only, languages, test_bugs, fork, language_level,
test_determinism,
common_utility_dir, pythran_dir=None, common_utility_dir, pythran_dir=None,
default_mode='run', default_mode='run',
add_embedded_test=True): add_embedded_test=False):
self.rootdir = rootdir self.rootdir = rootdir
self.workdir = workdir self.workdir = workdir
self.selectors = selectors self.selectors = selectors
self.exclude_selectors = exclude_selectors self.exclude_selectors = exclude_selectors
self.annotate = annotate self.annotate = options.annotate_source
self.cleanup_workdir = cleanup_workdir self.cleanup_workdir = options.cleanup_workdir
self.cleanup_sharedlibs = cleanup_sharedlibs self.cleanup_sharedlibs = options.cleanup_sharedlibs
self.cleanup_failures = cleanup_failures self.cleanup_failures = options.cleanup_failures
self.with_pyregr = with_pyregr self.with_pyregr = with_pyregr
self.cython_only = cython_only self.cython_only = options.cython_only
self.languages = languages self.languages = languages
self.test_bugs = test_bugs self.test_bugs = test_bugs
self.fork = fork self.fork = options.fork
self.language_level = language_level self.language_level = language_level
self.test_determinism = test_determinism self.test_determinism = options.test_determinism
self.common_utility_dir = common_utility_dir self.common_utility_dir = common_utility_dir
self.pythran_dir = pythran_dir self.pythran_dir = pythran_dir
self.default_mode = default_mode self.default_mode = default_mode
...@@ -2134,25 +2132,16 @@ def runtests(options, cmd_args, coverage=None): ...@@ -2134,25 +2132,16 @@ def runtests(options, cmd_args, coverage=None):
if options.filetests and languages: if options.filetests and languages:
filetests = TestBuilder(ROOTDIR, WORKDIR, selectors, exclude_selectors, filetests = TestBuilder(ROOTDIR, WORKDIR, selectors, exclude_selectors,
options.annotate_source, options.cleanup_workdir, options, options.pyregr, languages, test_bugs,
options.cleanup_sharedlibs, options.cleanup_failures, options.language_level, common_utility_dir,
options.pyregr, options.pythran_dir, add_embedded_test=True)
options.cython_only, languages, test_bugs,
options.fork, options.language_level,
options.test_determinism,
common_utility_dir, options.pythran_dir)
test_suite.addTest(filetests.build_suite()) test_suite.addTest(filetests.build_suite())
if options.examples and languages: if options.examples and languages:
filetests = TestBuilder(options.examples_dir, WORKDIR, selectors, exclude_selectors, filetests = TestBuilder(options.examples_dir, WORKDIR, selectors, exclude_selectors,
options.annotate_source, options.cleanup_workdir, options, options.pyregr, languages, test_bugs,
options.cleanup_sharedlibs, options.cleanup_failures, options.language_level, common_utility_dir,
options.pyregr, options.pythran_dir,
options.cython_only, languages, test_bugs, default_mode='compile')
options.fork, options.language_level,
options.test_determinism,
common_utility_dir, options.pythran_dir,
default_mode='compile',
add_embedded_test=False)
test_suite.addTest(filetests.build_suite()) test_suite.addTest(filetests.build_suite())
if options.system_pyregr and languages: if options.system_pyregr and languages:
...@@ -2161,13 +2150,9 @@ def runtests(options, cmd_args, coverage=None): ...@@ -2161,13 +2150,9 @@ def runtests(options, cmd_args, coverage=None):
sys_pyregr_dir = os.path.join(os.path.dirname(sys.executable), 'Lib', 'test') # source build sys_pyregr_dir = os.path.join(os.path.dirname(sys.executable), 'Lib', 'test') # source build
if os.path.isdir(sys_pyregr_dir): if os.path.isdir(sys_pyregr_dir):
filetests = TestBuilder(ROOTDIR, WORKDIR, selectors, exclude_selectors, filetests = TestBuilder(ROOTDIR, WORKDIR, selectors, exclude_selectors,
options.annotate_source, options.cleanup_workdir, options, True, languages, test_bugs,
options.cleanup_sharedlibs, options.cleanup_failures, sys.version_info[0], common_utility_dir,
True, add_embedded_test=True)
options.cython_only, languages, test_bugs,
options.fork, sys.version_info[0],
options.test_determinism,
common_utility_dir)
sys.stderr.write("Including CPython regression tests in %s\n" % sys_pyregr_dir) sys.stderr.write("Including CPython regression tests in %s\n" % sys_pyregr_dir)
test_suite.addTest(filetests.handle_directory(sys_pyregr_dir, 'pyregr')) test_suite.addTest(filetests.handle_directory(sys_pyregr_dir, 'pyregr'))
......
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