mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-12 16:28:17 +00:00
add fallback if solver can't tell which property fails
This commit is contained in:
parent
7f3c4137c1
commit
a9d1972c47
|
@ -458,11 +458,15 @@ def run_task(taskname):
|
||||||
checks = task.design_hierarchy.get_property_list()
|
checks = task.design_hierarchy.get_property_list()
|
||||||
junit_tests = len(checks)
|
junit_tests = len(checks)
|
||||||
junit_errors = 1 if task.retcode == 16 else 0
|
junit_errors = 1 if task.retcode == 16 else 0
|
||||||
|
solver_gives_line = task.status == "FAIL" and any(check.status != "UNKNOWN" for check in checks)
|
||||||
junit_failures = 0
|
junit_failures = 0
|
||||||
if task.retcode != 0 and junit_errors == 0:
|
if junit_errors == 0 and task.retcode != 0:
|
||||||
for check in checks:
|
if solver_gives_line:
|
||||||
if check.status == "FAIL":
|
for check in checks:
|
||||||
junit_failures += 1
|
if check.status == "FAIL":
|
||||||
|
junit_failures += 1
|
||||||
|
else:
|
||||||
|
junit_failures = 1
|
||||||
junit_type = "cover" if task.opt_mode == "cover" else "assert" #should this be here or individual for each check?
|
junit_type = "cover" if task.opt_mode == "cover" else "assert" #should this be here or individual for each check?
|
||||||
junit_time = time.strftime('%Y-%m-%dT%H:%M:%S')
|
junit_time = time.strftime('%Y-%m-%dT%H:%M:%S')
|
||||||
print(f'<?xml version="1.0" encoding="UTF-8"?>', file=f)
|
print(f'<?xml version="1.0" encoding="UTF-8"?>', file=f)
|
||||||
|
@ -472,13 +476,23 @@ def run_task(taskname):
|
||||||
print(f'<properties>', file=f)
|
print(f'<properties>', file=f)
|
||||||
print(f'<property name="os" value="{os.name}"/>', file=f)
|
print(f'<property name="os" value="{os.name}"/>', file=f)
|
||||||
print(f'</properties>', file=f)
|
print(f'</properties>', file=f)
|
||||||
for check in checks:
|
if solver_gives_line:
|
||||||
|
for check in checks:
|
||||||
|
print(f'<testcase classname="{junit_tc_name}" name="" time="{task.total_time}">', file=f) # name required
|
||||||
|
if check.status == "UNKNOWN":
|
||||||
|
print(f'<skipped />', file=f)
|
||||||
|
elif check.status == "FAIL":
|
||||||
|
print(f'<failure type="{check.type}" message="Property in {check.hierarchy} at {check.location} failed. Trace file: {check.tracefile}" />', file=f)
|
||||||
|
elif check.status == "ERROR":
|
||||||
|
print(f'<error type="ERROR"/>', file=f) # type mandatory, message optional
|
||||||
|
print(f'</testcase>', file=f)
|
||||||
|
else:
|
||||||
print(f'<testcase classname="{junit_tc_name}" name="" time="{task.total_time}">', file=f) # name required
|
print(f'<testcase classname="{junit_tc_name}" name="" time="{task.total_time}">', file=f) # name required
|
||||||
if check.status == "UNKNOWN":
|
if task.status == "UNKNOWN":
|
||||||
print(f'<skipped />', file=f)
|
print(f'<skipped />', file=f)
|
||||||
elif check.status == "FAIL":
|
elif task.status == "FAIL":
|
||||||
print(f'<failure type="{check.type}" message="Property in {check.hierarchy} at {check.location} failed. Trace file: {check.tracefile}" />', file=f)
|
print(f'<failure type="{junit_type}" message="{task.status}" />', file=f)
|
||||||
elif check.status == "ERROR":
|
elif task.status == "ERROR":
|
||||||
print(f'<error type="ERROR"/>', file=f) # type mandatory, message optional
|
print(f'<error type="ERROR"/>', file=f) # type mandatory, message optional
|
||||||
print(f'</testcase>', file=f)
|
print(f'</testcase>', file=f)
|
||||||
print('<system-out>', end="", file=f)
|
print('<system-out>', end="", file=f)
|
||||||
|
|
Loading…
Reference in a new issue