diff --git a/Makefile b/Makefile index fbe099042..2a4f4f587 100644 --- a/Makefile +++ b/Makefile @@ -891,6 +891,7 @@ endif +cd tests/xprop && bash run-test.sh $(SEEDOPT) +cd tests/fmt && bash run-test.sh +cd tests/cxxrtl && bash run-test.sh + +cd tests/functional && bash run-test.sh @echo "" @echo " Passed \"make test\"." @echo "" diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 12db7f1d0..a9fbb3c59 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -4,6 +4,10 @@ import random random_seed = random.getrandbits(32) +def pytest_configure(config): + config.addinivalue_line("markers", "smt: test uses smtlib/z3") + config.addinivalue_line("markers", "rkt: test uses racket/rosette") + def pytest_addoption(parser): parser.addoption("--per-cell", type=int, default=None, help="run only N tests per cell") parser.addoption("--steps", type=int, default=1000, help="run each test for N steps") @@ -27,4 +31,4 @@ def pytest_generate_tests(metafunc): seed1 = metafunc.config.getoption("seed") rnd = lambda seed2: random.Random('{}-{}'.format(seed1, seed2)) names, cases = generate_test_cases(per_cell, rnd) - metafunc.parametrize("cell,parameters", cases, ids=names) \ No newline at end of file + metafunc.parametrize("cell,parameters", cases, ids=names) diff --git a/tests/functional/run-test.sh b/tests/functional/run-test.sh index b9a0595f6..9f70462ee 100755 --- a/tests/functional/run-test.sh +++ b/tests/functional/run-test.sh @@ -1,2 +1,2 @@ #!/usr/bin/env bash -pytest -v "$@" +pytest -v -m "not smt and not rkt" "$@" diff --git a/tests/functional/test_functional.py b/tests/functional/test_functional.py index 3b006676a..7a09966d8 100644 --- a/tests/functional/test_functional.py +++ b/tests/functional/test_functional.py @@ -55,6 +55,7 @@ def test_cxx(cell, parameters, tmp_path, num_steps, rnd): run([str(vcdharness_exe_file.resolve()), str(vcd_functional_file), str(num_steps), str(seed)]) yosys_sim(rtlil_file, vcd_functional_file, vcd_yosys_sim_file, getattr(cell, 'sim_preprocessing', '')) +@pytest.mark.smt def test_smt(cell, parameters, tmp_path, num_steps, rnd): import smt_vcd @@ -72,6 +73,7 @@ def test_smt(cell, parameters, tmp_path, num_steps, rnd): smt_vcd.simulate_smt(smt_file, vcd_functional_file, num_steps, rnd(cell.name + "-smt")) yosys_sim(rtlil_file, vcd_functional_file, vcd_yosys_sim_file, getattr(cell, 'sim_preprocessing', '')) +@pytest.mark.rkt def test_rkt(cell, parameters, tmp_path, num_steps, rnd): import rkt_vcd