Skip to contentSkip to conversation

patchtest/selftest: only split resultlines once

PATCH New Trevor Gamblin 1 participant 1 message Sep 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patchtest/selftest: only split resultlines once

selftest assumes that the test result output lines will consist of two tokens separated by whitespace, which are the actual result and the name of the test run. As a result, the script fails if any verbosity is added to the output of patchtest itself (e.g. by including a failure reason). Make the call to split() only do so once in order to ensure that two tokens are obtained.

---
 meta/lib/patchtest/selftest/selftest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/patchtest/selftest/selftest +1 -1
index ba8e1623ee..d2b61e951a 100755
@@ -63,7 +63,7 @@ if __name__ == '__main__':
 
             for resultline in results.splitlines():
                 if testid in resultline:
-                    result, _ = resultline.split()
+                    result, _ = resultline.split(' ', 1)
 
                     if expected_result.upper() == "FAIL" and result.upper() == "FAIL":
                         xfailcount = xfailcount + 1
Signature · 1 line
2.41.0