Skip to content

Commit 9017b59

Browse files
danieldietschmaul-esel
authored andcommitted
do not look for Ultimate binary to verify Ultimate dir, look for one of the launchers
1 parent bc79a47 commit 9017b59

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

benchexec/tools/ultimate.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import glob
1111
import logging
1212
import os
13+
from pathlib import Path
1314
import re
1415
import shlex
1516
import shutil
@@ -72,15 +73,13 @@ def project_url(self):
7273

7374
def executable(self, tool_locator):
7475
exe = tool_locator.find_executable("Ultimate.py")
75-
dir_name = os.path.dirname(exe)
76-
logging.debug("Looking in %s for Ultimate and plugins/", dir_name)
77-
for _, dir_names, file_names in os.walk(dir_name):
78-
if "Ultimate" in file_names and "plugins" in dir_names:
79-
return exe
80-
break
76+
dir_name = Path(os.path.dirname(exe))
77+
logging.debug("Checking if %s contains a launcher jar", dir_name)
78+
if any([(dir_name / rel_launcher).exists() for rel_launcher in _LAUNCHER_JARS]):
79+
return exe
8180
msg = (
8281
f"ERROR: Did find a Ultimate.py in {os.path.dirname(exe)} "
83-
f"but no 'Ultimate' or no 'plugins' directory besides it"
82+
f"but no launcher .jar besides it"
8483
)
8584
raise ToolNotFoundException(msg)
8685

0 commit comments

Comments
 (0)