Test a small cargo-miri smoke test even in run_tests_minimal
This makes sure that cargo-miri works on all targets.
This commit is contained in:
parent
8b0b2d136e
commit
2c456b5123
6 changed files with 64 additions and 0 deletions
|
@ -73,6 +73,10 @@ function run_tests_minimal {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./miri test -- "$@"
|
./miri test -- "$@"
|
||||||
|
|
||||||
|
# Ensure that a small smoke test of cargo-miri works.
|
||||||
|
# Note: This doesn't work on windows because of TLS.
|
||||||
|
cargo miri run --manifest-path test-cargo-miri/no-std-smoke/Cargo.toml
|
||||||
}
|
}
|
||||||
|
|
||||||
# host
|
# host
|
||||||
|
|
|
@ -81,6 +81,10 @@ version = "0.1.0"
|
||||||
name = "issue_rust_86261"
|
name = "issue_rust_86261"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "no-std-smoke"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.44"
|
version = "1.0.44"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["subcrate", "issue-1567", "exported-symbol-dep"]
|
members = ["subcrate", "issue-1567", "exported-symbol-dep"]
|
||||||
|
exclude = ["no-std-smoke"] # it wants to be panic="abort"
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "cargo-miri-test"
|
name = "cargo-miri-test"
|
||||||
|
|
7
src/tools/miri/test-cargo-miri/no-std-smoke/Cargo.lock
Normal file
7
src/tools/miri/test-cargo-miri/no-std-smoke/Cargo.lock
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "no-std-smoke"
|
||||||
|
version = "0.1.0"
|
14
src/tools/miri/test-cargo-miri/no-std-smoke/Cargo.toml
Normal file
14
src/tools/miri/test-cargo-miri/no-std-smoke/Cargo.toml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[package]
|
||||||
|
name = "no-std-smoke"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
panic = 'abort'
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
panic = 'abort'
|
34
src/tools/miri/test-cargo-miri/no-std-smoke/src/main.rs
Normal file
34
src/tools/miri/test-cargo-miri/no-std-smoke/src/main.rs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// Copied from tests/pass/no-std.rs
|
||||||
|
|
||||||
|
#![feature(start)]
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
|
// Plumbing to let us use `writeln!` to host stdout:
|
||||||
|
|
||||||
|
extern "Rust" {
|
||||||
|
fn miri_write_to_stdout(bytes: &[u8]);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Host;
|
||||||
|
|
||||||
|
use core::fmt::Write;
|
||||||
|
|
||||||
|
impl Write for Host {
|
||||||
|
fn write_str(&mut self, s: &str) -> core::fmt::Result {
|
||||||
|
unsafe {
|
||||||
|
miri_write_to_stdout(s.as_bytes());
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[start]
|
||||||
|
fn start(_: isize, _: *const *const u8) -> isize {
|
||||||
|
writeln!(Host, "hello, world!").unwrap();
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue