# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

import benchexec.tools.template
from collections.abc import Mapping
import benchexec.result as result


class Tool(benchexec.tools.template.BaseTool2):
    """
    Tool info for Infer with a wrapper for usage in the SVCOMP.
    URL: https://fbinfer.com/
    """

    REQUIRED_PATHS = ["."]

    def executable(self, tool_locator):
        return tool_locator.find_executable("infer-wrapper.py")

    def version(self, executable):
        return self._version_from_tool(executable)

    def name(self):
        return "infer-sv"

    def cmdline(self, executable, options, task, rlimits):
        cmd = [executable, "--program"] + list(task.input_files)
        if task.property_file:
            cmd += ["--property", task.property_file]
        if isinstance(task.options, Mapping) and "data_model" in task.options:
            cmd += ["--datamodel", task.options["data_model"]]
        return cmd

    def determine_result(self, run):
        run_result = run.output[-1].split(":", maxsplit=2)[-1]
        if run_result == "true":
            return result.RESULT_TRUE_PROP
        if run_result == "false":
            return result.RESULT_FALSE_PROP
        if run_result == "error":
            return result.RESULT_ERROR
        return result.RESULT_UNKNOWN

@@ -490,36 +490,8 @@
 %22%22%0A%0A
-    REQUIRED_PATHS = %5B%22.%22%5D%0A%0A
     
@@ -718,16 +718,16 @@
 rn %22
-i
+I
 nfer-
-sv
+SV
 %22%0A%0A 
@@ -826,22 +826,22 @@
 ram%22
-%5D + list(task.
+, task.single_
 inpu
@@ -846,18 +846,17 @@
 put_file
-s)
+%5D
 %0A       
@@ -1379,13 +1379,15 @@
 == %22
-error
+unknown
 %22:%0A 
@@ -1422,13 +1422,15 @@
 ULT_
-ERROR
+UNKNOWN
 %0A   
@@ -1443,28 +1443,26 @@
 eturn result.RESULT_
-UNKNOWN
+ERROR
 %0A

Change name to Infer-SV, use only a single file as input and return ERROR by default