Skip to content

Commit

Permalink
Merge pull request #946 from leventeBajczi/patch-1
Browse files Browse the repository at this point in the history
Create concurrentwitness2test.py
  • Loading branch information
PhilippWendler authored Nov 2, 2023
2 parents d061a35 + 902e7db commit 0da724f
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions benchexec/tools/concurrentwitness2test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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.result as result
import benchexec.tools.template


class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for ConcurrentWitness2Test: A violation witness validator for concurrent programs
URL: https://github.com/ftsrg/ConcurrentWitness2Test
"""

def executable(self, tool_locator):
return tool_locator.find_executable("start.sh")

def name(self):
return "ConcurrentWitness2Test"

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

def cmdline(self, executable, options, task, rlimits):
return [executable, task.single_input_file] + options

def determine_result(self, run):
for line in run.output:
if "Verdict: SOMETIMES" in line or "Verdict: ALWAYS" in line:
return result.RESULT_FALSE_REACH
elif "Verdict: NEVER" in line:
return result.RESULT_TRUE_PROP
elif "Verdict: TIMEOUT" in line:
return result.RESULT_TIMEOUT + "(inner)"
elif "Verdict: Unknown error" in line:
return result.RESULT_ERROR
elif "Verdict: Incompatible witness" in line:
return result.RESULT_ERROR + "(Incompatible witness)"
elif "Verdict: Parsing failed" in line:
return result.RESULT_ERROR + "(Parsing failed)"
elif "Verdict: Compilation error" in line:
return result.RESULT_ERROR + "(Compilation error)"

return result.RESULT_UNKNOWN

0 comments on commit 0da724f

Please sign in to comment.