Skip to content

Commit 0e30385

Browse files
committed
Auto merge of #1784 - hyd-dev:harness-false, r=RalfJung
Use `harness = false` instead of `#![feature(custom_test_frameworks)]` Quoting from the comment in `tests/compiletest.rs`: > Custom test runner, to avoid libtest being wrapped around compiletest which wraps libtest. I believe `harness = false` is more suitable for that purpose. I have verified that both `./miri test` and `LD_LIBRARY_PATH=$PWD/build/x86_64-unknown-linux-gnu/stage2/lib PATH=$PWD/build/bin:$PATH ./x.py test src/tools/miri` work well.
2 parents 41f3fe6 + 2da6bed commit 0e30385

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ colored = "2"
4545
# This crate uses #[feature(rustc_private)].
4646
# See https://github.com/rust-analyzer/rust-analyzer/pull/7891
4747
rustc_private = true
48+
49+
[[test]]
50+
name = "compiletest"
51+
harness = false

tests/compiletest.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#![feature(custom_test_frameworks)]
2-
// Custom test runner, to avoid libtest being wrapped around compiletest which wraps libtest.
3-
#![test_runner(test_runner)]
4-
51
use std::env;
62
use std::path::PathBuf;
73

@@ -83,7 +79,7 @@ fn get_target() -> String {
8379
env::var("MIRI_TEST_TARGET").unwrap_or_else(|_| get_host())
8480
}
8581

86-
fn test_runner(_tests: &[&()]) {
82+
fn main() {
8783
// Add a test env var to do environment communication tests.
8884
env::set_var("MIRI_ENV_VAR_TEST", "0");
8985
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).

0 commit comments

Comments
 (0)