1010@dataclass
1111class ExecutionResult :
1212 output : str
13- has_verdict : bool
13+ verdict_true_or_error : bool
1414
1515
1616class GoblintMultishotRunner :
@@ -51,17 +51,20 @@ def __init__(self, logger):
5151 def run_with_config (self , config_path ):
5252 args = ["--conf" , config_path ] + self .other_args
5353 self .logger .info (f"Running next shot: ./goblint { " " .join (args )} " )
54- output = subprocess .check_output ([self .goblint_executable_path , * args ]
55- ).decode ("utf-8" )
54+ try :
55+ output = subprocess .check_output ([self .goblint_executable_path , * args ]
56+ ,stderr = subprocess .STDOUT ).decode ("utf-8" )
57+ except subprocess .CalledProcessError as e :
58+ output = e .output .decode ("utf-8" )
5659
57- return ExecutionResult (output , self .has_verdict (output ))
60+ return ExecutionResult (output , self .verdict_true_or_error (output ))
5861
5962 def run_without_config (self ):
6063 subprocess .run ([self .goblint_executable_path , * self .other_args ])
6164
6265 @staticmethod
63- def has_verdict (output ):
64- return any ("SV-COMP result: true " in line for line in output .splitlines ())
66+ def verdict_true_or_error (output ):
67+ return not any ("SV-COMP result: unknown " in line for line in output .splitlines ())
6568
6669 def run (self ):
6770 if not self .configs :
@@ -70,14 +73,8 @@ def run(self):
7073
7174 result = None
7275 for config in self .configs :
73- if not path .exists (config ):
74- logger .warning (f"Config file { config } not found, skipping." )
75- continue
76- if not path .isfile (config ):
77- logger .warning (f"Config file { config } is not a file, skipping." )
78- continue
7976 result = self .run_with_config (config )
80- if result .has_verdict :
77+ if result .verdict_true_or_error :
8178 break
8279 print (result .output )
8380
0 commit comments