Use harness = false instead of #![feature(custom_test_frameworks)]

This commit is contained in:
hyd-dev 2021-04-30 17:22:24 +08:00
parent 41f3fe6431
commit 2da6bedaec
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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).