Commit 4a1b44e5 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Split test_lib2to3 into small and large variants

and only run the small variant in debug mode to avoid timeouts.
Previously I had tried splitting it in half, but it looks like that's
both not enough to avoid timeouts, and it also has a race condition when
trying to run two copies of the test at the same time (one will read the
not-fully-written pickled output of the other).
parent 2522afa3
# skip-if: not IS_OPTIMIZED
# Skipping test_parser and test_all_fixers # Skipping test_parser and test_all_fixers
# because of running # because of running
from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor, from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
......
../../from_cpython/Lib/test/test_lib2to3.py
\ No newline at end of file
# Skipping test_parser and test_all_fixers
# because of running
from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
test_parser, test_main as test_main_)
import unittest
from test.test_support import run_unittest
def suite():
tests = unittest.TestSuite()
loader = unittest.TestLoader()
for m in (test_refactor, test_parser, test_main_):
tests.addTests(loader.loadTestsFromModule(m))
return tests
def test_main():
run_unittest(suite())
if __name__ == '__main__':
test_main()
# skip-if: IS_OPTIMIZED
# Skipping test_parser and test_all_fixers # Skipping test_parser and test_all_fixers
# because of running # because of running
from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor, from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
...@@ -8,7 +9,7 @@ from test.test_support import run_unittest ...@@ -8,7 +9,7 @@ from test.test_support import run_unittest
def suite(): def suite():
tests = unittest.TestSuite() tests = unittest.TestSuite()
loader = unittest.TestLoader() loader = unittest.TestLoader()
for m in (test_fixers, test_pytree, test_util): for m in (test_parser,):
tests.addTests(loader.loadTestsFromModule(m)) tests.addTests(loader.loadTestsFromModule(m))
return tests return tests
......
...@@ -514,6 +514,7 @@ def main(orig_dir): ...@@ -514,6 +514,7 @@ def main(orig_dir):
global EXTMODULE_DIR_PYSTON global EXTMODULE_DIR_PYSTON
global EXTMODULE_DIR global EXTMODULE_DIR
global DISPLAY_SUCCESSES global DISPLAY_SUCCESSES
global IS_OPTIMIZED
run_memcheck = False run_memcheck = False
...@@ -537,6 +538,8 @@ def main(orig_dir): ...@@ -537,6 +538,8 @@ def main(orig_dir):
EXTMODULE_DIR = os.path.abspath(os.path.dirname(os.path.realpath(IMAGE)) + "/test/test_extension/build/lib.linux-x86_64-2.7/") EXTMODULE_DIR = os.path.abspath(os.path.dirname(os.path.realpath(IMAGE)) + "/test/test_extension/build/lib.linux-x86_64-2.7/")
patterns = opts.pattern patterns = opts.pattern
IS_OPTIMIZED = int(subprocess.check_output([IMAGE, "-c", 'import sysconfig; print int("-O0" not in sysconfig.get_config_var(\"CFLAGS\"))']))
if not patterns and not TESTS_TO_SKIP: if not patterns and not TESTS_TO_SKIP:
TESTS_TO_SKIP = ["t", "t2", "t3"] TESTS_TO_SKIP = ["t", "t2", "t3"]
......
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