Skip to content

Commit

Permalink
Fix SGX CI, take 3
Browse files Browse the repository at this point in the history
Broken in rust-lang#79038
  • Loading branch information
Jethro Beekman committed Dec 7, 2020
1 parent 2b76c48 commit 9703bb8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions library/std/tests/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ fn test_env_set_var() {
}

#[test]
#[cfg_attr(any(target_os = "emscripten", target_env = "sgx"), ignore)]
#[cfg_attr(not(any(unix, windows)), ignore, allow(unused))]
#[allow(deprecated)]
fn env_home_dir() {
use std::path::PathBuf;

fn var_to_os_string(var: Result<String, VarError>) -> Option<OsString> {
match var {
Ok(var) => Some(OsString::from(var)),
Expand All @@ -91,8 +93,6 @@ fn env_home_dir() {

cfg_if::cfg_if! {
if #[cfg(unix)] {
use std::path::PathBuf;

let oldhome = var_to_os_string(var("HOME"));

set_var("HOME", "/home/MountainView");
Expand All @@ -110,8 +110,6 @@ fn env_home_dir() {

if let Some(oldhome) = oldhome { set_var("HOME", oldhome); }
} else if #[cfg(windows)] {
use std::path::PathBuf;

let oldhome = var_to_os_string(var("HOME"));
let olduserprofile = var_to_os_string(var("USERPROFILE"));

Expand Down

0 comments on commit 9703bb8

Please sign in to comment.