Skip to content

Commit

Permalink
Reproduce issue
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 21, 2024
1 parent 35cf14e commit 049f060
Show file tree
Hide file tree
Showing 10 changed files with 931 additions and 0 deletions.
824 changes: 824 additions & 0 deletions tests/integrations/dep-fail/Cargo.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tests/integrations/dep-fail/Cargo.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Error: tests failed

Location:
$DIR/src/lib.rs:LL:CC
error: test failed, to rerun pass `--test ui`

Caused by:
process didn't exit successfully: `$DIR/target/ui/tests/integrations/dep-fail/debug/deps/ui-HASH` (exit status: 1)
error: 1 target failed:
`--test ui`
40 changes: 40 additions & 0 deletions tests/integrations/dep-fail/Cargo.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished

Building dependencies ... FAILED
tests/ui/basic_test.rs ... FAILED

FAILED TEST: tests/ui/basic_test.rs
command: "\"Building dependencies\""

full stderr:
failed to compile dependencies:
command: "$CMD" "build" "--target-dir" "$DIR/tests/integrations/dep-fail/target/ui" "--manifest-path" "tested_crate/Cargo.toml" "--target=x86_64-unknown-linux-gnu" "--message-format=json"
stderr:
Blocking waiting for file lock on package cache
Compiling tested_crate v0.1.0-dev ($DIR/tests/integrations/dep-fail/tested_crate)
error: could not compile `tested_crate` (lib) due to 2 previous errors


stdout:{"reason":"compiler-message","package_id":"path+file://$DIR/tests/integrations/dep-fail/tested_crate#0.1.0-dev","manifest_path":"$DIR/tests/integrations/dep-fail/tested_crate/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"tested_crate","src_path":"$DIR/tests/integrations/dep-fail/tested_crate/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"message":{"rendered":"error: this file contains an unclosed delimiter\n --> src/lib.rs:LL:CC\n |\n1 | pub trait A {\n | - ^\n | |\n | unclosed delimiter\n\n","$message_type":"diagnostic","children":[],"code":null,"level":"error","message":"this file contains an unclosed delimiter","spans":[{"byte_end":13,"byte_start":12,"column_end":14,"column_start":13,"expansion":null,"file_name":"src/lib.rs","is_primary":false,"label":"unclosed delimiter","line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":14,"highlight_start":13,"text":"pub trait A {"}]},{"byte_end":14,"byte_start":14,"column_end":15,"column_start":15,"expansion":null,"file_name":"src/lib.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":15,"highlight_start":15,"text":"pub trait A {"}]}]}}
{"reason":"compiler-message","package_id":"path+file://$DIR/tests/integrations/dep-fail/tested_crate#0.1.0-dev","manifest_path":"$DIR/tests/integrations/dep-fail/tested_crate/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"tested_crate","src_path":"$DIR/tests/integrations/dep-fail/tested_crate/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"message":{"rendered":"error: aborting due to 1 previous error\n\n","$message_type":"diagnostic","children":[],"code":null,"level":"error","message":"aborting due to 1 previous error","spans":[]}}
{"reason":"build-finished","success":false}


Location:
$DIR/src/dependencies.rs:LL:CC
full stdout:


FAILURES:
tests/ui/basic_test.rs

test result: FAIL. 1 failed;


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished

11 changes: 11 additions & 0 deletions tests/integrations/dep-fail/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "compile_test"
version = "0.1.0"
edition = "2021"

[dev-dependencies]
ui_test = { path = "../../.." }

[[test]]
name = "ui"
harness = false
Empty file.
7 changes: 7 additions & 0 deletions tests/integrations/dep-fail/tested_crate/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/integrations/dep-fail/tested_crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "tested_crate"
version = "0.1.0-dev"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
1 change: 1 addition & 0 deletions tests/integrations/dep-fail/tested_crate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub trait A {
29 changes: 29 additions & 0 deletions tests/integrations/dep-fail/tests/ui.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use ui_test::{
default_file_filter, default_per_file_config, dependencies::DependencyBuilder,
run_tests_generic, status_emitter::Text, Args, Config, OutputConflictHandling,
};

fn main() -> ui_test::Result<()> {
let mut config = Config {
output_conflict_handling: OutputConflictHandling::Ignore,
..Config::rustc("tests/ui")
};
config.comment_defaults.base().set_custom(
"dependencies",
DependencyBuilder {
crate_manifest_path: "tested_crate/Cargo.toml".into(),
..DependencyBuilder::default()
},
);

let args = Args::test()?;

config.with_args(&args);

run_tests_generic(
[config].into(),
default_file_filter,
default_per_file_config,
Text::verbose(),
)
}
1 change: 1 addition & 0 deletions tests/integrations/dep-fail/tests/ui/basic_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use tested_crate::A;

0 comments on commit 049f060

Please sign in to comment.