-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #947 from filipeom/add-tool-owic
Adds tool info module for owic
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# 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 | ||
import benchexec.result as result | ||
|
||
from benchexec.tools.sv_benchmarks_util import get_data_model_from_task, ILP32, LP64 | ||
|
||
|
||
class Tool(benchexec.tools.template.BaseTool2): | ||
""" | ||
This class serves as tool adaptor for OWI (https://github.com/OCamlPro/owi) | ||
""" | ||
|
||
def executable(self, tool_locator): | ||
return tool_locator.find_executable("owic", subdir="bin") | ||
|
||
def version(self, executable): | ||
return self._version_from_tool(executable, "--version") | ||
|
||
def name(self): | ||
return "OWI" | ||
|
||
def cmdline(self, executable, options, task, _): | ||
if task.property_file: | ||
options = options + ["--property", task.property_file] | ||
else: | ||
raise benchexec.tools.template.UnsupportedFeatureException( | ||
"property file is required" | ||
) | ||
|
||
data_model_param = get_data_model_from_task(task, {ILP32: "32", LP64: "64"}) | ||
if data_model_param and "--arch" not in options: | ||
options += ["--arch", data_model_param] | ||
|
||
return [executable] + options + [task.single_input_file] | ||
|
||
def determine_result(self, run): | ||
if run.exit_code == 1: | ||
return result.RESULT_ERROR | ||
|
||
for line in run.ouput: | ||
if "Assert failure" in line: | ||
return result.RESULT_FALSE_REACH | ||
elif "ERROR" in line: | ||
return result.RESULT_ERROR | ||
elif "All OK" in line: | ||
return result.RESULT_DONE | ||
|
||
if run.was_timeout: | ||
return result.RESULT_TIMEOUT | ||
return result.RESULT_UNKNOWN |