Skip to content

Commit

Permalink
Add version URLs to CPAchecker's tool-info module
Browse files Browse the repository at this point in the history
This will make it possible to click on the version numbers,
which is useful especially for regression tests.
  • Loading branch information
PhilippWendler committed Nov 3, 2023
1 parent 99044df commit fa1a3b0
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,13 @@ exports[`Render Summary for big-table.diff.html 1`] = `
>
CPAchecker
</a>
trunk:18107
<a
href="https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
rel="noopener noreferrer"
target="_blank"
>
trunk:18107
</a>
</td>
<td
className="header__tool-rowfalse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
{
"project_url": "https://cpachecker.sosy-lab.org/",
"tool": "CPAchecker",
"version": "trunk:18107"
"version": "trunk:18107",
"version_url": "https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
},
9
],
Expand Down Expand Up @@ -3605,7 +3606,8 @@
"timelimit": "60 s",
"tool": "CPAchecker",
"toolmodule": "benchexec.tools.cpachecker",
"version": "trunk:18107"
"version": "trunk:18107",
"version_url": "https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
},
{
"benchmarkname": "integration-predicateAnalysis",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
{
"project_url": "https://cpachecker.sosy-lab.org/",
"tool": "CPAchecker",
"version": "trunk:18107"
"version": "trunk:18107",
"version_url": "https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
},
9
],
Expand Down Expand Up @@ -40955,7 +40956,8 @@
"timelimit": "60 s",
"tool": "CPAchecker",
"toolmodule": "benchexec.tools.cpachecker",
"version": "trunk:18107"
"version": "trunk:18107",
"version_url": "https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
},
{
"benchmarkname": "integration-predicateAnalysis",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@
{
"project_url": "https://cpachecker.sosy-lab.org/",
"tool": "CPAchecker",
"version": "trunk:18107"
"version": "trunk:18107",
"version_url": "https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
},
18
]
Expand Down Expand Up @@ -31710,7 +31711,8 @@
"timelimit": "60 s",
"tool": "CPAchecker",
"toolmodule": "benchexec.tools.cpachecker",
"version": "trunk:18107"
"version": "trunk:18107",
"version_url": "https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev=18107"
}
],
"version": "(test)"
Expand Down
36 changes: 36 additions & 0 deletions benchexec/tools/cpachecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,42 @@ def version(self, executable):
version = self._version_from_tool(executable, "-help", line_prefix="CPAchecker")
return version.split("(")[0].strip()

def url_for_version(self, version):
if ":" in version:
# Revision from VerifierCloud WebClient like "trunk:44918"
branch, revision = version.split(":", maxsplit=1)
if branch != "trunk":
branch = f"branches/{branch}"
return f"https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/{branch}/?rev={revision}"

elif re.fullmatch("[0-9.]+", version):
# Release version like "2.2.1"
return f"https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/tags/cpachecker-{version}/"

elif re.fullmatch("[0-9.]+-svn [0-9]{1,5}", version):
# Old development version like "1.7-svn 20000"
# Could end in "M", but then has local changes and we do not want a link.
version = version.rsplit(" ", maxsplit=1)[-1]
return f"https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev={version}"

elif re.fullmatch("[0-9.]+-svn-[0-9]{5}", version):
# Recent development version like "2.0-svn-30000"
# Could end in "M", but then has local changes and we do not want a link.
version = version.rsplit("-", maxsplit=1)[-1]
return f"https://svn.sosy-lab.org/trac/cpachecker/browser/CPAchecker/trunk/?rev={version}"

elif re.fullmatch("[0-9.]+-svn-[0-9a-f]{6,}", version):
# Development version with git commit like "2.2.1-svn-9743f6eae7"
# Could end in "+", but then has local changes and we do not want a link.
version = version.rsplit("-", maxsplit=1)[-1]
return f"https://gitlab.com/sosy-lab/software/cpachecker/-/tree/{version}"

elif re.fullmatch("[0-9a-f]{40}", version):
# Full git hash produced by VerifierCloud WebClient
return f"https://gitlab.com/sosy-lab/software/cpachecker/-/tree/{version}"

return None

def name(self):
return "CPAchecker"

Expand Down

0 comments on commit fa1a3b0

Please sign in to comment.