Skip to content

Commit 2322641

Browse files
committed
Fix output in our test suite sometimes getting colors
1 parent 5cd8fb3 commit 2322641

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/integrations/dep-fail/Cargo.stdout

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ Building dependencies ... FAILED
77
tests/ui/basic_test.rs ... FAILED
88

99
FAILED TEST: tests/ui/basic_test.rs
10-
command: "$CMD" "build" "--target-dir" "$DIR/tests/integrations/dep-fail/target/ui/0" "--manifest-path" "tested_crate/Cargo.toml" "--message-format=json"
10+
command: "$CMD" "build" "--color=never" "--quiet" "--jobs" "1" "--target-dir" "$DIR/tests/integrations/dep-fail/target/ui/0" "--manifest-path" "tested_crate/Cargo.toml" "--message-format=json"
1111

1212
full stderr:
13-
Compiling tested_crate v0.1.0-dev ($DIR/tests/integrations/dep-fail/tested_crate)
1413
error: could not compile `tested_crate` (lib) due to 1 previous error
1514

1615
full stdout:

tests/integrations/dep-fail/tests/ui.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use ui_test::{
22
default_file_filter, default_per_file_config, dependencies::DependencyBuilder,
3-
run_tests_generic, status_emitter::Text, Args, Config,
3+
run_tests_generic, status_emitter::Text, Args, CommandBuilder, Config,
44
};
55

66
fn main() -> ui_test::Result<()> {
@@ -12,6 +12,10 @@ fn main() -> ui_test::Result<()> {
1212
"dependencies",
1313
DependencyBuilder {
1414
crate_manifest_path: "tested_crate/Cargo.toml".into(),
15+
// Since this is run in CI and locally we need to hide all output
16+
// which the default cargo build does. Users usually don't record the
17+
// output of ui_test itself, so they don't encounter this.
18+
program: CommandBuilder::cargo(),
1519
..DependencyBuilder::default()
1620
},
1721
);

0 commit comments

Comments
 (0)