Lines Matching full:lines

57 	def __init__(self, lines: Iterator[Tuple[int, str]]):
58 self._lines = lines
107 return LineStream(lines=isolate_kunit_output(kernel_output))
138 def consume_non_diagnostic(lines: LineStream) -> None:
139 while lines and not TAP_ENTRIES.match(lines.peek()):
140 lines.pop()
142 def save_non_diagnostic(lines: LineStream, test_case: TestCase) -> None:
143 while lines and not TAP_ENTRIES.match(lines.peek()):
144 test_case.log.append(lines.peek())
145 lines.pop()
155 def parse_ok_not_ok_test_case(lines: LineStream, test_case: TestCase) -> bool:
156 save_non_diagnostic(lines, test_case)
157 if not lines:
160 line = lines.peek()
162 while not match and lines:
163 line = lines.pop()
166 test_case.log.append(lines.pop())
185 def parse_diagnostic(lines: LineStream, test_case: TestCase) -> bool:
186 save_non_diagnostic(lines, test_case)
187 if not lines:
189 line = lines.peek()
192 test_case.log.append(lines.pop())
200 def parse_test_case(lines: LineStream) -> Optional[TestCase]:
202 save_non_diagnostic(lines, test_case)
203 while parse_diagnostic(lines, test_case):
205 if parse_ok_not_ok_test_case(lines, test_case):
212 def parse_subtest_header(lines: LineStream) -> Optional[str]:
213 consume_non_diagnostic(lines)
214 if not lines:
216 match = SUBTEST_HEADER.match(lines.peek())
218 lines.pop()
225 def parse_subtest_plan(lines: LineStream) -> Optional[int]:
226 consume_non_diagnostic(lines)
227 match = SUBTEST_PLAN.match(lines.peek())
229 lines.pop()
246 def parse_ok_not_ok_test_suite(lines: LineStream,
249 consume_non_diagnostic(lines)
250 if not lines:
253 line = lines.peek()
256 lines.pop()
281 def parse_test_suite(lines: LineStream, expected_suite_index: int) -> Optional[TestSuite]:
282 if not lines:
284 consume_non_diagnostic(lines)
287 name = parse_subtest_header(lines)
291 expected_test_case_num = parse_subtest_plan(lines)
295 test_case = parse_test_case(lines)
300 if parse_ok_not_ok_test_suite(lines, test_suite, expected_suite_index):
303 elif not lines:
304 print_with_timestamp(red('[ERROR] ') + 'ran out of lines before end token')
307 print(f'failed to parse end of suite "{name}", at line {lines.line_number()}: {lines.peek()}')
312 def parse_tap_header(lines: LineStream) -> bool:
313 consume_non_diagnostic(lines)
314 if TAP_HEADER.match(lines.peek()):
315 lines.pop()
322 def parse_test_plan(lines: LineStream) -> Optional[int]:
323 consume_non_diagnostic(lines)
324 match = TEST_PLAN.match(lines.peek())
326 lines.pop()
334 def parse_test_result(lines: LineStream) -> TestResult:
335 consume_non_diagnostic(lines)
336 if not lines or not parse_tap_header(lines):
337 return TestResult(TestStatus.FAILURE_TO_PARSE_TESTS, [], lines)
338 expected_test_suite_num = parse_test_plan(lines)
340 return TestResult(TestStatus.NO_TESTS, [], lines)
342 return TestResult(TestStatus.FAILURE_TO_PARSE_TESTS, [], lines)
345 test_suite = parse_test_suite(lines, i)
354 test_suite = parse_test_suite(lines, -1)
359 return TestResult(bubble_up_suite_errors(test_suites), test_suites, lines)
361 return TestResult(TestStatus.NO_TESTS, [], lines)
410 lines = extract_tap_lines(kernel_output)
411 test_result = parse_test_result(lines)