/
test.rs
81 lines (71 loc) · 1.98 KB
/
test.rs
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate::cli::{self, MSRV};
use std::process::Command;
pub fn run() -> anyhow::Result<()> {
cli::run(
Command::new("cargo")
.arg("test")
.arg("--lib")
.arg("--no-default-features")
.arg("--tests")
.arg("--quiet"),
)?;
cli::run(
Command::new("cargo")
.arg("test")
.arg("--no-default-features")
.arg("--features=full")
.arg("--quiet"),
)?;
cli::run(
Command::new("cargo")
.arg("test")
.arg("--no-default-features")
.arg("--features=abi3,full")
.arg("--quiet"),
)?;
// If the MSRV toolchain is not installed, this will install it
cli::run(
Command::new("rustup")
.arg("toolchain")
.arg("install")
.arg(MSRV),
)?;
// Test MSRV
cli::run(
Command::new(concat!(env!("CARGO_HOME"), "/bin/cargo"))
.arg(format!("+{}", MSRV))
.arg("test")
.arg("--no-default-features")
.arg("--features=full,auto-initialize")
.arg("--quiet"),
)?;
// If the nightly toolchain is not installed, this will install it
cli::run(
Command::new("rustup")
.arg("toolchain")
.arg("install")
.arg("nightly"),
)?;
cli::run(
Command::new(concat!(env!("CARGO_HOME"), "/bin/cargo"))
.arg("+nightly")
.arg("test")
.arg("--no-default-features")
.arg("--features=full,nightly")
.arg("--quiet"),
)?;
cli::run(
Command::new("cargo")
.arg("test")
.arg("--manifest-path=pyo3-ffi/Cargo.toml")
.arg("--quiet"),
)?;
cli::run(
Command::new("cargo")
.arg("test")
.arg("--no-default-features")
.arg("--manifest-path=pyo3-build-config/Cargo.toml")
.arg("--quiet"),
)?;
Ok(())
}