Made fusebmc inherit from esbmc
# SPDX-License-Identifier: Apache-2.0
import os
-import benchexec.util as util
-import benchexec.tools.template
-import benchexec.result as result
+import benchexec.tools.esbmc as esbmc
-class Tool(benchexec.tools.template.BaseTool):
+
+class Tool(esbmc.Tool):
"""
- This class serves as tool adaptor for ESBMC (http://www.esbmc.org/)
+ This class serves as tool adaptor for FuSeBMC (https://github.com/kaled-alshmrany/FuSeBMC)
"""
REQUIRED_PATHS = ["esbmc", "esbmc-wrapper.py", "my_instrument"]
- def executable(self):
- return util.find_executable("esbmc-wrapper.py")
-
- def working_directory(self, executable):
- executableDir = os.path.dirname(executable)
- return executableDir
-
- def version(self, executable):
- return self._version_from_tool(executable, "-v")
-
def name(self):
return "FuSeBMC"
\ No newline at end of file
-
- def cmdline(self, executable, options, tasks, propertyfile, rlimits):
- assert len(tasks) == 1, "only one inputfile supported"
- inputfile = tasks[0]
- return [executable] + ["-p", propertyfile] + options + [inputfile]
-
- 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 = result.RESULT_DONE
-
- if status == result.RESULT_UNKNOWN:
- if isTimeout:
- status = "TIMEOUT"
- elif output.endswith(("error", "error\n")):
- status = "ERROR"
-
- return status
-
- """ helper method """
-
- def allInText(self, words, text):
- """
- This function checks, if all the words appear in the given order in the text.
- """
- index = 0
- for word in words:
- index = text[index:].find(word)
- if index == -1:
- return False
- return True
