@@ -0,0 +1,1835 @@
+# This file is part of BenchExec, a framework for reliable benchmarking:%0A# https://github.com/sosy-lab/benchexec%0A#%0A# SPDX-FileCopyrightText: 2022 Rapha%C3%ABl Monat%0A#%0A# SPDX-License-Identifier: Apache-2.0%0A%0Aimport benchexec.tools.template%0Aimport benchexec.result as result%0A%0Aimport re, json, subprocess%0A%0A%0Aclass Tool(benchexec.tools.template.BaseTool2):%0A    %22%22%22%0A    Tool info for Mopsa.%0A    URL: https://gitlab.com/mopsa/mopsa-analyzer/%0A    %22%22%22%0A%0A    def executable(self, tool_locator):%0A        return tool_locator.find_executable(%22mopsa-sv-comp%22, subdir=%22bin/%22)%0A%0A    def version(self, executable):%0A        # the provided utility will fail due to return code 2 in Mopsa%0A        process = subprocess.run(%0A            %5B%22mopsa-c%22, %22-format=json%22%5D,%0A            stdout=subprocess.PIPE,%0A            stderr=subprocess.PIPE,%0A            universal_newlines=True,%0A        )%0A        output = json.loads(process.stdout)%0A        return output%5B%22mopsa_dev_version%22%5D%0A%0A    def name(self):%0A        return %22Mopsa%22%0A%0A    def cmdline(self, executable, options, task, rlimits):%0A        cmd = %5Bexecutable, %22--program%22, *task.input_files%5D%0A        if task.options is not None and %22data_model%22 in task.options:%0A            cmd += %5B%22--data_model%22, task.options.get(%22data_model%22)%5D%0A        if task.property_file:%0A            cmd += %5B%22--property%22, task.property_file%5D%0A        return cmd %0A%0A    def determine_result(self, run):%0A        if run.was_timeout:%0A            return %22TIMEOUT%22%0A        r = run.output.text%0A        last = r.split(%22%5Cn%22)%0A        if last%5B-1%5D != '': last = last%5B-1%5D%0A        else: last = last%5B-2%5D%0A        if last.startswith(%22true%22): return result.RESULT_TRUE_PROP%0A        elif last.startswith(%22unknown%22): return result.RESULT_UNKNOWN%0A        elif last.startswith(%22ERROR%22): return result.RESULT_ERROR + last%5Blen(%22ERROR%22):%5D%0A        else: raise ValueError(last)%0A

Add Mopsa tool-info