There are four ways we test the Qwerty compiler:
- Unit tests for Python code:
qwerty_pyrt/python/qwerty/tests/test_*.py- Invoked with (before the second command, make sure the virtual
environment is activated and you have run
maturin develop):$ cd qwerty_pyrt/ $ python -m unittest qwerty.tests -v
- Invoked with (before the second command, make sure the virtual
environment is activated and you have run
- Integration tests (running Qwerty code):
qwerty_pyrt/python/qwerty/integration_tests.py, invoked same as #1 above - Unit tests for Rust code:
qwerty_ast/**/test_*.rs- Invoked with:
$ cd qwerty_ast/ $ cargo test
- Invoked with:
- IR-based MLIR tests:
qwerty_mlir/tests/**/*.mlir- Invoked with (make sure you have
FileCheckin your path):This script imitates$ python qwerty_mlir/tests/filecheck_tests.py -vlit, the LLVM test runner. - These are usually for testing MLIR passes, but some MLIR analyses
are tested too. These analyses are invoked with
qwerty-optvia a boilerplate pass likeTestFuncSpecAnalysisPass, which prints their results to stdout so that you andFileCheckcan see them.
- Invoked with (make sure you have
You can run all the tests with dev/run-tests.sh. Make sure you that have LLVM
binaries in your path (for FileCheck) and that you activated the virtual
environment (typically . venv/bin/activate).