mirror of
https://github.com/YosysHQ/sby.git
synced 2025-07-30 01:43:17 +00:00
Refactor tests
Organize tests into subdirectories and use a new makefile that scans .sby files and allows selecting tests by mode, engine, solver and/or subdirectory. Automatically skips tests that use engines/solvers that are not found in the PATH. See `cd tests; make help` for a description of supported make targets.
This commit is contained in:
parent
6daa434d85
commit
8da6f07cb3
60 changed files with 328 additions and 101 deletions
19
tests/keepgoing/keepgoing_same_step.py
Normal file
19
tests/keepgoing/keepgoing_same_step.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import sys
|
||||
from check_output import *
|
||||
|
||||
workdir = sys.argv[1]
|
||||
src = "keepgoing_same_step.sv"
|
||||
|
||||
assert_a = line_ref(workdir, src, "assert(a)")
|
||||
assert_not_a = line_ref(workdir, src, "assert(!a)")
|
||||
assert_0 = line_ref(workdir, src, "assert(0)")
|
||||
|
||||
log = open(workdir + "/logfile.txt").read()
|
||||
log_per_trace = log.split("Writing trace to VCD file")[:-1]
|
||||
|
||||
assert len(log_per_trace) == 2
|
||||
|
||||
assert re.search(r"Assert failed in test: %s \(.*\)$" % assert_a, log, re.M)
|
||||
assert re.search(r"Assert failed in test: %s \(.*\)$" % assert_not_a, log, re.M)
|
||||
assert re.search(r"Assert failed in test: %s \(.*\)$" % assert_0, log_per_trace[0], re.M)
|
||||
assert re.search(r"Assert failed in test: %s \(.*\) \[failed before\]$" % assert_0, log_per_trace[1], re.M)
|
Loading…
Add table
Add a link
Reference in a new issue