Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions Nodejs/Product/TestAdapter/TestExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,23 +226,28 @@ private void RunTestCase(VisualStudioApp app, IFrameworkHandle frameworkHandle,
}

private NodejsProjectSettings LoadProjectSettings(string projectFile) {
var buildEngine = new MSBuild.ProjectCollection();
var env = new Dictionary<string, string>();
#if DEV15
var root = Environment.GetEnvironmentVariable(NodejsConstants.NodeToolsVsInstallRootEnvironmentVariable);
if (!string.IsNullOrEmpty(root)) {
env["VsInstallRoot"] = root;
env["MSBuildExtensionsPath32"] = Path.Combine(root, "MSBuild");
}
#endif
var buildEngine = new MSBuild.ProjectCollection(env);
var proj = buildEngine.LoadProject(projectFile);

var projectRootDir = Path.GetFullPath(Path.Combine(proj.DirectoryPath, proj.GetPropertyValue(CommonConstants.ProjectHome) ?? "."));

NodejsProjectSettings projSettings = new NodejsProjectSettings();

projSettings.ProjectRootDir = projectRootDir;
return new NodejsProjectSettings() {
ProjectRootDir = projectRootDir,

projSettings.WorkingDir = Path.GetFullPath(Path.Combine(projectRootDir, proj.GetPropertyValue(CommonConstants.WorkingDirectory) ?? "."));
WorkingDir = Path.GetFullPath(Path.Combine(projectRootDir, proj.GetPropertyValue(CommonConstants.WorkingDirectory) ?? ".")),

projSettings.NodeExePath =
Nodejs.GetAbsoluteNodeExePath(
NodeExePath = Nodejs.GetAbsoluteNodeExePath(
projectRootDir,
proj.GetPropertyValue(NodeProjectProperty.NodeExePath));

return projSettings;
proj.GetPropertyValue(NodeProjectProperty.NodeExePath))
};
}

private static void RecordEnd(IFrameworkHandle frameworkHandle, TestCase test, TestResult result, string stdout, string stderr, TestOutcome outcome) {
Expand Down