Skip to content

Commit

Permalink
Fixed forgetting to print "about" status after last step
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert van Renesse committed Aug 26, 2023
1 parent 0d7faf4 commit fcd6222
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions harmony_model_checker/harmony/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,22 +304,24 @@ def deepdiff(self, path, before, after, loc, f):
for k in sorted(ak & bk):
self.deepcmp(path + [k], before[k], after[k], loc, f)

def print_about(self, f):
for ctx in self.contexts:
if ctx["tid"] == self.tid:
if ctx["mode"] == "terminated":
print(" * **Thread terminated**", file=f)
elif ctx["mode"] != "failed":
mode = get_mode(ctx)
# if mode != "runnable":
# print(" Mode = %s"%mode, file=f)
print(" * Preempted in ", end="", file=f)
verbose_print_trace(f, ctx["trace"])
if "next" in ctx:
self.about(ctx, " ", f)

def print_macrostep(self, f, mas):
mis = mas["microsteps"]
if mas["tid"] != self.tid:
for ctx in self.contexts:
if ctx["tid"] == self.tid:
if ctx["mode"] == "terminated":
print(" * **Thread terminated**", file=f)
else:
mode = get_mode(ctx)
# if mode != "runnable":
# print(" Mode = %s"%mode, file=f)
print(" * Preempted in ", end="", file=f)
verbose_print_trace(f, ctx["trace"])
if "next" in ctx:
self.about(ctx, " ", f)

self.print_about(f)
self.tid = mas["tid"]
# print(file=f)
# print("================================================", file=f)
Expand Down Expand Up @@ -438,6 +440,7 @@ def run(self, outputfiles, top):
self.locations = self.hvm["locs"]
for mes in top["macrosteps"]:
self.print_macrostep(output, mes)
self.print_about(output)

if top["issue"] == "Non-terminating state":
print(file=output)
Expand Down

0 comments on commit fcd6222

Please sign in to comment.