[test] Add functional verilator tests.
|functional_verilator_test.py| takes a flag pointing to an executable,
which is then executed under a Verilator build. The test listens
over UART, and passes or fails the test depending on whether it prints
PASS! or FAIL!; see the file comment for details.
diff --git a/test/systemtest/conftest.py b/test/systemtest/conftest.py
index b2504ba..19a3afa 100644
--- a/test/systemtest/conftest.py
+++ b/test/systemtest/conftest.py
@@ -19,6 +19,7 @@
parser.addoption("--rom_bin", action="store", default="")
parser.addoption("--verilator_model", action="store", default="")
parser.addoption("--openocd", action="store", default="openocd")
+ parser.addoption("--uart_timeout", action="store", default="60")
@pytest.hookimpl(tryfirst=True)
@@ -93,3 +94,8 @@
def openocd(pytestconfig):
"""Return path to OpenOCD executable."""
return pytestconfig.getoption('openocd')
+
+@pytest.fixture(scope="session")
+def uart_timeout(pytestconfig):
+ """Return the timeout in seconds for UART to print PASS."""
+ return int(pytestconfig.getoption('uart_timeout'))