Skip to content

Commit

Permalink
Revert "Port fixes (#1236)"
Browse files Browse the repository at this point in the history
This reverts commit dd361e4.
  • Loading branch information
smadala authored Oct 31, 2017
1 parent dd361e4 commit 27fda0c
Show file tree
Hide file tree
Showing 24 changed files with 259 additions and 286 deletions.
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 = "2.1.0-preview1-007372"
# $env:DOTNET_RUNTIME_VERSION = "LATEST"
$env:DOTNET_CLI_VERSION = "LATEST"
$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,8 +109,10 @@ private static string AddDefaultRunSettings(string runSettings)
var document = new XmlDocument();
document.Load(reader);

InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(document, architecture, framework, defaultResultsDirectory);
return document.OuterXml;
var navigator = document.CreateNavigator();

InferRunSettingsHelper.UpdateRunSettingsWithUserProvidedSwitches(navigator, architecture, framework, defaultResultsDirectory);
return navigator.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="requestSender">
/// <param name="testRequestSender">
/// Test request sender instance.
/// </param>
/// <param name="testHostManager">
Expand All @@ -44,7 +44,6 @@ 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 = new Dictionary<string, string>();
IDictionary<string, string> environmentVariables = null;

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

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

IntPtr modHandle = LoadLibraryEx(Path.Combine(nativeDllDirectory, "msdia140.dll"), IntPtr.Zero, 0);
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);
}

if (modHandle == IntPtr.Zero)
if(modHandle == IntPtr.Zero)
{
throw new COMException(string.Format(Resources.Resources.FailedToLoadMsDia));
}
Expand Down
11 changes: 7 additions & 4 deletions src/Microsoft.TestPlatform.ObjectModel/TestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ 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 localExtensionData;

private Object m_localExtensionData;
#endif
private Guid defaultId = Guid.Empty;
private Guid id;
private string displayName;
Expand Down Expand Up @@ -69,15 +70,17 @@ 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 localExtensionData; }
set { localExtensionData = value; }
get { return m_localExtensionData; }
set { m_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,14 +212,7 @@ public static IXPathNavigable CreateDefaultRunSettings()
#if NET451
return doc;
#else
// Xmldocument doesn't inherit from XmlDocument for netcoreapp2.0
var ret = doc as IXPathNavigable;
if (ret == null)
{
return doc.ToXPathNavigable();
}

return ret;
return doc.ToXPathNavigable();
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ 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,8 +16,6 @@ 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 @@ -164,28 +162,5 @@ 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 osArchitecture = new PlatformEnvironment().Architecture;
if (osArchitecture == PlatformArchitecture.ARM || osArchitecture == PlatformArchitecture.ARM64)
{
return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString().ToLower(), ARM);
}

return Path.Combine(this.GetCurrentProcessLocation(), this.GetCurrentProcessArchitecture().ToString().ToLower());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,5 @@ 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,23 +77,5 @@ 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

0 comments on commit 27fda0c

Please sign in to comment.