mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Add cargo xtask miri
This commit is contained in:
parent
df40889e1b
commit
fdc4d421e7
@ -7,6 +7,7 @@ use anyhow::Context;
|
|||||||
use pico_args::Arguments;
|
use pico_args::Arguments;
|
||||||
|
|
||||||
mod cts;
|
mod cts;
|
||||||
|
mod miri;
|
||||||
mod run_wasm;
|
mod run_wasm;
|
||||||
mod test;
|
mod test;
|
||||||
mod util;
|
mod util;
|
||||||
@ -37,6 +38,14 @@ Commands:
|
|||||||
|
|
||||||
All extra arguments will be forwarded to cargo-nextest (NOT wgpu-info)
|
All extra arguments will be forwarded to cargo-nextest (NOT wgpu-info)
|
||||||
|
|
||||||
|
miri
|
||||||
|
Run all miri-compatible tests under miri. Requires a nightly toolchain
|
||||||
|
with the x86_64-unknown-linux-gnu target and miri component installed.
|
||||||
|
|
||||||
|
--toolchain <toolchain> The toolchain to use for miri tests.
|
||||||
|
Must be a nightly toolchain.
|
||||||
|
Defaults to `nightly`.
|
||||||
|
|
||||||
vendor-web-sys
|
vendor-web-sys
|
||||||
Re-vendor the WebGPU web-sys bindings.
|
Re-vendor the WebGPU web-sys bindings.
|
||||||
|
|
||||||
@ -85,6 +94,7 @@ fn main() -> anyhow::Result<ExitCode> {
|
|||||||
match subcommand.as_deref() {
|
match subcommand.as_deref() {
|
||||||
Some("cts") => cts::run_cts(shell, args)?,
|
Some("cts") => cts::run_cts(shell, args)?,
|
||||||
Some("run-wasm") => run_wasm::run_wasm(shell, args)?,
|
Some("run-wasm") => run_wasm::run_wasm(shell, args)?,
|
||||||
|
Some("miri") => miri::run_miri(shell, args)?,
|
||||||
Some("test") => test::run_tests(shell, args)?,
|
Some("test") => test::run_tests(shell, args)?,
|
||||||
Some("vendor-web-sys") => vendor_web_sys::run_vendor_web_sys(shell, args)?,
|
Some("vendor-web-sys") => vendor_web_sys::run_vendor_web_sys(shell, args)?,
|
||||||
Some(subcommand) => {
|
Some(subcommand) => {
|
||||||
|
|||||||
29
xtask/src/miri.rs
Normal file
29
xtask/src/miri.rs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
use pico_args::Arguments;
|
||||||
|
use xshell::Shell;
|
||||||
|
|
||||||
|
pub fn run_miri(shell: Shell, mut args: Arguments) -> anyhow::Result<()> {
|
||||||
|
let toolchain: String = args
|
||||||
|
.opt_value_from_str("--toolchain")?
|
||||||
|
.unwrap_or_else(|| String::from("nightly"));
|
||||||
|
|
||||||
|
shell
|
||||||
|
.cmd("rustup")
|
||||||
|
.args([
|
||||||
|
"run",
|
||||||
|
&toolchain,
|
||||||
|
"cargo",
|
||||||
|
"miri",
|
||||||
|
"nextest",
|
||||||
|
"run",
|
||||||
|
"--target",
|
||||||
|
"x86_64-unknown-linux-gnu",
|
||||||
|
])
|
||||||
|
.env(
|
||||||
|
"MIRIFLAGS",
|
||||||
|
"-Zmiri-disable-isolation -Zmiri-deterministic-floats",
|
||||||
|
)
|
||||||
|
.quiet()
|
||||||
|
.run()?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user