diff options
Diffstat (limited to 'tests/testsuite/mock-std')
21 files changed, 164 insertions, 0 deletions
diff --git a/tests/testsuite/mock-std/Cargo.toml b/tests/testsuite/mock-std/Cargo.toml new file mode 100644 index 0000000..a69aa4b --- /dev/null +++ b/tests/testsuite/mock-std/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] +members = [ + "library/alloc", + "library/core", + "library/proc_macro", + "library/std", + "library/test", +] diff --git a/tests/testsuite/mock-std/library/alloc/Cargo.toml b/tests/testsuite/mock-std/library/alloc/Cargo.toml new file mode 100644 index 0000000..dc965ab --- /dev/null +++ b/tests/testsuite/mock-std/library/alloc/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "alloc" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" + +[dependencies] +registry-dep-using-core = { version = "*", features = ['mockbuild'] } diff --git a/tests/testsuite/mock-std/library/alloc/src/lib.rs b/tests/testsuite/mock-std/library/alloc/src/lib.rs new file mode 100644 index 0000000..823716e --- /dev/null +++ b/tests/testsuite/mock-std/library/alloc/src/lib.rs @@ -0,0 +1,11 @@ +#![feature(staged_api)] +#![stable(since = "1.0.0", feature = "dummy")] + +extern crate alloc; + +#[stable(since = "1.0.0", feature = "dummy")] +pub use alloc::*; + +#[stable(since = "1.0.0", feature = "dummy")] +pub fn custom_api() { +} diff --git a/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml b/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml new file mode 100644 index 0000000..d1df281 --- /dev/null +++ b/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "compiler_builtins" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" diff --git a/tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs b/tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs new file mode 100644 index 0000000..65e2cc3 --- /dev/null +++ b/tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs @@ -0,0 +1 @@ +// intentionally blank diff --git a/tests/testsuite/mock-std/library/core/Cargo.toml b/tests/testsuite/mock-std/library/core/Cargo.toml new file mode 100644 index 0000000..3f7de53 --- /dev/null +++ b/tests/testsuite/mock-std/library/core/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "core" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" diff --git a/tests/testsuite/mock-std/library/core/src/lib.rs b/tests/testsuite/mock-std/library/core/src/lib.rs new file mode 100644 index 0000000..b90ed09 --- /dev/null +++ b/tests/testsuite/mock-std/library/core/src/lib.rs @@ -0,0 +1,9 @@ +#![feature(staged_api)] +#![stable(since = "1.0.0", feature = "dummy")] + +#[stable(since = "1.0.0", feature = "dummy")] +pub use core::*; + +#[stable(since = "1.0.0", feature = "dummy")] +pub fn custom_api() { +} diff --git a/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml b/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml new file mode 100644 index 0000000..e7beb92 --- /dev/null +++ b/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "panic_unwind" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" diff --git a/tests/testsuite/mock-std/library/panic_unwind/src/lib.rs b/tests/testsuite/mock-std/library/panic_unwind/src/lib.rs new file mode 100644 index 0000000..6af65d8 --- /dev/null +++ b/tests/testsuite/mock-std/library/panic_unwind/src/lib.rs @@ -0,0 +1,5 @@ +#![feature(panic_unwind, panic_runtime)] +#![panic_runtime] +#![no_std] + +extern crate panic_unwind; diff --git a/tests/testsuite/mock-std/library/proc_macro/Cargo.toml b/tests/testsuite/mock-std/library/proc_macro/Cargo.toml new file mode 100644 index 0000000..939a113 --- /dev/null +++ b/tests/testsuite/mock-std/library/proc_macro/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "proc_macro" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" diff --git a/tests/testsuite/mock-std/library/proc_macro/src/lib.rs b/tests/testsuite/mock-std/library/proc_macro/src/lib.rs new file mode 100644 index 0000000..82a7684 --- /dev/null +++ b/tests/testsuite/mock-std/library/proc_macro/src/lib.rs @@ -0,0 +1,11 @@ +#![feature(staged_api)] +#![stable(since = "1.0.0", feature = "dummy")] + +extern crate proc_macro; + +#[stable(since = "1.0.0", feature = "dummy")] +pub use proc_macro::*; + +#[stable(since = "1.0.0", feature = "dummy")] +pub fn custom_api() { +} diff --git a/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml new file mode 100644 index 0000000..6b86f22 --- /dev/null +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "rustc-std-workspace-alloc" +version = "1.9.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" + +[lib] +path = "lib.rs" + +[dependencies] +alloc = { path = "../alloc" } diff --git a/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs new file mode 100644 index 0000000..2bbfa1a --- /dev/null +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs @@ -0,0 +1,3 @@ +#![no_std] + +pub use alloc::*; diff --git a/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml new file mode 100644 index 0000000..8d19216 --- /dev/null +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "rustc-std-workspace-core" +version = "1.9.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" + +[lib] +path = "lib.rs" + +[dependencies] +core = { path = "../core" } diff --git a/tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs new file mode 100644 index 0000000..8162517 --- /dev/null +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs @@ -0,0 +1,3 @@ +#![no_std] + +pub use core::*; diff --git a/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml new file mode 100644 index 0000000..91572b8 --- /dev/null +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "rustc-std-workspace-std" +version = "1.9.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" + +[lib] +path = "lib.rs" + +[dependencies] +std = { path = "../std" } diff --git a/tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs new file mode 100644 index 0000000..f40d09c --- /dev/null +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs @@ -0,0 +1 @@ +pub use std::*; diff --git a/tests/testsuite/mock-std/library/std/Cargo.toml b/tests/testsuite/mock-std/library/std/Cargo.toml new file mode 100644 index 0000000..d2cfdea --- /dev/null +++ b/tests/testsuite/mock-std/library/std/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "std" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" + +[dependencies] +registry-dep-using-alloc = { version = "*", features = ['mockbuild'] } + +[features] +feature1 = [] diff --git a/tests/testsuite/mock-std/library/std/src/lib.rs b/tests/testsuite/mock-std/library/std/src/lib.rs new file mode 100644 index 0000000..146d4c4 --- /dev/null +++ b/tests/testsuite/mock-std/library/std/src/lib.rs @@ -0,0 +1,12 @@ +#![feature(staged_api)] +#![stable(since = "1.0.0", feature = "dummy")] + +#[stable(since = "1.0.0", feature = "dummy")] +pub use std::*; + +#[stable(since = "1.0.0", feature = "dummy")] +pub fn custom_api() {} + +#[cfg(feature = "feature1")] +#[stable(since = "1.0.0", feature = "dummy")] +pub fn conditional_function() {} diff --git a/tests/testsuite/mock-std/library/test/Cargo.toml b/tests/testsuite/mock-std/library/test/Cargo.toml new file mode 100644 index 0000000..299db7b --- /dev/null +++ b/tests/testsuite/mock-std/library/test/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "test" +version = "0.1.0" +authors = ["Alex Crichton <alex@alexcrichton.com>"] +edition = "2018" + +[dependencies] +proc_macro = { path = "../proc_macro" } +std = { path = "../std" } +panic_unwind = { path = "../panic_unwind" } +compiler_builtins = { path = "../compiler_builtins" } +registry-dep-using-std = { version = "*", features = ['mockbuild'] } + +[features] +panic-unwind = [] +backtrace = [] +feature1 = ["std/feature1"] +default = [] diff --git a/tests/testsuite/mock-std/library/test/src/lib.rs b/tests/testsuite/mock-std/library/test/src/lib.rs new file mode 100644 index 0000000..a112855 --- /dev/null +++ b/tests/testsuite/mock-std/library/test/src/lib.rs @@ -0,0 +1,10 @@ +#![feature(staged_api)] +#![feature(test)] +#![unstable(feature = "test", issue = "none")] + +extern crate test; + +pub use test::*; + +pub fn custom_api() { +} |