Skip to content

Migrate remap-path-prefix, debug-assertions and emit-stack-sizes run-make tests to rmake #126801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rewrite debug-assertions to rmake
  • Loading branch information
Oneirical committed Jun 28, 2024
commit cb1281b76d4d90fd66bd76507e583c69625e037d
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ run-make/cross-lang-lto-clang/Makefile
run-make/cross-lang-lto-pgo-smoketest/Makefile
run-make/cross-lang-lto-upstream-rlibs/Makefile
run-make/cross-lang-lto/Makefile
run-make/debug-assertions/Makefile
run-make/dep-info-doesnt-run-much/Makefile
run-make/dep-info-spaces/Makefile
run-make/dep-info/Makefile
Expand Down
27 changes: 0 additions & 27 deletions tests/run-make/debug-assertions/Makefile

This file was deleted.

9 changes: 3 additions & 6 deletions tests/run-make/debug-assertions/debug.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#![feature(rustc_attrs)]
#![deny(warnings)]

use std::env;
use std::thread;

fn main() {
let should_fail = env::args().nth(1) == Some("bad".to_string());

assert_eq!(thread::spawn(debug_assert_eq).join().is_err(), should_fail);
assert_eq!(thread::spawn(debug_assert).join().is_err(), should_fail);
assert_eq!(thread::spawn(overflow).join().is_err(), should_fail);
assert!(thread::spawn(debug_assert_eq).join().is_ok());
assert!(thread::spawn(debug_assert).join().is_ok());
assert!(thread::spawn(overflow).join().is_ok());
}

fn debug_assert_eq() {
Expand Down
37 changes: 37 additions & 0 deletions tests/run-make/debug-assertions/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// debug.rs contains some "debug assertion" statements which
// should only be enabled in either non-optimized builds or when
// `-C debug-assertions` is set to yes. These debug assertions
// are guaranteed to fail, so this test checks that the run command
// fails where debug assertions should be activated, and succeeds where
// debug assertions should be disabled.
// See https://github.com/rust-lang/rust/pull/22980

//@ ignore-cross-compile
//@ needs-unwind

use run_make_support::{run, run_fail, rustc};

fn main() {
rustc().input("debug.rs").arg("-Cdebug-assertions=no").run();
run("debug");
rustc().input("debug.rs").opt_level("0").run();
run_fail("debug");
rustc().input("debug.rs").opt_level("1").run();
run("debug");
rustc().input("debug.rs").opt_level("2").run();
run("debug");
rustc().input("debug.rs").opt_level("3").run();
run("debug");
rustc().input("debug.rs").opt_level("s").run();
run("debug");
rustc().input("debug.rs").opt_level("z").run();
run("debug");
rustc().input("debug.rs").opt().run();
run("debug");
rustc().input("debug.rs").run();
run_fail("debug");
rustc().input("debug.rs").opt().arg("-Cdebug-assertions=yes").run();
run_fail("debug");
rustc().input("debug.rs").opt_level("1").arg("-Cdebug-assertions=yes").run();
run_fail("debug");
}