Skip to content

Add #[ignore] to test that runs external process #3690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ script:
if [ -z ${INTEGRATION} ]; then
cargo build
cargo test
cargo test -- --ignored
else
./ci/integration.sh
fi
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ build: false
test_script:
- cargo build --verbose
- cargo test
- cargo test -- --ignored
16 changes: 8 additions & 8 deletions src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! following values of `chain_indent`:
//! Block:
//!
//! ```ignore
//! ```text
//! let foo = {
//! aaaa;
//! bbb;
Expand All @@ -27,7 +27,7 @@
//!
//! Visual:
//!
//! ```ignore
//! ```text
//! let foo = {
//! aaaa;
//! bbb;
Expand All @@ -41,15 +41,15 @@
//! the braces.
//! Block:
//!
//! ```ignore
//! ```text
//! let a = foo.bar
//! .baz()
//! .qux
//! ```
//!
//! Visual:
//!
//! ```ignore
//! ```text
//! let a = foo.bar
//! .baz()
//! .qux
Expand Down Expand Up @@ -454,7 +454,7 @@ trait ChainFormatter {
// Parent is the first item in the chain, e.g., `foo` in `foo.bar.baz()`.
// Root is the parent plus any other chain items placed on the first line to
// avoid an orphan. E.g.,
// ```ignore
// ```text
// foo.bar
// .baz()
// ```
Expand Down Expand Up @@ -516,7 +516,7 @@ impl<'a> ChainFormatterShared<'a> {
// know whether 'overflowing' the last child make a better formatting:
//
// A chain with overflowing the last child:
// ```ignore
// ```text
// parent.child1.child2.last_child(
// a,
// b,
Expand All @@ -525,7 +525,7 @@ impl<'a> ChainFormatterShared<'a> {
// ```
//
// A chain without overflowing the last child (in vertical layout):
// ```ignore
// ```text
// parent
// .child1
// .child2
Expand All @@ -534,7 +534,7 @@ impl<'a> ChainFormatterShared<'a> {
//
// In particular, overflowing is effective when the last child is a method with a multi-lined
// block-like argument (e.g., closure):
// ```ignore
// ```text
// parent.child1.child2.last_child(|a, b, c| {
// let x = foo(a, b, c);
// let y = bar(a, b, c);
Expand Down
2 changes: 1 addition & 1 deletion src/config/license.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl TemplateParser {
///
/// # Examples
///
/// ```ignore
/// ```text
/// assert_eq!(
/// TemplateParser::parse(
/// r"
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ impl MacroBranch {
///
/// # Expected syntax
///
/// ```ignore
/// ```text
/// lazy_static! {
/// [pub] static ref NAME_1: TYPE_1 = EXPR_1;
/// [pub] static ref NAME_2: TYPE_2 = EXPR_2;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ pub(crate) fn remove_trailing_white_spaces(text: &str) -> String {
/// Indent each line according to the specified `indent`.
/// e.g.
///
/// ```rust,ignore
/// ```rust,compile_fail
/// foo!{
/// x,
/// y,
Expand All @@ -521,7 +521,7 @@ pub(crate) fn remove_trailing_white_spaces(text: &str) -> String {
///
/// will become
///
/// ```rust,ignore
/// ```rust,compile_fail
/// foo!{
/// x,
/// y,
Expand Down
3 changes: 3 additions & 0 deletions tests/cargo-fmt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ macro_rules! assert_that {
};
}

#[ignore]
#[test]
fn version() {
assert_that!(&["--version"], starts_with("rustfmt "));
Expand All @@ -54,6 +55,7 @@ fn version() {
assert_that!(&["--", "--version"], starts_with("rustfmt "));
}

#[ignore]
#[test]
fn print_config() {
assert_that!(
Expand All @@ -62,6 +64,7 @@ fn print_config() {
);
}

#[ignore]
#[test]
fn rustfmt_help() {
assert_that!(&["--", "--help"], contains("Format Rust code"));
Expand Down
1 change: 1 addition & 0 deletions tests/rustfmt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ macro_rules! assert_that {
};
}

#[ignore]
#[test]
fn print_config() {
assert_that!(
Expand Down
2 changes: 1 addition & 1 deletion tests/source/issue-3055/original.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// ```
///
/// Should not format with ignore attribute
/// ```ignore
/// ```text
/// .--------------.
/// | v
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot
Expand Down
2 changes: 1 addition & 1 deletion tests/target/issue-3055/original.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// ```
///
/// Should not format with ignore attribute
/// ```ignore
/// ```text
/// .--------------.
/// | v
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot
Expand Down