• Home
  • Raw
  • Download

Lines Matching refs:lines

100 def consume_non_diagnositic(lines: List[str]) -> None:
101 while lines and not TAP_ENTRIES.match(lines[0]):
102 lines.pop(0)
104 def save_non_diagnositic(lines: List[str], test_case: TestCase) -> None:
105 while lines and not TAP_ENTRIES.match(lines[0]):
106 test_case.log.append(lines[0])
107 lines.pop(0)
115 def parse_ok_not_ok_test_case(lines: List[str], test_case: TestCase) -> bool:
116 save_non_diagnositic(lines, test_case)
117 if not lines:
120 line = lines[0]
122 while not match and lines:
123 line = lines.pop(0)
126 test_case.log.append(lines.pop(0))
141 def parse_diagnostic(lines: List[str], test_case: TestCase) -> bool:
142 save_non_diagnositic(lines, test_case)
143 if not lines:
145 line = lines[0]
148 test_case.log.append(lines.pop(0))
155 def parse_test_case(lines: List[str]) -> Optional[TestCase]:
157 save_non_diagnositic(lines, test_case)
158 while parse_diagnostic(lines, test_case):
160 if parse_ok_not_ok_test_case(lines, test_case):
167 def parse_subtest_header(lines: List[str]) -> Optional[str]:
168 consume_non_diagnositic(lines)
169 if not lines:
171 match = SUBTEST_HEADER.match(lines[0])
173 lines.pop(0)
180 def parse_subtest_plan(lines: List[str]) -> Optional[int]:
181 consume_non_diagnositic(lines)
182 match = SUBTEST_PLAN.match(lines[0])
184 lines.pop(0)
201 def parse_ok_not_ok_test_suite(lines: List[str],
204 consume_non_diagnositic(lines)
205 if not lines:
208 line = lines[0]
211 lines.pop(0)
234 def parse_test_suite(lines: List[str], expected_suite_index: int) -> Optional[TestSuite]:
235 if not lines:
237 consume_non_diagnositic(lines)
240 name = parse_subtest_header(lines)
244 expected_test_case_num = parse_subtest_plan(lines)
248 test_case = parse_test_case(lines)
253 if parse_ok_not_ok_test_suite(lines, test_suite, expected_suite_index):
256 elif not lines:
260 print('failed to parse end of suite' + lines[0])
265 def parse_tap_header(lines: List[str]) -> bool:
266 consume_non_diagnositic(lines)
267 if TAP_HEADER.match(lines[0]):
268 lines.pop(0)
275 def parse_test_plan(lines: List[str]) -> Optional[int]:
276 consume_non_diagnositic(lines)
277 match = TEST_PLAN.match(lines[0])
279 lines.pop(0)
287 def parse_test_result(lines: List[str]) -> TestResult:
288 consume_non_diagnositic(lines)
289 if not lines or not parse_tap_header(lines):
290 return TestResult(TestStatus.NO_TESTS, [], lines)
291 expected_test_suite_num = parse_test_plan(lines)
293 return TestResult(TestStatus.FAILURE_TO_PARSE_TESTS, [], lines)
296 test_suite = parse_test_suite(lines, i)
305 test_suite = parse_test_suite(lines, -1)
310 return TestResult(bubble_up_suite_errors(test_suites), test_suites, lines)
312 return TestResult(TestStatus.NO_TESTS, [], lines)