Running Tests
Run all tests (unit tests inside src/, integration tests in tests/, and doctests).
- Check
Cargo.tomlfor the current MuJoCo version (look for+mj-X.Y.Zin the package version). Then find the matchingmujoco-X.Y.Z/directory at the repository root.
- Run all tests (replace
X.Y.Zwith the version found in step 1):
export MUJOCO_DYNAMIC_LINK_DIR=$(realpath mujoco-X.Y.Z/lib) && export LD_LIBRARY_PATH=$(realpath mujoco-X.Y.Z/lib/) && cargo test --features renderer
- Verify that the exit code is 0 (success) - check the terminal output for errors.
[!NOTE]
- To run a single test:
cargo test --features renderer <test_name>.
- To run tests in release mode add
--release.
- Read
Cargo.toml[features]for available features. Viewer/renderer features are opt-in (not in defaults).