Skip to content

Commit

Permalink
Auto merge of #1784 - hyd-dev:harness-false, r=RalfJung
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed May 1, 2021
2 parents 41f3fe6 + 2da6bed commit 0e30385
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ colored = "2"
# This crate uses #[feature(rustc_private)].
# See https://github.com/rust-analyzer/rust-analyzer/pull/7891
rustc_private = true

[[test]]
name = "compiletest"
harness = false
6 changes: 1 addition & 5 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#![feature(custom_test_frameworks)]
// Custom test runner, to avoid libtest being wrapped around compiletest which wraps libtest.
#![test_runner(test_runner)]

use std::env;
use std::path::PathBuf;

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

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

0 comments on commit 0e30385

Please sign in to comment.