]> git.lizzy.rs Git - rust.git/blobdiff - src/libtest/lib.rs
Rollup merge of #68485 - kingslef:fix/test-60976, r=nikomatsakis
[rust.git] / src / libtest / lib.rs
index 4c4d795824318aae19620a7fffb4f4b0c04a6741..e99473177e8384ce3603c32138358fd29db661da 100644 (file)
@@ -153,12 +153,13 @@ pub fn test_main_static_abort(tests: &[&TestDescAndFn]) {
     // If we're being run in SpawnedSecondary mode, run the test here. run_test
     // will then exit the process.
     if let Ok(name) = env::var(SECONDARY_TEST_INVOKER_VAR) {
+        env::remove_var(SECONDARY_TEST_INVOKER_VAR);
         let test = tests
             .iter()
             .filter(|test| test.desc.name.as_slice() == name)
             .map(make_owned_test)
             .next()
-            .expect("couldn't find a test with the provided name");
+            .expect(&format!("couldn't find a test with the provided name '{}'", name));
         let TestDescAndFn { desc, testfn } = test;
         let testfn = match testfn {
             StaticTestFn(f) => f,