sanitycheck: use re.search to match output
Account for cases where there is a prefix to the output where exact matching does not work. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
2fd36fac81
commit
39caff5ca1
1 changed files with 2 additions and 2 deletions
|
@ -23,12 +23,12 @@ class Console(Harness):
|
||||||
def handle(self, line):
|
def handle(self, line):
|
||||||
if self.type == "one_line":
|
if self.type == "one_line":
|
||||||
pattern = re.compile(self.regex[0])
|
pattern = re.compile(self.regex[0])
|
||||||
if pattern.match(line):
|
if pattern.search(line):
|
||||||
self.state = "passed"
|
self.state = "passed"
|
||||||
elif self.type == "multi_line":
|
elif self.type == "multi_line":
|
||||||
for r in self.regex:
|
for r in self.regex:
|
||||||
pattern = re.compile(r)
|
pattern = re.compile(r)
|
||||||
if pattern.match(line) and not r in self.matches:
|
if pattern.search(line) and not r in self.matches:
|
||||||
self.matches[r] = line
|
self.matches[r] = line
|
||||||
|
|
||||||
if len(self.matches) == len(self.regex):
|
if len(self.matches) == len(self.regex):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue