-
Notifications
You must be signed in to change notification settings - Fork 203
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
Proton tool info module proton.py #952
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1923695
Proton tool info module proton.py
rmetta 2b45b89
Corrected the tool info for proton
rmetta c88b3ee
Proton tool info module, Philipp Wendler comments
rmetta cfd1f0b
Updated with URL and removed the confusing comment
rmetta bede804
Merge branch 'sosy-lab:main' into main
rmetta bacb3d3
Corrected the error codes
rmetta bb769a8
Fixed inconsistent usage of result_str and output
rmetta 208bdd6
Replaced error codes with relvant error strings
rmetta 349328c
Merge branch 'sosy-lab:main' into main
rmetta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,68 @@ | ||
# 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 | ||
|
||
from benchexec.tools.sv_benchmarks_util import get_data_model_from_task, ILP32, LP64 | ||
import benchexec.tools.template | ||
import benchexec.result as result | ||
|
||
|
||
class Tool(benchexec.tools.template.BaseTool2): | ||
""" | ||
PROTON --- https://github.com/kumarmadhukar/term | ||
""" | ||
|
||
def executable(self, tool_locator): | ||
return tool_locator.find_executable("proton") | ||
|
||
def version(self, executable): | ||
return self._version_from_tool(executable, use_stderr=True) | ||
|
||
def name(self): | ||
return "PROTON" | ||
|
||
def cmdline(self, executable, options, task, rlimits): | ||
if task.property_file: | ||
options = options + ["--propertyFile", task.property_file] | ||
|
||
data_model_param = get_data_model_from_task(task, {ILP32: "32", LP64: "64"}) | ||
if data_model_param and data_model_param not in options: | ||
options += [data_model_param] | ||
|
||
return [executable] + options + [task.single_input_file] | ||
|
||
def determine_result(self, run): | ||
output = run.output | ||
|
||
status = result.RESULT_ERROR | ||
|
||
result_str = "UNKNOWN ERROR" | ||
|
||
if run.exit_code.value in [0, 10] and len(output) > 0: | ||
result_str = output[-1].strip() | ||
|
||
if result_str == "TRUE": | ||
status = result.RESULT_TRUE_PROP | ||
|
||
elif "FALSE(termination)" in result_str: | ||
status = result.RESULT_FALSE_TERMINATION | ||
|
||
elif "UNKNOWN" in result_str: | ||
status = result.RESULT_UNKNOWN | ||
|
||
elif "INTERNAL-ERROR" in result_str: | ||
status = "INTERNAL-ERROR" | ||
|
||
elif "OUT OF MEMORY" in result_str: | ||
status = "OUT OF MEMORY" | ||
|
||
elif "INCONCLUSIVE" in result_str: | ||
status = "INCONCLUSIVE" | ||
|
||
elif "UNRECOGNIZED PROPERTY" in result_str: | ||
status = "UNSUPPORTED PROPERTY SPECIFIED" | ||
|
||
return status | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not have a
return
everywhere instead of thestatus
variable? Seems easier to follow that way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this was overlooked?