Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif self.allInText(["FALSE_FREE"], output):
status = result.RESULT_FALSE_FREE
elif self.allInText(["FALSE_MEMTRACK"], output):
status = result.RESULT_FALSE_MEMTRACK
elif self.allInText(["FALSE_OVERFLOW"], output):
status = result.RESULT_FALSE_OVERFLOW
elif self.allInText(["FALSE_TERMINATION"], output):
status = result.RESULT_FALSE_TERMINATION
elif self.allInText(["FALSE"], output):
status = result.RESULT_FALSE_REACH
elif "TRUE" in output:
status = result.RESULT_TRUE_PROP
elif "DONE" in output:
status = result.RESULT_DONE
if status == result.RESULT_UNKNOWN:
if isTimeout:
status = "TIMEOUT"
elif output.endswith(("error", "error\n")):
status = "ERROR"
return status
status = result.RESULT_TRUE_PROP
elif "FALSE" in output:
if "FALSE_MEMTRACK" in output:
status = result.RESULT_FALSE_MEMTRACK
elif "FALSE_MEMCLEANUP" in output:
status = result.RESULT_FALSE_MEMCLEANUP
elif "FALSE_DEREF" in output:
status = result.RESULT_FALSE_DEREF
elif "FALSE_FREE" in output:
status = result.RESULT_FALSE_FREE
elif "FALSE_OVERFLOW" in output:
status = result.RESULT_FALSE_OVERFLOW
else:
status = result.RESULT_FALSE_REACH
elif output.endswith("UNKNOWN"):
status = result.RESULT_UNKNOWN
elif isTimeout:
status = "TIMEOUT"
else:
status = "ERROR"
elif self._get_version() == 6:
if output.endswith("TRUE"):
status = result.RESULT_TRUE_PROP
elif "FALSE" in output:
if "FALSE(valid-memtrack)" in output:
status = result.RESULT_FALSE_MEMTRACK
elif "FALSE(valid-deref)" in output:
status = result.RESULT_FALSE_DEREF
elif "FALSE(valid-free)" in output:
status = result.RESULT_FALSE_FREE
elif output.endswith("UNKNOWN"):
def determine_result(self, returncode, returnsignal, output, isTimeout):
output = "\n".join(output)
status = result.RESULT_UNKNOWN
if self.allInText(["FALSE_DEREF"], output):
status = result.RESULT_FALSE_DEREF
elif self.allInText(["FALSE_FREE"], output):
status = result.RESULT_FALSE_FREE
elif self.allInText(["FALSE_MEMTRACK"], output):
status = result.RESULT_FALSE_MEMTRACK
elif self.allInText(["FALSE_OVERFLOW"], output):
status = result.RESULT_FALSE_OVERFLOW
elif self.allInText(["FALSE_TERMINATION"], output):
status = result.RESULT_FALSE_TERMINATION
elif self.allInText(["FALSE"], output):
status = result.RESULT_FALSE_REACH
elif "TRUE" in output:
status = result.RESULT_TRUE_PROP
elif "DONE" in output:
status = ""
if "TRUE" in output:
status = result.RESULT_TRUE_PROP
elif "no-overflow" in output:
status = result.RESULT_FALSE_OVERFLOW
elif "valid-deref" in output:
status = result.RESULT_FALSE_DEREF
elif "valid-memtrack" in output:
status = result.RESULT_FALSE_MEMTRACK
elif "FALSE(TERMINATION)" in output:
status = result.RESULT_FALSE_TERMINATION
elif "FALSE" in output:
status = result.RESULT_FALSE_REACH
elif "UNKNOWN" in output:
status = result.RESULT_UNKNOWN
else:
status = result.RESULT_ERROR
return status
status = "TIMEOUT"
elif line.startswith("Verification result: "):
line = line[21:].strip()
if line.startswith("TRUE"):
newStatus = result.RESULT_TRUE_PROP
elif line.startswith("FALSE"):
newStatus = result.RESULT_FALSE_PROP
match = re.match(
r".* Property violation \(([a-zA-Z0-9_-]+)(:.*)?\) found by chosen configuration.*",
line,
)
if match:
newStatus += "(" + match.group(1) + ")"
else:
newStatus = result.RESULT_UNKNOWN
if not status:
status = newStatus
elif newStatus != result.RESULT_UNKNOWN:
status = "{0} ({1})".format(status, newStatus)
elif line == "Finished." and not status:
status = result.RESULT_DONE
if (
(not status or status == result.RESULT_UNKNOWN)
and isTimeout
and returncode in [15, 143]
):
# The JVM sets such an returncode if it receives signal 15 (143 is 15+128)
status = "TIMEOUT"
def determine_result(self, returncode, returnsignal, output, isTimeout):
output = "\n".join(output)
if "SSSAFE" in output:
status = result.RESULT_TRUE_PROP
elif "UNSAFE" in output:
status = result.RESULT_FALSE_REACH
else:
status = result.RESULT_UNKNOWN
if status == result.RESULT_UNKNOWN and isTimeout:
status = "TIMEOUT"
return status
def determine_result(self, returncode, returnsignal, output, isTimeout):
"""
Returns a BenchExec result status based on the output of SMACK
"""
splitout = "\n".join(output)
if re.search(r'SMACK found no errors.', splitout):
return result.RESULT_TRUE_PROP
elif re.search(r'SMACK found an error.*', splitout):
return result.RESULT_FALSE_REACH
else:
return result.RESULT_UNKNOWN
def determine_result(self, returncode, returnsignal, output, isTimeOut):
try:
for line in output:
if line.startswith("No bug found"):
return result.RESULT_TRUE_PROP
elif line.startswith("Bug found:"):
return result.RESULT_FALSE_REACH
return result.RESULT_UNKNOWN
except Exception:
return result.RESULT_UNKNOWN
def determine_result(self, returncode, returnsignal, output, isTimeout):
output = "\n".join(output)
if "TRUE" in output:
status = result.RESULT_TRUE_PROP
elif "FALSE" in output:
status = result.RESULT_FALSE_REACH
else:
status = result.RESULT_UNKNOWN
return status
status = "SEGFAULT"
elif "received signal 15" in output:
status = "KILLED"
elif "Error Location <> is not reachable" in output:
status = result.RESULT_TRUE_PROP
elif (
"Error Location <> is reachable via the following path"
in output
):
status = result.RESULT_FALSE_REACH
else:
status = result.RESULT_UNKNOWN
return status