Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tool-info module for VerCors #910

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions benchexec/tools/vercors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2023 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

import benchexec.result as result
import benchexec.tools.template


class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for VerCors (https://github.com/utwente-fmt/vercors)
"""

def executable(self, tool_locator):
return tool_locator.find_executable("vct", subdir="bin")

def name(self):
return "VerCors"

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

def determine_result(self, run):
for line in run.output:
line = line.strip()
if line == "[INFO] Verification completed successfully.":
return result.RESULT_TRUE_PROP
elif "Parsing failed" in line:
return result.RESULT_ERROR + "(Parsing failed)"
elif "Exception in thread" in line:
return result.RESULT_ERROR + "(Exception)"
elif "is not supported" in line:
return result.RESULT_ERROR + "(Unsupported)"
elif line.startswith("[ERROR]") or "An error condition was reached" in line:
return result.RESULT_ERROR
return result.RESULT_UNKNOWN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns unknown for cases where the tool output cannot be parsed successfully, which would be the case for example in case of a crash. However, unknown is meant for cases where the tool gave up. Is it possible to distinguish these cases from errors/crashes?