Skip to content

Commit

Permalink
Move test to be make instead of ui
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Aug 6, 2024
1 parent f4bad4f commit 5e26c8d
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 132 deletions.
6 changes: 6 additions & 0 deletions tests/run-make/crate-loading/multiple-dep-versions-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#![crate_name = "dependency"]
#![crate_type = "rlib"]
pub struct Type;
pub trait Trait {}
impl Trait for Type {}
pub fn do_something<X: Trait>(_: X) {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![crate_name="dependency"]
//@ edition:2021
//@ compile-flags: -C metadata=2 -C extra-filename=-2
#![crate_name = "dependency"]
#![crate_type = "rlib"]
pub struct Type(pub i32);
pub trait Trait {}
impl Trait for Type {}
Expand Down
8 changes: 8 additions & 0 deletions tests/run-make/crate-loading/multiple-dep-versions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extern crate dep_2_reexport;
extern crate dependency;
use dep_2_reexport::do_something;
use dependency::Type;

fn main() {
do_something(Type);
}
31 changes: 31 additions & 0 deletions tests/run-make/crate-loading/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//@ only-linux
//@ ignore-wasm32
//@ ignore-wasm64

use run_make_support::rfs::copy;
use run_make_support::{assert_contains, rust_lib_name, rustc};

fn main() {
rustc().input("multiple-dep-versions-1.rs").run();
rustc().input("multiple-dep-versions-2.rs").extra_filename("2").metadata("2").run();

let out = rustc()
.input("multiple-dep-versions.rs")
.extern_("dependency", rust_lib_name("dependency"))
.extern_("dep_2_reexport", rust_lib_name("dependency2"))
.inspect(|cmd| eprintln!("{cmd:?}"))
.run_fail();
let stderr = out.stderr_utf8();
assert_contains(
&stderr,
"you have multiple different versions of crate `dependency` in your dependency graph",
);
assert_contains(
&stderr,
"two types coming from two different versions of the same crate are different types even \
if they look the same",
);
assert_contains(&stderr, "this type doesn't implement the required trait");
assert_contains(&stderr, "this type implements the required trait");
assert_contains(&stderr, "this is the required trait");
}
4 changes: 0 additions & 4 deletions tests/ui/crate-loading/auxiliary/dep-2-reexport.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/ui/crate-loading/auxiliary/multiple-dep-versions-1.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/ui/crate-loading/multiple-dep-versions.rs

This file was deleted.

103 changes: 0 additions & 103 deletions tests/ui/crate-loading/multiple-dep-versions.svg

This file was deleted.

0 comments on commit 5e26c8d

Please sign in to comment.