Skip to content

Commit

Permalink
Implement some feedback from the metaval PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSpiessl committed Oct 29, 2020
1 parent 6fcf73d commit 4a2e3f3
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions benchexec/tools/metaval.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ def executable(self, toolLocator):
def name(self):
return "metaval"

@contextlib.contextmanager
def _in_tool_directory(self, verifierName):
"""
Context manager that sets the current working directory to the tool's directory
and resets its afterward. The returned value is the previous working directory.
"""
with self.lock:
try:
oldcwd = os.getcwd()
os.chdir(os.path.join(oldcwd, self.TOOL_TO_PATH_MAP[verifierName]))
yield oldcwd
finally:
os.chdir(oldcwd)

def determine_result(self, returncode, returnsignal, output, isTimeout):
verifierDir = None
regex = re.compile("verifier used in MetaVal is (.*)")
Expand Down Expand Up @@ -115,12 +101,12 @@ def cmdline(self, executable, options, task, rlimits):
assert isinstance(
tool, BaseTool2
), "we expect that all wrapped tools extend BaseTool2"
wrapped_executable = self.wrappedTools[verifierName].executable(
wrapped_executable = tool.executable(
BaseTool2.ToolLocator(
tool_directory=self.TOOL_TO_PATH_MAP[verifierName]
)
)
wrappedOptions = self.wrappedTools[verifierName].cmdline(
wrappedOptions = tool.cmdline(
wrapped_executable,
options,
[os.path.relpath(os.path.join(os.getcwd(), "output/ARG.c"))],
Expand All @@ -137,7 +123,7 @@ def cmdline(self, executable, options, task, rlimits):
]
+ additionalPathArgument
+ witnessTypeArgument
+ list(task.input_files_or_empty)
+ list(task.single_input_file)
+ ["--"]
+ wrappedOptions
)
Expand Down

0 comments on commit 4a2e3f3

Please sign in to comment.