Skip to content

Commit 66c27c9

Browse files
authored
Add #[ignore] to test that runs external process (#3690)
1 parent 640b8d0 commit 66c27c9

File tree

10 files changed

+20
-14
lines changed

10 files changed

+20
-14
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ script:
4949
if [ -z ${INTEGRATION} ]; then
5050
cargo build
5151
cargo test
52+
cargo test -- --ignored
5253
else
5354
./ci/integration.sh
5455
fi

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ build: false
5050
test_script:
5151
- cargo build --verbose
5252
- cargo test
53+
- cargo test -- --ignored

src/chains.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! following values of `chain_indent`:
1717
//! Block:
1818
//!
19-
//! ```ignore
19+
//! ```text
2020
//! let foo = {
2121
//! aaaa;
2222
//! bbb;
@@ -27,7 +27,7 @@
2727
//!
2828
//! Visual:
2929
//!
30-
//! ```ignore
30+
//! ```text
3131
//! let foo = {
3232
//! aaaa;
3333
//! bbb;
@@ -41,15 +41,15 @@
4141
//! the braces.
4242
//! Block:
4343
//!
44-
//! ```ignore
44+
//! ```text
4545
//! let a = foo.bar
4646
//! .baz()
4747
//! .qux
4848
//! ```
4949
//!
5050
//! Visual:
5151
//!
52-
//! ```ignore
52+
//! ```text
5353
//! let a = foo.bar
5454
//! .baz()
5555
//! .qux
@@ -454,7 +454,7 @@ trait ChainFormatter {
454454
// Parent is the first item in the chain, e.g., `foo` in `foo.bar.baz()`.
455455
// Root is the parent plus any other chain items placed on the first line to
456456
// avoid an orphan. E.g.,
457-
// ```ignore
457+
// ```text
458458
// foo.bar
459459
// .baz()
460460
// ```
@@ -516,7 +516,7 @@ impl<'a> ChainFormatterShared<'a> {
516516
// know whether 'overflowing' the last child make a better formatting:
517517
//
518518
// A chain with overflowing the last child:
519-
// ```ignore
519+
// ```text
520520
// parent.child1.child2.last_child(
521521
// a,
522522
// b,
@@ -525,7 +525,7 @@ impl<'a> ChainFormatterShared<'a> {
525525
// ```
526526
//
527527
// A chain without overflowing the last child (in vertical layout):
528-
// ```ignore
528+
// ```text
529529
// parent
530530
// .child1
531531
// .child2
@@ -534,7 +534,7 @@ impl<'a> ChainFormatterShared<'a> {
534534
//
535535
// In particular, overflowing is effective when the last child is a method with a multi-lined
536536
// block-like argument (e.g., closure):
537-
// ```ignore
537+
// ```text
538538
// parent.child1.child2.last_child(|a, b, c| {
539539
// let x = foo(a, b, c);
540540
// let y = bar(a, b, c);

src/config/license.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl TemplateParser {
8282
///
8383
/// # Examples
8484
///
85-
/// ```ignore
85+
/// ```text
8686
/// assert_eq!(
8787
/// TemplateParser::parse(
8888
/// r"

src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ impl MacroBranch {
14171417
///
14181418
/// # Expected syntax
14191419
///
1420-
/// ```ignore
1420+
/// ```text
14211421
/// lazy_static! {
14221422
/// [pub] static ref NAME_1: TYPE_1 = EXPR_1;
14231423
/// [pub] static ref NAME_2: TYPE_2 = EXPR_2;

src/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub(crate) fn remove_trailing_white_spaces(text: &str) -> String {
507507
/// Indent each line according to the specified `indent`.
508508
/// e.g.
509509
///
510-
/// ```rust,ignore
510+
/// ```rust,compile_fail
511511
/// foo!{
512512
/// x,
513513
/// y,
@@ -521,7 +521,7 @@ pub(crate) fn remove_trailing_white_spaces(text: &str) -> String {
521521
///
522522
/// will become
523523
///
524-
/// ```rust,ignore
524+
/// ```rust,compile_fail
525525
/// foo!{
526526
/// x,
527527
/// y,

tests/cargo-fmt/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ macro_rules! assert_that {
4646
};
4747
}
4848

49+
#[ignore]
4950
#[test]
5051
fn version() {
5152
assert_that!(&["--version"], starts_with("rustfmt "));
@@ -54,6 +55,7 @@ fn version() {
5455
assert_that!(&["--", "--version"], starts_with("rustfmt "));
5556
}
5657

58+
#[ignore]
5759
#[test]
5860
fn print_config() {
5961
assert_that!(
@@ -62,6 +64,7 @@ fn print_config() {
6264
);
6365
}
6466

67+
#[ignore]
6568
#[test]
6669
fn rustfmt_help() {
6770
assert_that!(&["--", "--help"], contains("Format Rust code"));

tests/rustfmt/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ macro_rules! assert_that {
4848
};
4949
}
5050

51+
#[ignore]
5152
#[test]
5253
fn print_config() {
5354
assert_that!(

tests/source/issue-3055/original.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/// ```
1818
///
1919
/// Should not format with ignore attribute
20-
/// ```ignore
20+
/// ```text
2121
/// .--------------.
2222
/// | v
2323
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot

tests/target/issue-3055/original.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/// ```
1919
///
2020
/// Should not format with ignore attribute
21-
/// ```ignore
21+
/// ```text
2222
/// .--------------.
2323
/// | v
2424
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot

0 commit comments

Comments
 (0)