-use std::fs::File;
+use std::fs::{self, File};
use std::io::prelude::*;
use cargo;
#[cargo_test]
fn cargo_test_doctest_xcompile_ignores() {
if !is_nightly() {
+ // -Zdoctest-xcompile is unstable
return;
}
let p = project()
#[cfg(not(target_arch = "x86_64"))]
p.cargo("test")
.with_stdout_contains(
- "\
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
- ",
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out",
)
.run();
#[cfg(target_arch = "x86_64")]
p.cargo("test")
.with_status(101)
.with_stdout_contains(
- "\
- test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out\
- ",
+ "test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out",
)
.run();
p.cargo("test -Zdoctest-xcompile")
.masquerade_as_nightly_cargo()
.with_stdout_contains(
- "\
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
- ",
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out",
)
.run();
p.cargo("test -Zdoctest-xcompile")
.masquerade_as_nightly_cargo()
.with_stdout_contains(
- "\
- test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out\
- ",
+ "test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out",
)
.run();
}
#[cargo_test]
fn cargo_test_doctest_xcompile() {
+ if cross_compile::disabled() {
+ return;
+ }
if !is_nightly() {
+ // -Zdoctest-xcompile is unstable
return;
}
let p = project()
p.cargo("build").run();
p.cargo(&format!("test --target {}", cross_compile::alternate()))
- .with_stdout_contains(
- "\
- running 0 tests\
- ",
- )
+ .with_stdout_contains("running 0 tests")
.run();
p.cargo(&format!(
"test --target {} -Zdoctest-xcompile",
))
.masquerade_as_nightly_cargo()
.with_stdout_contains(
- "\
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
- ",
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out",
)
.run();
}
#[cargo_test]
fn cargo_test_doctest_xcompile_runner() {
- use std::fs;
+ if cross_compile::disabled() {
+ return;
+ }
if !is_nightly() {
+ // -Zdoctest-xcompile is unstable
return;
}
p.cargo("build").run();
p.cargo(&format!("test --target {}", cross_compile::alternate()))
- .with_stdout_contains(
- "\
- running 0 tests\
- ",
- )
+ .with_stdout_contains("running 0 tests")
.run();
p.cargo(&format!(
"test --target {} -Zdoctest-xcompile",
))
.masquerade_as_nightly_cargo()
.with_stdout_contains(
- "\
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
- ",
- )
- .with_stderr_contains(
- "\
- this is a runner\
- ",
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out",
)
+ .with_stderr_contains("this is a runner")
.run();
}
#[cargo_test]
fn cargo_test_doctest_xcompile_no_runner() {
+ if cross_compile::disabled() {
+ return;
+ }
if !is_nightly() {
+ // -Zdoctest-xcompile is unstable
return;
}
p.cargo("build").run();
p.cargo(&format!("test --target {}", cross_compile::alternate()))
- .with_stdout_contains(
- "\
- running 0 tests\
- ",
- )
+ .with_stdout_contains("running 0 tests")
.run();
p.cargo(&format!(
"test --target {} -Zdoctest-xcompile",
))
.masquerade_as_nightly_cargo()
.with_stdout_contains(
- "\
- test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out\
- ",
+ "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out",
)
.run();
}