From 2da6bedaec3f072daae18b7d59e45dd090d48428 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Fri, 30 Apr 2021 17:22:24 +0800 Subject: [PATCH] Use `harness = false` instead of `#![feature(custom_test_frameworks)]` --- Cargo.toml | 4 ++++ tests/compiletest.rs | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2483cb2c812..ab7d88e6693 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 5de5dfb4c67..a0d49c9ddcf 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -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; @@ -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).