From a397f64356f88566376545fb5e02d56b107eda51 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 23 Jul 2025 16:40:25 -0700 Subject: [PATCH] Add a section on how to run tests --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29f47f9a..2c230fe3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,6 +123,18 @@ Please consider the following when making a change: * Check out the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/) for guidelines on designing the API. +## Tests + +The main test harness is described in the [testsuite documentation](tests/testsuite/README.md). There are several different commands to run different kinds of tests: + +- `cargo test --workspace` — This runs all of the unit and integration tests, except for the GUI tests. +- `cargo test --test gui` — This runs the [GUI test harness](#browser-compatibility-and-testing). This does not get run automatically due to its extra requirements. +- `npm run lint` — [Checks the `.js` files](#checking-changes-in-js-files) +- `cargo test --workspace --no-default-features` — Testing without default features helps check that all feature checks are implemented correctly. +- `cargo clippy --workspace --all-targets --no-deps -- -D warnings` — This makes sure that there are no clippy warnings. +- `RUSTDOCFLAGS="-D warnings" cargo doc --workspace --document-private-items --no-deps` — This verifies that there aren't any rustdoc warnings. +- `cargo fmt --check` — Verifies that everything is formatted correctly. + ## Making a pull-request When you feel comfortable that your changes could be integrated into mdBook, you can create a pull-request on GitHub.