2018-04-09 14:39:52 +00:00
|
|
|
"""
|
|
|
|
Generate a list of test modules in the CPython distribution.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
2018-08-03 16:48:22 +00:00
|
|
|
from pathlib import Path
|
2018-04-09 14:39:52 +00:00
|
|
|
|
|
|
|
tests = []
|
|
|
|
|
2018-08-03 16:48:22 +00:00
|
|
|
TEST_DIR = Path("../cpython/build/3.6.4/host/lib/python3.6/test")
|
|
|
|
|
2018-06-15 16:30:22 +00:00
|
|
|
for root, dirs, files in os.walk(
|
|
|
|
"../cpython/build/3.6.4/host/lib/python3.6/test"):
|
2018-08-03 16:48:22 +00:00
|
|
|
root = Path(root).relative_to(TEST_DIR)
|
2018-04-09 14:39:52 +00:00
|
|
|
if root == '.':
|
|
|
|
root = ''
|
|
|
|
else:
|
|
|
|
root = '.'.join(root.split('/')) + '.'
|
|
|
|
|
|
|
|
for filename in files:
|
2018-08-03 16:48:22 +00:00
|
|
|
filename = Path(filename)
|
|
|
|
if str(filename).startswith("test_") and filename.suffix == ".py":
|
|
|
|
tests.append(root / filename.stem)
|
2018-04-09 14:39:52 +00:00
|
|
|
|
|
|
|
tests.sort()
|
|
|
|
with open("python_tests.txt", "w") as fp:
|
|
|
|
for test in tests:
|
|
|
|
fp.write(test + '\n')
|