Lines Matching refs:tests
3 Command line tool to bisect failing CPython tests.
9 Find a reference leak in "test_os", write the list of failing tests into the
14 Load an existing list of tests from a file using -i option:
16 ./python -m test --list-cases -m FileTests test_os > tests
17 ./python -m test.bisect_cmd -i tests test_os
31 def write_tests(filename, tests):
33 for name in tests:
38 def write_output(filename, tests):
41 print("Writing %s tests into %s" % (len(tests), filename))
42 write_tests(filename, tests)
67 print("Failed to list tests: %s failed with exit code %s"
70 tests = proc.stdout.splitlines()
71 return tests
74 def run_tests(args, tests, huntrleaks=None):
77 write_tests(tmp, tests)
93 help='Test names produced by --list-tests written '
94 'into a file. If not set, run --list-tests')
97 parser.add_argument('-n', '--max-tests', type=int, default=1,
98 help='Maximum number of tests to stop the bisection '
118 tests = [line.strip() for line in fp]
120 tests = list_cases(args)
122 print("Start bisection with %s tests" % len(tests))
124 print("Bisection will stop when getting %s or less tests "
125 "(-n/--max-tests option), or after %s iterations "
128 output = write_output(args.output, tests)
134 while len(tests) > args.max_tests and iteration <= args.max_iter:
135 ntest = len(tests)
137 subtests = random.sample(tests, ntest)
139 print("[+] Iteration %s: run %s tests/%s"
140 % (iteration, len(subtests), len(tests)))
145 print("ran %s tests/%s" % (ntest, len(tests)))
149 tests = subtests
150 output = write_output(args.output, tests)
160 print("Tests (%s):" % len(tests))
161 for test in tests:
169 if len(tests) <= args.max_tests: