Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
Adding RuntimePath to IRuntimeEnvironment
Browse files Browse the repository at this point in the history
Fixes #2534
  • Loading branch information
moozzyk committed Sep 28, 2015
1 parent 2c1d272 commit 152debf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Microsoft.Dnx.Host/RuntimeEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public RuntimeEnvironment(BootstrapperContext bootstrapperContext)
RuntimeArchitecture = bootstrapperContext.Architecture;
OperatingSystem = bootstrapperContext.OperatingSystem;
OperatingSystemVersion = bootstrapperContext.OsVersion;
RuntimePath = bootstrapperContext.RuntimeDirectory;
}

public string OperatingSystem { get; }
Expand All @@ -43,5 +44,7 @@ public string RuntimeVersion
return _runtimeVersion;
}
}

public string RuntimePath { get; }
}
}
5 changes: 5 additions & 0 deletions src/Microsoft.Dnx.Runtime.Abstractions/IRuntimeEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ public interface IRuntimeEnvironment
/// Gets the runtime version.
/// </summary>
string RuntimeVersion { get; }

/// <summary>
/// Gets the path to the runtime foler.
/// </summary>
string RuntimePath { get; }
}
}
5 changes: 4 additions & 1 deletion test/Microsoft.Dnx.Host.Tests/RuntimeEnvironmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ public void RuntimeEnvironment_InitializedCorrectly()
OperatingSystem = "Windows",
OsVersion = "10.0",
Architecture = "x64",
RuntimeType = "CoreClr"
RuntimeType = "CoreClr",
RuntimeDirectory = "c:/temp"
});

Assert.Equal(runtimeEnv.OperatingSystem, "Windows");
Assert.Equal(runtimeEnv.OperatingSystemVersion, "10.0");
Assert.Equal(runtimeEnv.RuntimeArchitecture, "x64");
Assert.Equal(runtimeEnv.RuntimeType, "CoreClr");
Assert.Equal(runtimeEnv.RuntimePath, "c:/temp");
}

// Test RID generation
Expand Down Expand Up @@ -154,6 +156,7 @@ private class DummyRuntimeEnvironment : IRuntimeEnvironment
public string RuntimeArchitecture { get; set; }
public string RuntimeType { get; set; }
public string RuntimeVersion { get; set; }
public string RuntimePath { get; set; }
}
}
}

0 comments on commit 152debf

Please sign in to comment.