Merge pull request #145 from nakengelhardt/fix_junit_tracefile
authorN. Engelhardt <nak@yosyshq.com>
Mon, 28 Mar 2022 14:32:54 +0000 (16:32 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Mar 2022 14:32:54 +0000 (16:32 +0200)
junit: handle multiple asserts failing with the same trace

1  2 
sbysrc/sby_engine_smtbmc.py

index ab0c7e5f243ca17b43a319b100e73865256ddb3a,46054082ed0d98e017feba84f89f3090a6f9b0af..a9c5c804226ea14f084c79d4de605d031b4e2ab4
@@@ -155,12 -155,11 +155,12 @@@ def run(mode, task, engine_idx, engine)
          task.induction_procs.append(proc)
  
      proc_status = None
-     last_prop = None
+     last_prop = []
  
      def output_callback(line):
          nonlocal proc_status
          nonlocal last_prop
 +        smt2_trans = {'\\':'/', '|':'/'}
  
          match = re.match(r"^## [0-9: ]+ Status: FAILED", line)
          if match:
          match = re.match(r"^## [0-9: ]+ Assert failed in (\S+): (\S+) \((\S+)\)", line)
          if match:
              cell_name = match[3]
 -            prop = task.design_hierarchy.find_property_by_cellname(cell_name)
 +            prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
              prop.status = "FAIL"
-             last_prop = prop
+             last_prop.append(prop)
              return line
  
          match = re.match(r"^## [0-9: ]+ Reached cover statement at (\S+) \((\S+)\) in step \d+.", line)
          if match:
              cell_name = match[2]
 -            prop = task.design_hierarchy.find_property_by_cellname(cell_name)
 +            prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
              prop.status = "PASS"
-             last_prop = prop
+             last_prop.append(prop)
              return line
  
          match = re.match(r"^## [0-9: ]+ Writing trace to VCD file: (\S+)", line)
          if match and last_prop:
-             last_prop.tracefile = match[1]
-             last_prop = None
+             for p in last_prop:
+                 p.tracefile = match[1]
+             last_prop = []
              return line
  
          match = re.match(r"^## [0-9: ]+ Unreached cover statement at (\S+) \((\S+)\).", line)
          if match:
              cell_name = match[2]
 -            prop = task.design_hierarchy.find_property_by_cellname(cell_name)
 +            prop = task.design_hierarchy.find_property_by_cellname(cell_name, trans_dict=smt2_trans)
              prop.status = "FAIL"
  
          return line