Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kunit: tool: Fix spelling of "diagnostic" in kunit_parser

Various helper functions were misspelling "diagnostic" in their names.
It finally got annoying, so fix it.

Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

David Gow and committed by
Shuah Khan
ebfd4488 65a4e529

+12 -12
+12 -12
tools/testing/kunit/kunit_parser.py
··· 97 97 98 98 TAP_ENTRIES = re.compile(r'^(TAP|[\s]*ok|[\s]*not ok|[\s]*[0-9]+\.\.[0-9]+|[\s]*#).*$') 99 99 100 - def consume_non_diagnositic(lines: List[str]) -> None: 100 + def consume_non_diagnostic(lines: List[str]) -> None: 101 101 while lines and not TAP_ENTRIES.match(lines[0]): 102 102 lines.pop(0) 103 103 104 - def save_non_diagnositic(lines: List[str], test_case: TestCase) -> None: 104 + def save_non_diagnostic(lines: List[str], test_case: TestCase) -> None: 105 105 while lines and not TAP_ENTRIES.match(lines[0]): 106 106 test_case.log.append(lines[0]) 107 107 lines.pop(0) ··· 113 113 OK_NOT_OK_MODULE = re.compile(r'^(ok|not ok) ([0-9]+) - (.*)$') 114 114 115 115 def parse_ok_not_ok_test_case(lines: List[str], test_case: TestCase) -> bool: 116 - save_non_diagnositic(lines, test_case) 116 + save_non_diagnostic(lines, test_case) 117 117 if not lines: 118 118 test_case.status = TestStatus.TEST_CRASHED 119 119 return True ··· 139 139 DIAGNOSTIC_CRASH_MESSAGE = re.compile(r'^[\s]+# .*?: kunit test case crashed!$') 140 140 141 141 def parse_diagnostic(lines: List[str], test_case: TestCase) -> bool: 142 - save_non_diagnositic(lines, test_case) 142 + save_non_diagnostic(lines, test_case) 143 143 if not lines: 144 144 return False 145 145 line = lines[0] ··· 155 155 156 156 def parse_test_case(lines: List[str]) -> Optional[TestCase]: 157 157 test_case = TestCase() 158 - save_non_diagnositic(lines, test_case) 158 + save_non_diagnostic(lines, test_case) 159 159 while parse_diagnostic(lines, test_case): 160 160 pass 161 161 if parse_ok_not_ok_test_case(lines, test_case): ··· 166 166 SUBTEST_HEADER = re.compile(r'^[\s]+# Subtest: (.*)$') 167 167 168 168 def parse_subtest_header(lines: List[str]) -> Optional[str]: 169 - consume_non_diagnositic(lines) 169 + consume_non_diagnostic(lines) 170 170 if not lines: 171 171 return None 172 172 match = SUBTEST_HEADER.match(lines[0]) ··· 179 179 SUBTEST_PLAN = re.compile(r'[\s]+[0-9]+\.\.([0-9]+)') 180 180 181 181 def parse_subtest_plan(lines: List[str]) -> Optional[int]: 182 - consume_non_diagnositic(lines) 182 + consume_non_diagnostic(lines) 183 183 match = SUBTEST_PLAN.match(lines[0]) 184 184 if match: 185 185 lines.pop(0) ··· 202 202 def parse_ok_not_ok_test_suite(lines: List[str], 203 203 test_suite: TestSuite, 204 204 expected_suite_index: int) -> bool: 205 - consume_non_diagnositic(lines) 205 + consume_non_diagnostic(lines) 206 206 if not lines: 207 207 test_suite.status = TestStatus.TEST_CRASHED 208 208 return False ··· 235 235 def parse_test_suite(lines: List[str], expected_suite_index: int) -> Optional[TestSuite]: 236 236 if not lines: 237 237 return None 238 - consume_non_diagnositic(lines) 238 + consume_non_diagnostic(lines) 239 239 test_suite = TestSuite() 240 240 test_suite.status = TestStatus.SUCCESS 241 241 name = parse_subtest_header(lines) ··· 264 264 TAP_HEADER = re.compile(r'^TAP version 14$') 265 265 266 266 def parse_tap_header(lines: List[str]) -> bool: 267 - consume_non_diagnositic(lines) 267 + consume_non_diagnostic(lines) 268 268 if TAP_HEADER.match(lines[0]): 269 269 lines.pop(0) 270 270 return True ··· 274 274 TEST_PLAN = re.compile(r'[0-9]+\.\.([0-9]+)') 275 275 276 276 def parse_test_plan(lines: List[str]) -> Optional[int]: 277 - consume_non_diagnositic(lines) 277 + consume_non_diagnostic(lines) 278 278 match = TEST_PLAN.match(lines[0]) 279 279 if match: 280 280 lines.pop(0) ··· 286 286 return bubble_up_errors(lambda x: x.status, test_suite_list) 287 287 288 288 def parse_test_result(lines: List[str]) -> TestResult: 289 - consume_non_diagnositic(lines) 289 + consume_non_diagnostic(lines) 290 290 if not lines or not parse_tap_header(lines): 291 291 return TestResult(TestStatus.NO_TESTS, [], lines) 292 292 expected_test_suite_num = parse_test_plan(lines)