From cf9926f7ab9674a7bdcbabba6f8464e4158f19f2 Mon Sep 17 00:00:00 2001 From: Simmo Saan Date: Thu, 9 Nov 2023 17:56:08 +0200 Subject: [PATCH] goblint: implement url_for_version --- benchexec/tools/goblint.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/benchexec/tools/goblint.py b/benchexec/tools/goblint.py index 8a96acd93..2b009a89e 100644 --- a/benchexec/tools/goblint.py +++ b/benchexec/tools/goblint.py @@ -23,6 +23,17 @@ def executable(self, tool_locator): def version(self, executable): return self._version_from_tool(executable, line_prefix="Goblint version: ") + def url_for_version(self, version): + m = re.fullmatch(r"(heads|tags)/(.+)-(\d+)-g([0-9a-f]{7,})(-dirty)?", version) + if m: + return f"https://github.com/goblint/analyzer/commit/{m.group(4)}" + + m = re.fullmatch(r"([0-9.]+) ([0-9a-f]{40})", version) + if m: + return f"https://github.com/goblint/analyzer/commit/{m.group(2)}" + + return None + def name(self): return "Goblint"