Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/tools/ci/src/commands/test.rs
6598 views
1
use crate::{args::Args, Prepare, PreparedCommand};
2
use argh::FromArgs;
3
use xshell::cmd;
4
5
/// Runs all tests (except for doc tests).
6
#[derive(FromArgs, Default)]
7
#[argh(subcommand, name = "test")]
8
pub struct TestCommand {}
9
10
impl Prepare for TestCommand {
11
fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec<PreparedCommand<'a>> {
12
let no_fail_fast = args.keep_going();
13
let jobs = args.build_jobs();
14
let test_threads = args.test_threads();
15
16
let jobs_ref = &jobs;
17
let test_threads_ref = &test_threads;
18
19
vec![
20
PreparedCommand::new::<Self>(
21
cmd!(
22
sh,
23
"cargo test --workspace --lib --bins --tests {no_fail_fast...} {jobs_ref...} -- {test_threads_ref...}"
24
),
25
"Please fix failing tests in output above.",
26
),
27
PreparedCommand::new::<Self>(
28
cmd!(
29
sh,
30
// `--benches` runs each benchmark once in order to verify that they behave
31
// correctly and do not panic.
32
"cargo test --workspace --benches {no_fail_fast...} {jobs...}"
33
),
34
"Please fix failing tests in output above.",
35
)
36
]
37
}
38
}
39
40