Skip to content
4 changes: 2 additions & 2 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
# Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712
$env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR
$env:NUGET_EXE_Version = "3.4.3"
$env:DOTNET_CLI_VERSION = "LATEST"
$env:DOTNET_RUNTIME_VERSION = "LATEST"
$env:DOTNET_CLI_VERSION = "2.1.0-preview1-007372"
# $env:DOTNET_RUNTIME_VERSION = "LATEST"
$env:VSWHERE_VERSION = "2.0.2"
$env:MSBUILD_VERSION = "15.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,9 @@ private Dictionary<string, DataCollectionEnvironmentVariable> GetEnvironmentVari
var dataCollectorEnvironmentVariable = new Dictionary<string, DataCollectionEnvironmentVariable>(StringComparer.OrdinalIgnoreCase);
foreach (var dataCollectorInfo in this.RunDataCollectors.Values)
{
dataCollectorInfo.SetTestExecutionEnvironmentVariables();
try
{
dataCollectorInfo.SetTestExecutionEnvironmentVariables();
this.AddCollectorEnvironmentVariables(dataCollectorInfo, dataCollectorEnvironmentVariable);
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ private static string AddDefaultRunSettings(string runSettings)
var document = new XmlDocument();
document.Load(reader);

var navigator = document.CreateNavigator();

InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(navigator, architecture, framework, defaultResultsDirectory);
return navigator.OuterXml;
InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(document, architecture, framework, defaultResultsDirectory);
return document.OuterXml;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class ProxyExecutionManagerWithDataCollection : ProxyExecutionManager
/// <summary>
/// Initializes a new instance of the <see cref="ProxyExecutionManagerWithDataCollection"/> class.
/// </summary>
/// <param name="testRequestSender">
/// <param name="requestSender">
/// Test request sender instance.
/// </param>
/// <param name="testHostManager">
Expand All @@ -44,6 +44,7 @@ public ProxyExecutionManagerWithDataCollection(IRequestData requestData, ITestRe
this.ProxyDataCollectionManager = proxyDataCollectionManager;
this.DataCollectionRunEventsHandler = new DataCollectionRunEventsHandler();
this.requestData = requestData;
this.dataCollectionEnvironmentVariables = new Dictionary<string, string>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public DataCollectionParameters BeforeTestRunStart(
ITestMessageEventHandler runEventsHandler)
{
var areTestCaseLevelEventsRequired = false;
IDictionary<string, string> environmentVariables = null;
IDictionary<string, string> environmentVariables = new Dictionary<string, string>();

var dataCollectionEventsPort = 0;
this.InvokeDataCollectionServiceAction(
Expand Down
14 changes: 3 additions & 11 deletions src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -556,19 +556,11 @@ internal static class DiaSourceObject

public static IDiaDataSource GetDiaSourceObject()
{
var currentDirectory = new ProcessHelper().GetCurrentProcessLocation();
var nativeDllDirectory = new ProcessHelper().GetNativeDllDirectory();

IntPtr modHandle = IntPtr.Zero;
if (IntPtr.Size == 8)
{
modHandle = LoadLibraryEx(Path.Combine(currentDirectory, "x64\\msdia140.dll"), IntPtr.Zero, 0);
}
else
{
modHandle = LoadLibraryEx(Path.Combine(currentDirectory, "x86\\msdia140.dll"), IntPtr.Zero, 0);
}
IntPtr modHandle = LoadLibraryEx(Path.Combine(nativeDllDirectory, "msdia140.dll"), IntPtr.Zero, 0);

if(modHandle == IntPtr.Zero)
if (modHandle == IntPtr.Zero)
{
throw new COMException(string.Format(Resources.Resources.FailedToLoadMsDia));
}
Expand Down
11 changes: 4 additions & 7 deletions src/Microsoft.TestPlatform.ObjectModel/TestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel
[DataContract]
public sealed class TestCase : TestObject
{
#if TODO
/// <summary>
/// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties.
/// Note that this data is available only for in-Proc execution, and may not be available for OutProc executors
/// </summary>
private Object m_localExtensionData;
#endif
private Object localExtensionData;

private Guid defaultId = Guid.Empty;
private Guid id;
private string displayName;
Expand Down Expand Up @@ -70,17 +69,15 @@ public TestCase(string fullyQualifiedName, Uri executorUri, string source)

#region Properties

#if TODO
/// <summary>
/// LocalExtensionData which can be used by Adapter developers for local transfer of extended properties.
/// Note that this data is available only for in-Proc execution, and may not be available for OutProc executors
/// </summary>
public Object LocalExtensionData
{
get { return m_localExtensionData; }
set { m_localExtensionData = value; }
get { return localExtensionData; }
set { localExtensionData = value; }
}
#endif

/// <summary>
/// Gets or sets the id of the test case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,14 @@ public static IXPathNavigable CreateDefaultRunSettings()
#if NET451
return doc;
#else
return doc.ToXPathNavigable();
// Xmldocument doesn't inherit from XmlDocument for netcoreapp2.0
var ret = doc as IXPathNavigable;
if (ret == null)
{
return doc.ToXPathNavigable();
}

return ret;
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ public interface IProcessHelper
/// <returns>Location of test engine.</returns>
string GetTestEngineDirectory();

/// <summary>
/// Gets the location of native dll's, depending on current process architecture..
/// </summary>
/// <returns>Location of native dll's</returns>
string GetNativeDllDirectory();

/// <summary>
/// Gets current process architecture
/// </summary>
/// <returns>Process Architecture</returns>
PlatformArchitecture GetCurrentProcessArchitecture();

/// <summary>
/// Gets the process id of test engine.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions
/// </summary>
public partial class ProcessHelper : IProcessHelper
{
private static readonly string ARM = "arm";

/// <inheritdoc/>
public object LaunchProcess(string processPath, string arguments, string workingDirectory, IDictionary<string, string> envVariables, Action<object, string> errorCallback, Action<object> exitCallBack)
{
Expand Down Expand Up @@ -162,5 +164,23 @@ public int GetProcessId(object process)
var proc = process as Process;
return proc?.Id ?? -1;
}

/// <inheritdoc/>
public PlatformArchitecture GetCurrentProcessArchitecture()
{
if (IntPtr.Size == 8)
{
return PlatformArchitecture.X64;
}

return PlatformArchitecture.X86;
}

/// <inheritdoc/>
public string GetNativeDllDirectory()
{
var isArm = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").Contains("ARM");
return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString(), isArm ? ARM : string.Empty);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,17 @@ public int GetProcessId(object process)
{
throw new NotImplementedException();
}

/// <inheritdoc/>
public string GetNativeDllDirectory()
{
throw new NotImplementedException();
}

/// <inheritdoc/>
public PlatformArchitecture GetCurrentProcessArchitecture()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,23 @@ public int GetProcessId(object process)
{
return -1;
}

/// <inheritdoc/>
public PlatformArchitecture GetCurrentProcessArchitecture()
{
if (IntPtr.Size == 8)
{
return PlatformArchitecture.X64;
}

return PlatformArchitecture.X86;
}

/// <inheritdoc/>
public string GetNativeDllDirectory()
{
// For UWP the native dll's are to be kept in same directory
return this.GetCurrentProcessLocation();
}
}
}
Loading