-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Expand file tree
/
Copy pathtest.rs
More file actions
41 lines (36 loc) · 1.45 KB
/
test.rs
File metadata and controls
41 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use crate::{args::Args, Prepare, PreparedCommand};
use argh::FromArgs;
use xshell::cmd;
/// Runs all tests (except for doc tests).
#[derive(FromArgs, Default)]
#[argh(subcommand, name = "test")]
pub struct TestCommand {}
impl Prepare for TestCommand {
fn prepare<'a>(&self, sh: &'a xshell::Shell, args: Args) -> Vec<PreparedCommand<'a>> {
let no_fail_fast = args.keep_going();
let jobs = args.build_jobs();
let test_threads = args.test_threads();
let jobs_ref = &jobs;
let test_threads_ref = &test_threads;
// The bevy_ecs error tests need this set to test backtraces
sh.set_var("RUST_BACKTRACE", "1");
vec![
PreparedCommand::new::<Self>(
cmd!(
sh,
"cargo test --workspace --lib --bins --tests --features bevy_ecs/track_location {no_fail_fast...} {jobs_ref...} -- {test_threads_ref...}"
),
"Please fix failing tests in output above.",
),
PreparedCommand::new::<Self>(
cmd!(
sh,
// `--benches` runs each benchmark once in order to verify that they behave
// correctly and do not panic.
"cargo test --workspace --benches --features raw_vulkan_init {no_fail_fast...} {jobs...}"
),
"Please fix failing tests in output above.",
)
]
}
}