Twister: Refactor Test(Harness).handle()
The function `handle()` from class `Test(Harness)` had most of its
code being the direct copy of the code from
`Harness.process_test(line)`. This patch replaces the copied code
with the call for `process_test(line)` and removes repetition of
this function call.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
diff --git a/scripts/pylib/twister/harness.py b/scripts/pylib/twister/harness.py
index 2aed756..60debe3 100644
--- a/scripts/pylib/twister/harness.py
+++ b/scripts/pylib/twister/harness.py
@@ -132,18 +132,7 @@
self.tests[name] = match.group(1)
self.ztest = True
- if self.RUN_PASSED in line:
- if self.fault:
- self.state = "failed"
- else:
- self.state = "passed"
-
- if self.RUN_FAILED in line:
- self.state = "failed"
-
- if self.fail_on_fault:
- if self.FAULT in line:
- self.fault = True
+ self.process_test(line)
if not self.ztest and self.state:
if self.state == "passed":
@@ -151,12 +140,6 @@
else:
self.tests[self.id] = "FAIL"
- if self.GCOV_START in line:
- self.capture_coverage = True
- elif self.GCOV_END in line:
- self.capture_coverage = False
-
- self.process_test(line)
class Ztest(Test):
pass