<PropertyGroup>
<ProjectGuid>{C72FD34C-539A-4447-9796-62A229571199}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release</Configurations>
<CoverageSupported>false</CoverageSupported>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
<Folder Include="System\Net\Sockets\" />
<Folder Include="System\Net\VirtualNetwork\" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-[assembly: System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAssembly]
-[assembly: System.Runtime.Versioning.TargetFrameworkAttribute("DUMMY-TFA,Version=v0.0.1")]
+++ /dev/null
-<Project DefaultTargets="Build">
- <PropertyGroup>
- <BuildConfigurations>
- netstandard;
- </BuildConfigurations>
- </PropertyGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.IO;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-using System.Runtime.ExceptionServices;
-using System.Runtime.InteropServices;
-
-namespace RemoteExecutorConsoleApp
-{
- /// <summary>
- /// Provides an entry point in a new process that will load a specified method and invoke it.
- /// </summary>
- internal static class Program
- {
- private static int Main(string[] args)
- {
- // The program expects to be passed the target assembly name to load, the type
- // from that assembly to find, and the method from that assembly to invoke.
- // Any additional arguments are passed as strings to the method.
- if (args.Length < 4)
- {
- Console.Error.WriteLine("Usage: {0} assemblyName typeName methodName exceptionFile [additionalArgs]", typeof(Program).GetTypeInfo().Assembly.GetName().Name);
- Environment.Exit(-1);
- return -1;
- }
-
- string assemblyName = args[0];
- string typeName = args[1];
- string methodName = args[2];
- string exceptionFile = args[3];
- string[] additionalArgs = args.Length > 4 ?
- args.Subarray(4, args.Length - 4) :
- Array.Empty<string>();
-
- // Load the specified assembly, type, and method, then invoke the method.
- // The program's exit code is the return value of the invoked method.
- Assembly a = null;
- Type t = null;
- MethodInfo mi = null;
- object instance = null;
- int exitCode = 0;
- try
- {
- // Create the test class if necessary
- a = Assembly.Load(new AssemblyName(assemblyName));
- t = a.GetType(typeName);
- mi = t.GetTypeInfo().GetDeclaredMethod(methodName);
- if (!mi.IsStatic)
- {
- instance = Activator.CreateInstance(t);
- }
-
- // Invoke the test
- object result = mi.Invoke(instance, additionalArgs);
-
- if (result is Task<int> task)
- {
- exitCode = task.GetAwaiter().GetResult();
- }
- else if (result is int exit)
- {
- exitCode = exit;
- }
- }
- catch (Exception exc)
- {
- if (exc is TargetInvocationException && exc.InnerException != null)
- exc = exc.InnerException;
-
- var output = new StringBuilder();
- output.AppendLine();
- output.AppendLine("Child exception:");
- output.AppendLine(" " + exc);
- output.AppendLine();
- output.AppendLine("Child process:");
- output.AppendLine(string.Format(" {0} {1} {2}", a, t, mi));
- output.AppendLine();
-
- if (additionalArgs.Length > 0)
- {
- output.AppendLine("Child arguments:");
- output.AppendLine(" " + string.Join(", ", additionalArgs));
- }
-
- File.WriteAllText(exceptionFile, output.ToString());
-
- ExceptionDispatchInfo.Capture(exc).Throw();
- }
- finally
- {
- (instance as IDisposable)?.Dispose();
- }
-
- // Environment.Exit not supported on .NET Native - don't even call it to avoid the nuisance exception.
- if (!RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.OrdinalIgnoreCase))
- {
- // Use Exit rather than simply returning the exit code so that we forcibly shut down
- // the process even if there are foreground threads created by the operation that would
- // end up keeping the process alive potentially indefinitely.
- try
- {
- Environment.Exit(exitCode);
- }
- catch (PlatformNotSupportedException)
- {
- }
- }
- return exitCode;
- }
-
- private static MethodInfo GetMethod(this Type type, string methodName)
- {
- Type t = type;
- while (t != null)
- {
- TypeInfo ti = t.GetTypeInfo();
- MethodInfo mi = ti.GetDeclaredMethod(methodName);
- if (mi != null)
- {
- return mi;
- }
- t = ti.BaseType;
- }
- return null;
- }
-
- private static T[] Subarray<T>(this T[] arr, int offset, int count)
- {
- var newArr = new T[count];
- Array.Copy(arr, offset, newArr, 0, count);
- return newArr;
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <ProjectGuid>{8DE22889-A6CB-41EC-B807-D44A2C184719}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <!-- To be consistent between netfx and others we override the SDK behavior which defaults to .dll -->
- <TargetExt>.exe</TargetExt>
- <RootNamespace>RemoteExecutorConsoleApp</RootNamespace>
- <AssemblyName>RemoteExecutorConsoleApp</AssemblyName>
- <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
- <CopyNuGetImplementations>false</CopyNuGetImplementations>
- <Configurations>netstandard-Debug;netstandard-Release</Configurations>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="RemoteExecutorConsoleApp.cs" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AssemblyAttributes.cs" />
- <Compile Include="$(CommonPath)\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs">
- <Link>Common\System\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAssemblyAttribute.cs</Link>
- </Compile>
- </ItemGroup>
-</Project>
\ No newline at end of file
using System.Diagnostics;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tests
// Wait longer for a thread to time out, so that an unexpected timeout in the thread is more likely to expire first and
// provide a better stack trace for the failure
public const int UnexpectedThreadTimeoutMilliseconds =
- UnexpectedTimeoutMilliseconds + RemoteExecutorTestBase.FailWaitTimeoutMilliseconds;
+ UnexpectedTimeoutMilliseconds + RemoteExecutor.FailWaitTimeoutMilliseconds;
public static Thread CreateGuardedThread(out Action waitForThread, Action start)
{
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
//When add new tests make sure to add checks for both string and span APIs where relevant.
- public partial class StringTests : RemoteExecutorTestBase
+ public partial class StringTests
{
private const string SoftHyphen = "\u00AD";
private static readonly char[] s_whiteSpaceCharacters = { '\u0009', '\u000a', '\u000b', '\u000c', '\u000d', '\u0020', '\u0085', '\u00a0', '\u1680' };
[MemberData(nameof(Equals_EncyclopaediaData))]
public void Equals_Encyclopaedia_ReturnsExpected(StringComparison comparison, bool expected)
{
- RemoteInvoke((comparisonString, expectedString) =>
+ RemoteExecutor.Invoke((comparisonString, expectedString) =>
{
string source = "encyclop\u00e6dia";
string target = "encyclopaedia";
Assert.Equal(bool.Parse(expectedString), source.AsSpan().Equals(target.AsSpan(), comparisonType));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, comparison.ToString(), expected.ToString()).Dispose();
}
[Fact]
public static void IndexOf_TurkishI_TurkishCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.Equal(10, span.IndexOf(value.AsSpan(), StringComparison.Ordinal));
Assert.Equal(10, span.IndexOf(value.AsSpan(), StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_TurkishI_InvariantCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Assert.Equal(10, span.IndexOf(value.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(10, span.IndexOf(value.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_TurkishI_EnglishUSCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.Equal(10, span.IndexOf(value.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(10, span.IndexOf(value.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_HungarianDoubleCompression_HungarianCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string source = "dzsdzs";
string target = "ddzs";
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.Ordinal));
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_HungarianDoubleCompression_InvariantCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string source = "dzsdzs";
string target = "ddzs";
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(-1, span.IndexOf(target.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_EquivalentDiacritics_EnglishUSCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Exhibit a\u0300\u00C0";
string value = "\u00C0";
Assert.Equal(8, span.IndexOf(value.AsSpan(), StringComparison.Ordinal));
Assert.Equal(8, span.IndexOf(value.AsSpan(), StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_EquivalentDiacritics_InvariantCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Exhibit a\u0300\u00C0";
string value = "\u00C0";
Assert.Equal(8, span.IndexOf(value.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(8, span.IndexOf(value.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_CyrillicE_EnglishUSCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Foo\u0400Bar";
string value = "\u0400";
Assert.Equal(-1, span.IndexOf(value.AsSpan(), StringComparison.Ordinal));
Assert.Equal(4, span.IndexOf(value.AsSpan(), StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_CyrillicE_InvariantCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Foo\u0400Bar";
string value = "\u0400";
Assert.Equal(-1, span.IndexOf(value.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(4, span.IndexOf(value.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void LastIndexOf_TurkishI_TurkishCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.Equal(10, span.LastIndexOf(value.AsSpan(), StringComparison.Ordinal));
Assert.Equal(10, span.LastIndexOf(value.AsSpan(), StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void LastIndexOf_TurkishI_InvariantCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Assert.Equal(10, span.LastIndexOf(value.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(10, span.LastIndexOf(value.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void LastIndexOf_TurkishI_EnglishUSCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.Equal(10, span.LastIndexOf(value.AsSpan(), StringComparison.CurrentCulture));
Assert.Equal(10, span.LastIndexOf(value.AsSpan(), StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void Test_ToLower_Culture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
foreach (var testdata in ToLower_Culture_TestData())
{
ToLower_Culture((string)testdata[0], (string)testdata[1], (CultureInfo)testdata[2]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[MemberData(nameof(ToUpper_TurkishI_TurkishCulture_MemberData))]
public static void ToUpper_TurkishI_TurkishCulture(string s, string expected)
{
- RemoteInvoke((str, expectedString) =>
+ RemoteExecutor.Invoke((str, expectedString) =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.Equal(str.Length, str.AsSpan().ToUpper(destination, CultureInfo.CurrentCulture));
Assert.Equal(expectedString, destination.ToString());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, s.ToString(), expected.ToString()).Dispose();
}
[MemberData(nameof(ToUpper_TurkishI_EnglishUSCulture_MemberData))]
public static void ToUpper_TurkishI_EnglishUSCulture(string s, string expected)
{
- RemoteInvoke((str, expectedString) =>
+ RemoteExecutor.Invoke((str, expectedString) =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.Equal(str.Length, str.AsSpan().ToUpper(destination, CultureInfo.CurrentCulture));
Assert.Equal(expectedString, destination.ToString());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, s.ToString(), expected.ToString()).Dispose();
}
[MemberData(nameof(ToUpper_TurkishI_InvariantCulture_MemberData))]
public static void ToUpper_TurkishI_InvariantCulture(string s, string expected)
{
- RemoteInvoke((str, expectedString) =>
+ RemoteExecutor.Invoke((str, expectedString) =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Assert.Equal(str.Length, str.AsSpan().ToUpper(destination, CultureInfo.CurrentCulture));
Assert.Equal(expectedString, destination.ToString());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, s.ToString(), expected.ToString()).Dispose();
}
public static void CompareTest(string aS1, string aS2, string aCultureName, bool aIgnoreCase, int aExpected)
{
const string nullPlaceholder = "<null>";
- RemoteInvoke((string s1, string s2, string cultureName, string bIgnoreCase, string iExpected) => {
+ RemoteExecutor.Invoke((string s1, string s2, string cultureName, string bIgnoreCase, string iExpected) => {
if (s1 == nullPlaceholder)
s1 = null;
CultureInfo.CurrentCulture = ci;
Assert.Equal(expected, String.Compare(s1, 0, s2, 0, s1 == null ? 0 : s1.Length, ignoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, aS1 ?? nullPlaceholder, aS2 ?? nullPlaceholder, aCultureName, aIgnoreCase.ToString(), aExpected.ToString()).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{325260D6-D5DD-4E06-9DA2-9AF2AD9DE8C8}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="StringsTests.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
</Project>
using System.Globalization;
using System.Text;
using Microsoft.VisualBasic.CompilerServices.Tests;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace Microsoft.VisualBasic.Tests
{
- public class StringsTests : RemoteExecutorTestBase
+ public class StringsTests
{
static StringsTests()
{
[InlineData(256)]
public void Chr_CharCodeOutOfRange_ThrowsNotSupportedException(int charCode)
{
- RemoteInvoke(charCodeInner =>
+ RemoteExecutor.Invoke(charCodeInner =>
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // Strings.Chr doesn't fail on these inputs for all code pages, e.g. 949
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
namespace System.Buffers.ArrayPool.Tests
{
- public abstract class ArrayPoolTest : RemoteExecutorTestBase
+ public abstract class ArrayPoolTest
{
protected const string TrimSwitchName = "DOTNET_SYSTEM_BUFFERS_ARRAYPOOL_TRIMSHARED";
options.StartInfo.UseShellExecute = false;
options.StartInfo.EnvironmentVariables.Add(TrimSwitchName, trim.ToString());
- RemoteInvoke(action).Dispose();
+ RemoteExecutor.Invoke(action).Dispose();
}
- protected static void RemoteInvokeWithTrimming(Func<string, int> method, bool trim = false, int timeout = FailWaitTimeoutMilliseconds)
+ protected static void RemoteInvokeWithTrimming(Func<string, int> method, bool trim = false, int timeout = RemoteExecutor.FailWaitTimeoutMilliseconds)
{
- RemoteInvokeOptions options = new RemoteInvokeOptions
+ var options = new RemoteInvokeOptions
{
TimeOut = timeout
};
options.StartInfo.UseShellExecute = false;
options.StartInfo.EnvironmentVariables.Add(TrimSwitchName, trim.ToString());
- RemoteInvoke(method, trim.ToString(), options).Dispose();
+ RemoteExecutor.Invoke(method, trim.ToString(), options).Dispose();
}
}
}
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Buffers.ArrayPool.Tests
// Should only have found a new buffer if we're trimming
Assert.Equal(parsedTrim, foundNewBuffer);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, trim, 3 * 60 * 1000); // This test has to wait for the buffers to go stale (give it three minutes)
}
Assert.Same(buffer, pool.Rent(BufferSize));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, trim);
}
// Polling events should only fire when trimming is enabled
Assert.Equal(parsedTrim, pollEventFired);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, trim);
}
}
<PropertyGroup>
<ProjectGuid>{62E2AD5F-C8D0-45FB-B6A5-AED2C77F198C}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <Configurations>netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="ArrayPool\ArrayPoolTest.cs" />
<Compile Include="ArrayPool\UnitTests.cs" />
<Compile Include="$(CommonTestPath)\System\Diagnostics\Tracing\TestEventListener.cs" />
</ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{0D1E2954-A5C7-4B8C-932A-31EB4A96A726}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\IO\TempFile.cs">
<Link>Common\System\IO\TempFile.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file
using System.Globalization;
using System.Reflection;
using Microsoft.CSharp;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.CodeDom.Compiler.Tests
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void MetadataAttributes()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void RegionsSnippetsAndLinePragmas()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void ProviderSupports()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
using System.IO;
using System.Reflection;
using System.Text;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.CodeDom.Compiler.Tests
{
- public abstract class CodeGenerationTests : RemoteExecutorTestBase
+ public abstract class CodeGenerationTests
{
[Fact]
public void Roundtrip_Extension()
namespace System.CodeDom.Compiler.Tests
{
- public class CodeGeneratorTests : RemoteExecutorTestBase
+ public class CodeGeneratorTests
{
public class Generator : CodeGenerator
{
using System.Diagnostics;
using System.IO;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.CodeDom.Compiler.Tests
{
- public class ExecutorTests : RemoteExecutorTestBase
+ public class ExecutorTests : FileCleanupTestBase
{
private static readonly string s_cmd = PlatformDetection.IsWindows ? "ipconfig" : "printenv"; // arbitrary commands to validate output
[Fact]
public void ExecWait_OutputCaptured()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var tfc = new TempFileCollection(TestDirectory))
{
[Fact]
public void ExecWaitWithCapture_NullNames_OutputCaptured()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var tfc = new TempFileCollection())
{
[Fact]
public void ExecWaitWithCapture_SpecifiedNames_OutputCaptured()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var tfc = new TempFileCollection())
{
[Fact]
public void ExecWaitWithCapture_CurrentDirectorySpecified_OutputIncludesSpecifiedDirectory()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var tfc = new TempFileCollection(TestDirectory))
{
[Fact]
public void ExecWaitWithCapture_OutputIncludesCurrentDirectory()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var tfc = new TempFileCollection(TestDirectory))
{
using System.Globalization;
using System.Reflection;
using Microsoft.VisualBasic;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.CodeDom.Compiler.Tests
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void MetadataAttributes()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void RegionsSnippetsAndLinePragmas()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void ProviderSupports()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Collections.Concurrent.Tests
{
- public class EtwTests : RemoteExecutorTestBase
+ public class EtwTests
{
[Fact]
public void TestEtw()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("System.Collections.Concurrent.ConcurrentCollectionsEventSource", EventLevel.Verbose))
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{9574CEEC-5554-411B-B44C-6CA9EC1CEB08}</ProjectGuid>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\Collections\DictionaryExtensions.cs" Condition="'$(TargetGroup)'!='netcoreapp'">
<Compile Include="$(CommonTestPath)\System\Collections\IEnumerable.Generic.Serialization.Tests.cs">
<Link>Common\System\Collections\IEnumerable.Generic.Serialization.Tests.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file
using System.Globalization;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Collections.Tests
{
- public class CaseInsensitiveComparerTests : RemoteExecutorTestBase
+ public class CaseInsensitiveComparerTests
{
[Theory]
[InlineData("hello", "HELLO", 0)]
[InlineData("null", "null", 0)]
public void DefaultInvariant_Compare(object a, object b, int expected)
{
- RemoteInvoke((ra, rb, rexpected) =>
+ RemoteExecutor.Invoke((ra, rb, rexpected) =>
{
Func<string, object> convert = (string o) =>
{
CaseInsensitiveComparer defaultInvComparer = CaseInsensitiveComparer.DefaultInvariant;
Assert.Equal(rexpected_val, Math.Sign(defaultInvComparer.Compare(ra_val, rb_val)));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, a.ToString(), b.ToString(), expected.ToString()).Dispose();
}
using System.Globalization;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
#pragma warning disable 618 // obsolete types
namespace System.Collections.Tests
{
- public class CaseInsensitiveHashCodeProviderTests : RemoteExecutorTestBase
+ public class CaseInsensitiveHashCodeProviderTests
{
[Theory]
[InlineData("hello", "HELLO", true)]
[InlineData(5, 10, false)]
public void Ctor_Empty_ChangeCurrentCulture_GetHashCodeCompare(object a, object b, bool expected)
{
- RemoteInvoke((ra, rb, rexpected) =>
+ RemoteExecutor.Invoke((ra, rb, rexpected) =>
{
var cultureNames = new string[]
{
Assert.Equal(provider.GetHashCode(rb), provider.GetHashCode(rb));
Assert.Equal(expectedResult, provider.GetHashCode(ra) == provider.GetHashCode(rb));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, a.ToString(), b.ToString(), expected.ToString()).Dispose();
}
{
// Turkish has lower-case and upper-case version of the dotted "i", so the upper case of "i" (U+0069) isn't "I" (U+0049)
// but rather "Ä°" (U+0130)
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.False(CaseInsensitiveHashCodeProvider.Default.GetHashCode("file") == CaseInsensitiveHashCodeProvider.Default.GetHashCode("FILE"));
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.True(CaseInsensitiveHashCodeProvider.Default.GetHashCode("file") == CaseInsensitiveHashCodeProvider.Default.GetHashCode("FILE"));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Collections.Tests
{
- public class ComparerTests : RemoteExecutorTestBase
+ public class ComparerTests
{
[Theory]
[InlineData("b", "a", 1)]
[Fact]
public void DefaultInvariant_Compare()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var cultureNames = new string[]
{
Assert.Equal(1, comp.Compare(string1[0], string2[0]));
Assert.Equal(-1, comp.Compare(string1[1], string2[1]));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
#pragma warning disable 618 // obsolete types
namespace System.Collections.Tests
{
- public class HashtableTests : RemoteExecutorTestBase
+ public class HashtableTests
{
[Fact]
public void Ctor_Empty()
[Fact]
public void Ctor_IEqualityComparer()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Null comparer
var hash = new ComparableHashtable((IEqualityComparer)null);
hash = new ComparableHashtable(comparer);
VerifyHashtable(hash, null, comparer);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void Ctor_IDictionary_IEqualityComparer()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// No exception
var hash1 = new ComparableHashtable(new Hashtable(), null);
hash1 = new ComparableHashtable(hash2, comparer);
VerifyHashtable(hash1, hash2, comparer);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[InlineData(1000)]
public void Ctor_Int_IEqualityComparer(int capacity)
{
- RemoteInvoke((rcapacity) =>
+ RemoteExecutor.Invoke((rcapacity) =>
{
int.TryParse(rcapacity, out int capacityint);
IEqualityComparer comparer = StringComparer.CurrentCulture;
hash = new ComparableHashtable(capacityint, comparer);
VerifyHashtable(hash, null, comparer);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, capacity.ToString()).Dispose();
}
[Fact]
public void Ctor_IDictionary_Int_IEqualityComparer()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
// No exception
var hash1 = new ComparableHashtable(new Hashtable(), 1f, null);
Assert.Equal(0, hash1.Count);
IEqualityComparer comparer = StringComparer.CurrentCulture;
hash1 = new ComparableHashtable(hash2, 1f, comparer);
VerifyHashtable(hash1, hash2, comparer);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[InlineData(1000, 1)]
public void Ctor_Int_Int_IEqualityComparer(int capacity, float loadFactor)
{
- RemoteInvoke((rcapacity, rloadFactor) =>
+ RemoteExecutor.Invoke((rcapacity, rloadFactor) =>
{
int.TryParse(rcapacity, out int capacityint);
float.TryParse(rloadFactor, out float loadFactorFloat);
hash = new ComparableHashtable(capacityint, loadFactorFloat, comparer);
VerifyHashtable(hash, null, comparer);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, capacity.ToString(), loadFactor.ToString()).Dispose();
}
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Collections.Tests
{
- public class SortedListTests : RemoteExecutorTestBase
+ public class SortedListTests
{
[Fact]
public void Ctor_Empty()
[Fact]
public void Item_Get_DifferentCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var sortList = new SortedList();
{
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{EE95AE39-845A-42D3-86D0-8065DBE56612}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Link>Common\System\Collections\IEnumerable.NonGeneric.Serialization.Tests.cs</Link>
</Compile>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\ComponentModel\DataAnnotations\ValidationResultTests.cs" />
<Compile Include="System\ComponentModel\DataAnnotations\ValidatorTests.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Globalization;
using System.IO;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.DataAnnotations.Tests
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void ParseDotSeparatorExtremaInCommaSeparatorCultures(Type type, string min, string max)
{
- RemoteInvoke((t, m1, m2) =>
+ RemoteExecutor.Invoke((t, m1, m2) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void ParseDotSeparatorInvariantExtremaInCommaSeparatorCultures(Type type, string min, string max)
{
- RemoteInvoke((t, m1, m2) =>
+ RemoteExecutor.Invoke((t, m1, m2) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void ParseCommaSeparatorExtremaInCommaSeparatorCultures(Type type, string min, string max)
{
- RemoteInvoke((t, m1, m2) =>
+ RemoteExecutor.Invoke((t, m1, m2) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void ParseCommaSeparatorInvariantExtremaInCommaSeparatorCultures(Type type, string min, string max)
{
- RemoteInvoke((t, m1, m2) =>
+ RemoteExecutor.Invoke((t, m1, m2) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndValues(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndValuesInvariantParse(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndValuesInvariantConvert(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndValuesInvariantBoth(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndInvalidValues(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndInvalidValuesInvariantParse(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndInvalidValuesInvariantConvert(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void DotDecimalExtremaAndInvalidValuesInvariantBoth(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndValues(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndValuesInvariantParse(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndValuesInvariantConvert(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndValuesInvariantBoth(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndInvalidValues(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndInvalidValuesInvariantParse(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndInvalidValuesInvariantConvert(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")]
public static void CommaDecimalExtremaAndInvalidValuesInvariantBoth(Type type, string min, string max, string value)
{
- RemoteInvoke((t, m1, m2, v) =>
+ RemoteExecutor.Invoke((t, m1, m2, v) =>
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
namespace System.ComponentModel.DataAnnotations.Tests
{
- public abstract class ValidationAttributeTestBase : RemoteExecutorTestBase
+ public abstract class ValidationAttributeTestBase
{
protected abstract IEnumerable<TestCase> ValidValues();
protected abstract IEnumerable<TestCase> InvalidValues();
<!-- TODO: Add netfx configuration after OOB package bug is fixed: https://github.com/dotnet/corefx/issues/23889 -->
<PropertyGroup>
<ProjectGuid>{59F4682D-C41D-45A7-9798-16C75525BB1D}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<OutputItemType>content</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</ProjectReference>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file
using System.Linq;
using System.Text;
using System.UnitTesting;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Composition
{
[Serializable]
- public class CompositionExceptionTests : RemoteExecutorTestBase
+ public class CompositionExceptionTests
{
[Fact]
public void Constructor1_ShouldSetMessagePropertyToDefault()
[Fact]
public void Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
IEnumerable<CultureInfo> cultures = Expectations.GetCulturesForFormatting();
foreach (CultureInfo culture in cultures)
AssertMessage(exception, 1, culture);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
{
- public class AsyncOperationFinalizerTests : RemoteExecutorTestBase
+ public class AsyncOperationFinalizerTests
{
[Fact]
public void Finalizer_OperationCompleted_DoesNotCallOperationCompleted()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Completed();
GC.Collect();
GC.WaitForPendingFinalizers();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void Finalizer_OperationNotCompleted_CompletesOperation()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var tracker = new OperationCompletedTracker();
NotCompleted(tracker);
Assert.True(tracker.OperationDidComplete);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
adding this xunit so it runs in one AppDomain -->
<XUnitNoAppdomain>true</XUnitNoAppdomain>
<ProjectGuid>{59E9B218-81D0-4A80-A4B7-66C716136D82}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="BackgroundWorkerTests.cs" />
<Compile Include="TestException.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
// See the LICENSE file in the project root for more information.
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
// See the LICENSE file in the project root for more information.
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
namespace System.ComponentModel.Tests
{
- public class ConverterTestBase : RemoteExecutorTestBase
+ public class ConverterTestBase
{
public static void CanConvertTo_WithContext(object[,] data, TypeConverter converter)
{
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
{
- public class CultureInfoConverterTest : RemoteExecutorTestBase
+ public class CultureInfoConverterTest
{
private CultureInfoConverter converter => new CultureInfoConverter();
[Fact]
public void ConvertFrom_Value_Null()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
using System.ComponentModel.Design.Serialization;
using System.Globalization;
using System.Reflection;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = new CultureInfo("pl-PL");
DateTimeFormatInfo formatInfo = (DateTimeFormatInfo)CultureInfo.CurrentCulture.GetFormat(typeof(DateTimeFormatInfo));
string formatWithTime = formatInfo.ShortDatePattern + " " + formatInfo.ShortTimePattern;
Assert.Equal(testDateAndTime, describedInstanceNoCulture);
Assert.Equal(testDateAndTime, describedInstanceCulture);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
// See the LICENSE file in the project root for more information.
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("pl-PL");
},
DateTimeOffsetConverterTests.s_converter);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System.Diagnostics;
using System.Globalization;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Design.Tests
{
- public class DesignerOptionServiceTests : RemoteExecutorTestBase
+ public class DesignerOptionServiceTests
{
[Fact]
public void CreateOptionCollection_CreateMultipleTimes_ReturnsExpected()
[Fact]
public void DesignerOptionConverter_ConvertToString_ReturnsExpected()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
// See the LICENSE file in the project root for more information.
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
{
- public class ReferenceConverterTest : RemoteExecutorTestBase
+ public class ReferenceConverterTest
{
class TestReferenceService : IReferenceService
[Fact]
public void ConvertTo()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
<PropertyGroup>
<ProjectGuid>{3F0326A1-9E19-4A6C-95CE-63E65C9D2030}</ProjectGuid>
<DefineConstants>$(DefineConstants);FUNCTIONAL_TESTS</DefineConstants>
- <DebugEngines>{2E36F1D4-B23C-435D-AB41-18E608940038}</DebugEngines>
- <RootNamespace>
- </RootNamespace>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <RootNamespace />
<AssemblyVersion>9.9.9.9</AssemblyVersion>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<Compile Include="XTypeDescriptionProviderTests.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <SupplementalTestData Include="$(PackagesDir)system.componentmodel.typeconverter.testdata\$(TestDataPackageVersion)\content\**\*.*">
+ <SupplementalTestData Include="$(PackagesDir)system.componentmodel.typeconverter.testdata\1.0.0\content\**\*.*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</SupplementalTestData>
</ItemGroup>
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
{
- public abstract class TypeConverterTestBase : RemoteExecutorTestBase
+ public abstract class TypeConverterTestBase
{
public abstract TypeConverter Converter { get; }
public virtual IEnumerable<ConvertTest> ConvertToTestData() => Enumerable.Empty<ConvertTest>();
}
else
{
- RemoteInvoke((typeName, testString) =>
+ RemoteExecutor.Invoke((typeName, testString) =>
{
// Deserialize the current test.
TypeConverterTestBase testBase = (TypeConverterTestBase)Activator.CreateInstance(Type.GetType(typeName));
Assert.Throws<NotSupportedException>(() => testBase.Converter.ConvertTo(test.Context, test.Culture, test.Source, test.DestinationType));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, this.GetType().AssemblyQualifiedName, convertTest.GetSerializedString()).Dispose();
}
});
}
else
{
- RemoteInvoke((typeName, testString) =>
+ RemoteExecutor.Invoke((typeName, testString) =>
{
// Deserialize the current test.
TypeConverterTestBase testBase = (TypeConverterTestBase)Activator.CreateInstance(Type.GetType(typeName));
AssertExtensions.Throws(test.NetCoreExceptionType, test.NetFrameworkExceptionType, () => testBase.Converter.ConvertFrom(test.Context, test.Culture, test.Source));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, this.GetType().AssemblyQualifiedName, convertTest.GetSerializedString()).Dispose();
}
});
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
{
- public class TypeConverterTests : RemoteExecutorTestBase
+ public class TypeConverterTests
{
public static TypeConverter s_converter = new TypeConverter();
public static ITypeDescriptorContext s_context = new MyTypeDescriptorContext();
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("pl-PL");
s_context, CultureInfo.InvariantCulture, new FormattableClass(), typeof(string)) as string;
Assert.NotNull(s);
Assert.Equal(FormattableClass.Token, s);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
// See the LICENSE file in the project root for more information.
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
[Fact]
public static void ConvertTo_WithContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
<ProjectGuid>{7669C397-C21C-4C08-83F1-BE6691911E88}</ProjectGuid>
<!-- XUnit AppDomains BaseDirectory path doesn't contain a trailing slash, which impacts our tests. -->
<XUnitNoAppdomain>true</XUnitNoAppdomain>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<!-- Default configurations to help VS understand the options -->
<Compile Include="System\Configuration\ValidatiorUtilsTests.cs" />
<Compile Include="System\Drawing\Configuration\SystemDrawingSectionTests.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Configuration;
using System.Diagnostics;
using System.Globalization;
-
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ConfigurationTests
{
- public class TimeSpanValidatorAttributeTests : RemoteExecutorTestBase
+ public class TimeSpanValidatorAttributeTests
{
[Fact]
public void MinValueString_GetString()
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Exception messages are different")]
public void MinValueString_TooSmall()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Exception messages are different")]
public void MaxValueString_TooBig()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
-public partial class CancelKeyPressTests : RemoteExecutorTestBase
+public partial class CancelKeyPressTests
{
[PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes
public void HandlerInvokedForSigInt()
[PlatformSpecific(TestPlatforms.AnyUnix)] // events are triggered by Unix signals (SIGINT, SIGQUIT, SIGCHLD).
public void ExitDetectionNotBlockedByHandler()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var mre = new ManualResetEventSlim();
var tcs = new TaskCompletionSource<object>();
Assert.True(tcs.Task.Wait(WaitFailTestTimeoutSeconds * 1000));
// Create a process and wait for it to exit.
- using (RemoteInvokeHandle handle = RemoteInvoke(() => SuccessExitCode))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(() => RemoteExecutor.SuccessExitCode))
{
// Process exit is detected on SIGCHLD
- Assert.Equal(SuccessExitCode, handle.ExitCode);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, handle.ExitCode);
}
// Release CancelKeyPress
mre.Set();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
// This test sends a SIGINT back to itself... if run in the xunit process, this would end
// up canceling the rest of xunit's tests. So we run the test itself in a separate process.
- RemoteInvoke(signalStr =>
+ RemoteExecutor.Invoke(signalStr =>
{
var tcs = new TaskCompletionSource<ConsoleSpecialKey>();
Console.CancelKeyPress -= handler;
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, signalOuter.ToString()).Dispose();
}
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
-public partial class CancelKeyPressTests : RemoteExecutorTestBase
+public partial class CancelKeyPressTests
{
private const int WaitFailTestTimeoutSeconds = 30;
{
// xunit registers a CancelKeyPress handler at the beginning of the test run and never
// unregisters it, thus we can't execute all of the removal code in the same process.
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CanAddAndRemoveHandler();
CanAddAndRemoveHandler(); // add and remove again
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System;
using System.Text;
using System.Runtime.InteropServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
public partial class ConsoleEncoding
[PlatformSpecific(TestPlatforms.Windows)]
public void InputEncoding_SetDefaultEncoding_Success()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Encoding encoding = Encoding.GetEncoding(0);
Console.InputEncoding = encoding;
Assert.Equal(encoding, Console.InputEncoding);
Assert.Equal((uint)encoding.CodePage, GetConsoleCP());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[PlatformSpecific(TestPlatforms.Windows)]
public void InputEncoding_SetUnicodeEncoding_SilentlyIgnoredInternally()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Encoding unicodeEncoding = Encoding.Unicode;
Encoding oldEncoding = Console.InputEncoding;
Assert.Equal(unicodeEncoding, Console.InputEncoding);
Assert.Equal((uint)oldEncoding.CodePage, GetConsoleCP());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[PlatformSpecific(TestPlatforms.Windows)]
public void OutputEncoding_SetDefaultEncoding_Success()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Encoding encoding = Encoding.GetEncoding(0);
Console.OutputEncoding = encoding;
Assert.Equal(encoding, Console.OutputEncoding);
Assert.Equal((uint)encoding.CodePage, GetConsoleOutputCP());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[PlatformSpecific(TestPlatforms.Windows)]
public void OutputEncoding_SetUnicodeEncoding_SilentlyIgnoredInternally()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Encoding unicodeEncoding = Encoding.Unicode;
Encoding oldEncoding = Console.OutputEncoding;
Assert.Equal((uint)oldEncoding.CodePage, GetConsoleOutputCP());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.IO;
using System.Text;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
-public partial class ConsoleEncoding : RemoteExecutorTestBase
+public partial class ConsoleEncoding
{
public static IEnumerable<object[]> InputData()
{
[ActiveIssue("https://github.com/dotnet/corefx/issues/18220", TargetFrameworkMonikers.UapAot)]
public void InputEncoding_SetWithInInitialized_ResetsIn()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Initialize Console.In
TextReader inReader = Console.In;
Assert.NotSame(inReader, Console.In);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[ActiveIssue("https://github.com/dotnet/corefx/issues/18220", TargetFrameworkMonikers.UapAot)]
public void OutputEncoding_SetWithErrorAndOutputInitialized_ResetsErrorAndOutput()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Initialize Console.Error
TextWriter errorWriter = Console.Error;
Assert.NotSame(errorWriter, Console.Error);
Assert.NotSame(outWriter, Console.Out);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class NonStandardConfigurationTests : RemoteExecutorTestBase
+ public partial class NonStandardConfigurationTests
{
[PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes
[Fact]
public void NonBlockingStdout_AllDataReceived()
{
- RemoteInvokeHandle remote = RemoteInvoke(() =>
+ RemoteInvokeHandle remote = RemoteExecutor.Invoke(() =>
{
char[] data = Enumerable.Repeat('a', 1024).ToArray();
Console.Write(data);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, new RemoteInvokeOptions { StartInfo = new ProcessStartInfo() { RedirectStandardOutput = true } });
using (remote)
using System;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
-public class ReadKey : RemoteExecutorTestBase
+public class ReadKey
{
[Fact]
public static void KeyAvailable()
options.StartInfo = psi;
}
- RemoteInvoke(func, options).Dispose();
+ RemoteExecutor.Invoke(func, options).Dispose();
}
}
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
-public class RedirectedStream : RemoteExecutorTestBase
+public class RedirectedStream
{
[Fact] // the CI system redirects stdout, so we can only really test the redirected behavior.
public static void InputRedirect()
options.StartInfo = psi;
}
- RemoteInvoke(func, options).Dispose();
+ RemoteExecutor.Invoke(func, options).Dispose();
}
}
<PropertyGroup>
<ProjectGuid>{3ED7BCF1-34B9-49B7-9C25-0BC3304C0858}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
</Compile>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<Folder Include="ncursesFormats\" />
</ItemGroup>
</Project>
\ No newline at end of file
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
-using Xunit;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.DotNet.XUnitExtensions;
+using Xunit;
-public class WindowAndCursorProps : RemoteExecutorTestBase
+public class WindowAndCursorProps
{
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Expected behavior specific to Unix
[PlatformSpecific(TestPlatforms.AnyUnix)] // Expected behavior specific to Unix
public static void Title_SetUnix_Success()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Console.Title = "Title set by unit test";
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
public static void Title_Set_Windows(int lengthOfTitle)
{
// Try to set the title to some other value.
- RemoteInvoke(lengthOfTitleString =>
+ RemoteExecutor.Invoke(lengthOfTitleString =>
{
string newTitle = new string('a', int.Parse(lengthOfTitleString));
Console.Title = newTitle;
{
Assert.Equal(newTitle, Console.Title);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, lengthOfTitle.ToString()).Dispose();
}
<PropertyGroup>
<ProjectGuid>{B473F77D-4168-4123-932A-E88020B768FA}</ProjectGuid>
<NoWarn>0168,0169,0414,0219,0649</NoWarn>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\Xml\XmlDataDocumentTests.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
</Project>
\ No newline at end of file
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Data.Tests
{
- public class DataCommonEventSourceTest : RemoteExecutorTestBase
+ public class DataCommonEventSourceTest
{
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void InvokeCodeThatShouldFirEvents_EnsureEventsFired()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("System.Data.DataCommonEventSource", EventLevel.Verbose))
{
using System.Diagnostics;
using System.Globalization;
using System.Xml;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Data.Tests
{
- public class DataSetReadXmlSchemaTest : RemoteExecutorTestBase
+ public class DataSetReadXmlSchemaTest
{
private DataSet CreateTestSet()
{
[Fact]
public void LocaleOnRootWithoutIsDataSet()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("fi-FI");
string xs = @"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'>
DataSetAssertion.AssertDataColumn("col1", dt.Columns[0], "Attr", true, false, 0, 1, "Attr", MappingType.Attribute, typeof(long), DBNull.Value, string.Empty, -1, string.Empty, 0, string.Empty, false, false);
DataSetAssertion.AssertDataColumn("col2", dt.Columns[1], "Child", false, false, 0, 1, "Child", MappingType.Element, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-
-using Xunit;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using System.Globalization;
using System.Text;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
+using Xunit;
namespace System.Data.Tests
{
- public class DataSetTest : RemoteExecutorTestBase
+ public class DataSetTest
{
public DataSetTest()
{
[Fact]
public void WriteXmlSchema()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("fi-FI");
Assert.Equal("</xs:schema>", TextString);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void WriteXmlModeSchema1()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("fi-FI");
string SerializedDataTable =
string result = w.ToString();
Assert.Equal(expected.Replace("\r", ""), result.Replace("\r", ""));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using Xunit;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Formatters.Tests;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
+using Xunit;
namespace System.Data.Tests
{
- public class DataSetTest2 : RemoteExecutorTestBase
+ public class DataSetTest2
{
private DataSet _ds = null;
private bool _eventRaised = false;
[Fact]
public void DataSetSpecificCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("cs-CZ");
dt.Locale = ds.Locale;
Assert.Same(dt, ds.Tables["MACHINE"]);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Globalization;
using System.Reflection;
using System.Runtime.Serialization.Formatters.Binary;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Data.Tests
{
- public class DataTableReadXmlSchemaTest : RemoteExecutorTestBase
+ public class DataTableReadXmlSchemaTest
{
private DataSet CreateTestSet()
{
[Fact]
public void XsdSchemaSerializationIgnoresLocale()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var serializer = new BinaryFormatter();
var table = new DataTable();
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Full framework does not yet have the fix for this bug")]
public void XsdSchemaDeserializationIgnoresLocale()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var serializer = new BinaryFormatter();
using System.Runtime.Serialization.Formatters.Tests;
using System.Text.RegularExpressions;
using System.Xml;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Data.Tests
{
- public class DataTableTest : RemoteExecutorTestBase
+ public class DataTableTest
{
public DataTableTest()
{
[Fact]
public void PropertyExceptions()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
DataSet set = new DataSet();
DataTable table = new DataTable();
Assert.Throws<DataException>(() => table.Prefix = "Prefix#1");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void WriteXmlSchema()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-GB");
Assert.Equal("</xs:schema>", TextString);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Serializable]
- public class AppDomainsAndFormatInfo : RemoteExecutorTestBase
- {
+ public class AppDomainsAndFormatInfo {
public void Remote()
{
int n = (int)Convert.ChangeType("5", typeof(int));
[Fact]
public void Bug82109()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
DataTable tbl = new DataTable();
tbl.Columns.Add("data", typeof(DateTime));
CultureInfo.CurrentCulture = new CultureInfo("fr-FR");
Select(tbl);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Xml.Serialization;
using System.Text;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Data.Tests.SqlTypes
{
- public class SqlStringTest : RemoteExecutorTestBase
+ public class SqlStringTest
{
private SqlString _test1;
private SqlString _test2;
[Fact]
public void Properties()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-AU");
var one = new SqlString("First TestString");
// Value
Assert.Equal("First TestString", one.Value);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections;
using System.Diagnostics;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Xml;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.SqlServer.TDS;
using Microsoft.SqlServer.TDS.Done;
using Microsoft.SqlServer.TDS.EndPoint;
using Microsoft.SqlServer.TDS.Servers;
using Microsoft.SqlServer.TDS.SQLBatch;
using Xunit;
-using System.Runtime.CompilerServices;
namespace System.Data.SqlClient.Tests
{
- public class DiagnosticTest : RemoteExecutorTestBase
+ public class DiagnosticTest
{
private const string BadConnectionString = "data source = bad; initial catalog = bad; uid = bad; password = bad; connection timeout = 1;";
private static readonly string s_tcpConnStr = Environment.GetEnvironmentVariable("TEST_TCP_CONN_STR") ?? string.Empty;
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteScalarTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
var output = cmd.ExecuteScalar();
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteScalarErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
catch { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteNonQueryTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
var output = cmd.ExecuteNonQuery();
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteNonQueryErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
}
Console.WriteLine("SqlClient.DiagnosticTest.ExecuteNonQueryErrorTest Connection Disposed");
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteReaderTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
while (reader.Read()) { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteReaderErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
catch { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteReaderWithCommandBehaviorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
while (reader.Read()) { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteXmlReaderTest()
{
- RemoteInvoke(cs =>
+ RemoteExecutor.Invoke(cs =>
{
CollectStatisticsDiagnostics(_ =>
{
while (reader.Read()) { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, s_tcpConnStr).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteXmlReaderErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
catch { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteScalarAsyncTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
var output = await cmd.ExecuteScalarAsync();
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteScalarAsyncErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
catch { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteNonQueryAsyncTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
var output = await cmd.ExecuteNonQueryAsync();
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteNonQueryAsyncErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
catch { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteReaderAsyncTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
while (reader.Read()) { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteReaderAsyncErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
catch { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteXmlReaderAsyncTest()
{
- RemoteInvoke(cs =>
+ RemoteExecutor.Invoke(cs =>
{
CollectStatisticsDiagnosticsAsync(async _ =>
{
while (reader.Read()) { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, s_tcpConnStr).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ExecuteXmlReaderAsyncErrorTest()
{
- RemoteInvoke(cs =>
+ RemoteExecutor.Invoke(cs =>
{
CollectStatisticsDiagnosticsAsync(async _ =>
{
catch { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, s_tcpConnStr).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ConnectionOpenTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(connectionString =>
{
}, true);
Console.WriteLine("SqlClient.DiagnosticsTest.ConnectionOpenTest:: Done with Diagnostics collection");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ConnectionOpenErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnostics(_ =>
{
try { sqlConnection.Open(); } catch { }
}
});
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ConnectionOpenAsyncTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async connectionString =>
{
await sqlConnection.OpenAsync();
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot | TargetFrameworkMonikers.NetFramework, "Internals reflection not supported on UapAot | Feature not available on Framework")]
public void ConnectionOpenAsyncErrorTest()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CollectStatisticsDiagnosticsAsync(async _ =>
{
try { await sqlConnection.OpenAsync(); } catch { }
}
}).GetAwaiter().GetResult();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{F3E72F35-0351-4D67-9388-725BCAD807BA}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Tools\TDS\TDS\TDS.csproj">
<Name>TDS</Name>
</ProjectReference>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
-using Xunit;
using System.Diagnostics.Tracing;
using System.Text;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
+using Xunit;
namespace System.Diagnostics.Tests
{
//Complex types are not supported on EventSource for .NET 4.5
- public class DiagnosticSourceEventSourceBridgeTests : RemoteExecutorTestBase
+ public class DiagnosticSourceEventSourceBridgeTests
{
// To avoid interactions between tests when they are run in parallel, we run all these tests in their
- // own sub-process using RemoteInvoke() However this makes it very inconvinient to debug the test.
+ // own sub-process using RemoteExecutor.Invoke() However this makes it very inconvinient to debug the test.
// By seting this #if to true you stub out RemoteInvoke and the code will run in-proc which is useful
// in debugging.
#if false
{
}
}
- static IDisposable RemoteInvoke(Action a)
+ static IDisposable RemoteExecutor.Invoke(Action a)
{
a();
return new NullDispose();
[Fact]
public void TestSpecificEvents()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestSpecificEventsSource"))
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "This is linux specific test")]
public void LinuxNewLineConventions()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("LinuxNewLineConventionsSource"))
[Fact]
public void TestWildCardSourceName()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener1 = new DiagnosticListener("TestWildCardSourceName1"))
[Fact]
public void TestWildCardEventName()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestWildCardEventNameSource"))
[Fact]
public void TestNulls()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestNullsTestSource"))
[Fact]
public void TestNoImplicitTransforms()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestNoImplicitTransformsSource"))
[Fact]
public void TestBadProperties()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestBadPropertiesSource"))
[Fact]
public void TestMessages()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestMessagesSource"))
[Fact]
public void TestActivities()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
using (var diagnosticSourceListener = new DiagnosticListener("TestActivitiesSource"))
[Fact]
public void TestShortcutKeywords()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var eventSourceListener = new TestDiagnosticSourceEventListener())
// These are look-alikes for the real ones.
public void Stress_WriteConcurrently_DoesntCrash()
{
const int StressTimeSeconds = 4;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (new TurnOnAllEventListener())
using (var source = new DiagnosticListener("testlistener"))
{
using Configuration = System.Net.Test.Common.Configuration;
- public class HttpHandlerDiagnosticListenerTests : RemoteExecutorTestBase
+ public class HttpHandlerDiagnosticListenerTests
{
/// <summary>
/// A simple test to make sure the Http Diagnostic Source is added into the list of DiagnosticListeners.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{A7922FA3-306A-41B9-B8DC-CC4DBE685A85}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard1.1-Debug;netstandard1.1-Release;netstandard1.3-Debug;netstandard1.3-Release;netstandard1.5-Debug;netstandard1.5-Release</Configurations>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetGroup)' != 'netfx'">
<Link>Common\System\Net\Configuration.Http.cs</Link>
</Compile>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Diagnostics.PerformanceData;
using System.IO;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.Tests
{
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap)] // In appcontainer, cannot write to perf counters
- public class PerformanceDataTests : RemoteExecutorTestBase, IClassFixture<PerformanceDataTestsFixture>
+ public class PerformanceDataTests : IClassFixture<PerformanceDataTestsFixture>
{
PerformanceDataTestsFixture _fixture = null;
{
// We run test in isolated process to avoid interferences on internal performance counter shared state with other tests.
// These interferences could lead to fail also after retries
- RemoteInvoke((string providerId, string typingCounterSetId) =>
+ RemoteExecutor.Invoke((string providerId, string typingCounterSetId) =>
{
// Create the 'Typing' counter set.
using (CounterSet typingCounterSet = new CounterSet(Guid.Parse(providerId), Guid.Parse(typingCounterSetId), CounterSetInstanceType.Single))
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{296074B7-1CC9-497E-8C1E-FC5C985C75C6}</ProjectGuid>
- <Configurations>netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Debug;netfx-Release</Configurations>
<Win32Resource>provider.res</Win32Resource>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="PerformanceCounterTests.cs" />
<Compile Include="PerformanceDataTests.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<None Include="provider.man">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
// See the LICENSE file in the project root for more information.
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.Tests
public void Modules_Get_ContainsHostFileName()
{
ProcessModuleCollection modules = Process.GetCurrentProcess().Modules;
- Assert.Contains(modules.Cast<ProcessModule>(), m => m.FileName.Contains(HostRunnerName));
+ Assert.Contains(modules.Cast<ProcessModule>(), m => m.FileName.Contains(RemoteExecutor.HostRunnerName));
}
[Fact]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.Win32;
-using Microsoft.Win32.SafeHandles;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Principal;
-using Xunit;
using System.Text;
using System.ComponentModel;
using System.Security;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
+using Microsoft.Win32;
+using Microsoft.Win32.SafeHandles;
+using Xunit;
namespace System.Diagnostics.Tests
{
if (Environment.GetEnvironmentVariable(name) != "child-process-value")
return 1;
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
});
p.StartInfo.Environment.Add(name, "child-process-value");
p.Start();
Assert.True(p.WaitForExit(WaitInMS));
- Assert.Equal(SuccessExitCode, p.ExitCode);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, p.ExitCode);
}
[Fact]
Process p = CreateProcess(() =>
{
Console.Write(string.Join(ItemSeparator, Environment.GetEnvironmentVariables().Cast<DictionaryEntry>().Select(e => Convert.ToBase64String(Encoding.UTF8.GetBytes(e.Key + "=" + e.Value)))));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
});
p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
p.StartInfo.RedirectStandardOutput = true;
string workingDirectory = string.IsNullOrEmpty(Environment.SystemDirectory) ? TestDirectory : Environment.SystemDirectory ;
Assert.NotEqual(workingDirectory, Directory.GetCurrentDirectory());
var psi = new ProcessStartInfo { WorkingDirectory = workingDirectory };
- RemoteInvoke(wd => { Assert.Equal(wd, Directory.GetCurrentDirectory()); return SuccessExitCode; }, workingDirectory, new RemoteInvokeOptions { StartInfo = psi }).Dispose();
+ RemoteExecutor.Invoke(wd =>
+ {
+ Assert.Equal(wd, Directory.GetCurrentDirectory());
+ return RemoteExecutor.SuccessExitCode;
+ }, workingDirectory, new RemoteInvokeOptions { StartInfo = psi }).Dispose();
}
[ActiveIssue(12696)]
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.Tests
Console.WriteLine(2);
await pipeWrite.WriteAsync(new byte[1], 0, 1);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
Console.WriteLine(8);
Console.WriteLine(9);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
{
partial class ProcessTestBase
{
- protected static readonly string RunnerName = HostRunner;
-
protected Process CreateProcessLong()
{
return CreateSleepProcess(RemotelyInvokable.WaitInMS);
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.Tests
{
- public partial class ProcessTestBase : RemoteExecutorTestBase
+ public partial class ProcessTestBase : FileCleanupTestBase
{
protected const int WaitInMS = 30 * 1000;
protected Process _process;
protected Process CreateProcess(Func<int> method = null)
{
Process p = null;
- using (RemoteInvokeHandle handle = RemoteInvoke(method ?? (() => SuccessExitCode), new RemoteInvokeOptions { Start = false }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(method ?? (() => RemoteExecutor.SuccessExitCode), new RemoteInvokeOptions { Start = false }))
{
p = handle.Process;
handle.Process = null;
protected Process CreateProcess(Func<string, int> method, string arg, bool autoDispose = true)
{
Process p = null;
- using (RemoteInvokeHandle handle = RemoteInvoke(method, arg, new RemoteInvokeOptions { Start = false }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(method, arg, new RemoteInvokeOptions { Start = false }))
{
p = handle.Process;
handle.Process = null;
protected Process CreateProcess(Func<string, Task<int>> method, string arg)
{
Process p = null;
- using (RemoteInvokeHandle handle = RemoteInvoke(method, arg, new RemoteInvokeOptions { Start = false }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(method, arg, new RemoteInvokeOptions { Start = false }))
{
p = handle.Process;
handle.Process = null;
using System.Threading.Tasks;
using System.Security;
using Xunit;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.DotNet.XUnitExtensions;
namespace System.Diagnostics.Tests
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.StartInfo.EnvironmentVariables["PATH"] = path;
- RemoteInvoke(fileToOpen =>
+ RemoteExecutor.Invoke(fileToOpen =>
{
using (var px = Process.Start(new ProcessStartInfo { UseShellExecute = true, FileName = fileToOpen }))
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.StartInfo.EnvironmentVariables["PATH"] = path;
- RemoteInvoke((argVerb, argValid) =>
+ RemoteExecutor.Invoke((argVerb, argValid) =>
{
if (argVerb == "<null>")
{
Assert.Subset(expectedGroups, GetGroups());
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
[Fact]
// Start as username
var invokeOptions = new RemoteInvokeOptions();
invokeOptions.StartInfo.UserName = userName;
- using (RemoteInvokeHandle handle = RemoteInvoke(CheckUserAndGroupIds, userId, userGroupId, userGroupIds, checkGroupsExact.ToString(),
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(CheckUserAndGroupIds, userId, userGroupId, userGroupIds, checkGroupsExact.ToString(),
invokeOptions))
{ }
}
// Start as username
var invokeOptions = new RemoteInvokeOptions();
invokeOptions.StartInfo.UserName = username;
- using (RemoteInvokeHandle handle = RemoteInvoke(CheckUserAndGroupIds, userId, userGroupId, userGroupIds, checkGroupsExact.ToString(), invokeOptions))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(CheckUserAndGroupIds, userId, userGroupId, userGroupIds, checkGroupsExact.ToString(), invokeOptions))
{ }
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
};
// Start as root
string userName = GetCurrentRealUserName();
- using (RemoteInvokeHandle handle = RemoteInvoke(runsAsRoot, userName, useRootGroups.ToString(),
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(runsAsRoot, userName, useRootGroups.ToString(),
new RemoteInvokeOptions { RunAsSudo = true }))
{ }
}
{
// Create a process that isn't a direct child.
int nonChildPid = -1;
- RemoteInvokeHandle createNonChildProcess = RemoteInvoke(arg =>
+ RemoteInvokeHandle createNonChildProcess = RemoteExecutor.Invoke(arg =>
{
- RemoteInvokeHandle nonChildProcess = RemoteInvoke(
+ RemoteInvokeHandle nonChildProcess = RemoteExecutor.Invoke(
// Process that lives as long as the test process.
testProcessPid => Process.GetProcessById(int.Parse(testProcessPid)).WaitForExit(), arg,
// Don't pass our standard out to the sleepProcess or the ReadToEnd below won't return.
{
RunAsSudo = true
};
- using (RemoteInvokeHandle handle = RemoteInvoke(testMethod, arg, options))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(testMethod, arg, options))
{ }
}
using System.Security;
using System.Text;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.Win32.SafeHandles;
using Xunit;
using Xunit.Sdk;
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.StartInfo.EnvironmentVariables["PATH"] = path;
options.StartInfo.WorkingDirectory = wd;
- RemoteInvoke(pathDirectory =>
+ RemoteExecutor.Invoke(pathDirectory =>
{
// Create two identically named scripts, one in the working directory and one on PATH.
const int workingDirReturnValue = 1;
Assert.Equal(pathDirReturnValue, process.ExitCode);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, path, options).Dispose();
}
Process p = CreateProcessPortable(RemotelyInvokable.Dummy);
p.Start();
Assert.True(p.WaitForExit(WaitInMS));
- Assert.Equal(SuccessExitCode, p.ExitCode);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, p.ExitCode);
}
{
}
else
{
- IEnumerable<int> testProcessIds = Process.GetProcessesByName(HostRunnerName).Select(p => p.Id);
+ IEnumerable<int> testProcessIds = Process.GetProcessesByName(RemoteExecutor.HostRunnerName).Select(p => p.Id);
Assert.Contains(_process.Id, testProcessIds);
}
}
(s) => s;
Assert.True(p.Modules.Count > 0);
- Assert.Equal(normalize(HostRunnerName), normalize(p.MainModule.ModuleName));
- Assert.EndsWith(normalize(HostRunnerName), normalize(p.MainModule.FileName));
- Assert.Equal(normalize(string.Format("System.Diagnostics.ProcessModule ({0})", HostRunnerName)), normalize(p.MainModule.ToString()));
+ Assert.Equal(normalize(RemoteExecutor.HostRunnerName), normalize(p.MainModule.ModuleName));
+ Assert.EndsWith(normalize(RemoteExecutor.HostRunnerName), normalize(p.MainModule.FileName));
+ Assert.Equal(normalize(string.Format("System.Diagnostics.ProcessModule ({0})", RemoteExecutor.HostRunnerName)), normalize(p.MainModule.ToString()));
}
[Fact]
{
CreateDefaultProcess();
- string expected = PlatformDetection.IsFullFramework || PlatformDetection.IsNetNative ? TestConsoleApp : HostRunner;
- Assert.Equal(Path.GetFileNameWithoutExtension(expected), Path.GetFileNameWithoutExtension(_process.ProcessName), StringComparer.OrdinalIgnoreCase);
+ Assert.Equal(Path.GetFileNameWithoutExtension(RemoteExecutor.HostRunner), Path.GetFileNameWithoutExtension(_process.ProcessName), StringComparer.OrdinalIgnoreCase);
}
[Fact]
[InlineData(true)]
public void Handle_CreateEvent_BlocksUntilProcessCompleted(bool useSafeHandle)
{
- using (RemoteInvokeHandle h = RemoteInvoke(() => Console.ReadLine(), new RemoteInvokeOptions { StartInfo = new ProcessStartInfo() { RedirectStandardInput = true } }))
+ using (RemoteInvokeHandle h = RemoteExecutor.Invoke(() => Console.ReadLine(), new RemoteInvokeOptions { StartInfo = new ProcessStartInfo() { RedirectStandardInput = true } }))
using (var mre = new ManualResetEvent(false))
{
mre.SetSafeWaitHandle(new SafeWaitHandle(useSafeHandle ? h.Process.SafeHandle.DangerousGetHandle() : h.Process.Handle, ownsHandle: false));
h.Process.StandardInput.WriteLine(); // allow child to complete
- Assert.True(mre.WaitOne(FailWaitTimeoutMilliseconds), "Event should have been set.");
+ Assert.True(mre.WaitOne(RemoteExecutor.FailWaitTimeoutMilliseconds), "Event should have been set.");
}
}
process.Start();
// Processes are not hosted by dotnet in the full .NET Framework.
- string expectedFileName = PlatformDetection.IsFullFramework || PlatformDetection.IsNetNative ? TestConsoleApp : RunnerName;
+ string expectedFileName = (PlatformDetection.IsFullFramework || PlatformDetection.IsNetNative) ? RemoteExecutor.HostRunner : RemoteExecutor.HostRunner;
Assert.Equal(expectedFileName, process.StartInfo.FileName);
process.Kill();
[Fact]
public void StartInfo_SetGet_ReturnsExpected()
{
- var process = new Process() { StartInfo = new ProcessStartInfo(TestConsoleApp) };
- Assert.Equal(TestConsoleApp, process.StartInfo.FileName);
+ var process = new Process() { StartInfo = new ProcessStartInfo(RemoteExecutor.HostRunner) };
+ Assert.Equal(RemoteExecutor.HostRunner, process.StartInfo.FileName);
}
[Fact]
StartInfo = new ProcessStartInfo { RedirectStandardOutput = true }
};
- using (RemoteInvokeHandle handle = RemoteInvokeRaw((Func<string, string, string, int>)RemotelyInvokable.ConcatThreeArguments, inputArguments, options))
+ using (RemoteInvokeHandle handle = RemoteExecutor.InvokeRaw((Func<string, string, string, int>)RemotelyInvokable.ConcatThreeArguments, inputArguments, options))
{
Assert.Equal(expectedArgv, handle.Process.StandardOutput.ReadToEnd());
}
using (Process process = CreateProcess(() =>
{
Console.WriteLine("hello world");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}))
{
process.StartInfo.RedirectStandardOutput = true;
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "Retrieving information about local processes is not supported on uap")]
public void HandleCountChanges()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Process p = Process.GetCurrentProcess();
int handleCount = p.HandleCount;
p.Refresh();
int thirdHandleCount = p.HandleCount;
Assert.True(thirdHandleCount < handleCount);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.Tests
Thread.Sleep(Timeout.Infinite);
// never reaches here -- but necessary to satisfy method's signature
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
void SendMessage(string message, string handleAsString)
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.Tests
Process peer = Process.GetProcessById(int.Parse(peerId));
Console.WriteLine("Signal");
Assert.True(peer.WaitForExit(WaitInMS));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, child1.Id.ToString());
child2.StartInfo.RedirectStandardOutput = true;
child2.Start();
Assert.True(child1.WaitForExit(WaitInMS));
Assert.True(child2.WaitForExit(WaitInMS));
- Assert.Equal(SuccessExitCode, child2.ExitCode);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, child2.ExitCode);
}
[Fact]
{
Process child2 = CreateProcess(() =>
{
- Process child3 = CreateProcess(() => SuccessExitCode);
+ Process child3 = CreateProcess(() => RemoteExecutor.SuccessExitCode);
child3.Start();
Assert.True(child3.WaitForExit(WaitInMS));
return child3.ExitCode;
});
root.Start();
Assert.True(root.WaitForExit(WaitInMS));
- Assert.Equal(SuccessExitCode, root.ExitCode);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, root.ExitCode);
}
[Fact]
Process child = CreateProcessPortable(RemotelyInvokable.SelfTerminate);
child.Start();
Assert.True(child.WaitForExit(WaitInMS));
- Assert.NotEqual(SuccessExitCode, child.ExitCode);
+ Assert.NotEqual(RemoteExecutor.SuccessExitCode, child.ExitCode);
}
[Fact]
<ProjectGuid>{E1114510-844C-4BB2-BBAD-8595BD16E24B}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants);TargetsWindows</DefineConstants>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release;uapaot-Windows_NT-Debug;uapaot-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="ProcessStreamReadTests.netcoreapp.cs" />
<Compile Include="ProcessTests.netcoreapp.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
<!-- WINDOWS: Shared CoreCLR and .NET Native -->
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
<Compile Include="$(CommonPath)\CoreLib\System\PasteArguments.Windows.cs">
// See the LICENSE file in the project root for more information.
using System.IO;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.TextWriterTraceListenerTests
{
- public class ConsoleTraceListenerTests : RemoteExecutorTestBase
+ public class ConsoleTraceListenerTests
{
[Fact]
public static void DefaultCtorPropertiesCheck()
[InlineData(true)]
public static void WriteExpectedOutput(bool value)
{
- RemoteInvoke((_value) =>
+ RemoteExecutor.Invoke((_value) =>
{
string message = "Write this message please";
bool setErrorStream = bool.Parse(_value);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, value.ToString()).Dispose();
}
[InlineData(true)]
public static void WriteLineExpectedOutput(bool value)
{
- RemoteInvoke((_value) =>
+ RemoteExecutor.Invoke((_value) =>
{
string message = "A new message to the listener";
bool setErrorStream = bool.Parse(_value);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, value.ToString()).Dispose();
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{92A9467A-9F7E-4294-A7D5-7B59F2E54ABE}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="ConsoleTraceListenerTests.cs" />
<Compile Include="XmlWriterTraceListenerTests.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
namespace System.Diagnostics.TraceSourceTests
{
- public partial class DefaultTraceListenerClassTests : RemoteExecutorTestBase
+ public partial class DefaultTraceListenerClassTests : FileCleanupTestBase
{
private class TestDefaultTraceListener : DefaultTraceListener
{
using System.Reflection;
using System.Reflection.Emit;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Diagnostics.TraceSourceTests
{
- public partial class DefaultTraceListenerClassTests : RemoteExecutorTestBase
+ public partial class DefaultTraceListenerClassTests
{
[Fact]
public void EntryAssemblyName_Default_IncludedInTrace()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var listener = new TestDefaultTraceListener();
Trace.Listeners.Add(listener);
[Fact]
public void EntryAssemblyName_Null_NotIncludedInTrace()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
MakeAssemblyGetEntryAssemblyReturnNull();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <RootNamespace>System.Diagnostics.TraceSourceTests</RootNamespace>
- <AssemblyName>System.Diagnostics.TraceSource.Tests</AssemblyName>
<ProjectGuid>{7B32D24D-969A-4F7F-8461-B43E15E5D553}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<Compile Include="DefaultTraceListenerClassTests.netcoreapp.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
namespace System.Drawing.Tests
{
- public class BitmapTests : RemoteExecutorTestBase
+ public class BitmapTests : FileCleanupTestBase
{
public static IEnumerable<object[]> Ctor_FilePath_TestData()
{
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Drawing.Tests
{
- public class IconTests : RemoteExecutorTestBase
+ public class IconTests
{
[ConditionalTheory(Helpers.IsDrawingSupported)]
[InlineData("48x48_multiple_entries_4bit.ico")]
if (!AppContext.TryGetSwitch(DontSupportPngFramesInIcons, out bool isEnabled) || isEnabled)
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppContext.SetSwitch(DontSupportPngFramesInIcons, false);
VerifyPng();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
else
if (!AppContext.TryGetSwitch(DontSupportPngFramesInIcons, out bool isEnabled) || !isEnabled)
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppContext.SetSwitch(DontSupportPngFramesInIcons, true);
VerifyPngNotSupported();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
else
<PropertyGroup>
<ProjectGuid>{4B93E684-0630-45F4-8F63-6C7788C9892F}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release</Configurations>
<TestDataPackageVersion>1.0.7</TestDataPackageVersion>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="BitmapTests.cs" />
<Compile Include="Printing\PaperSourceTests.cs" />
<Compile Include="Printing\PrinterUnitConvertTests.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
{
public class bitmap_173x183_indexed_8bit { }
- public class ToolboxBitmapAttributeTests : RemoteExecutorTestBase
+ public class ToolboxBitmapAttributeTests
{
private static Size DefaultSize = new Size(16, 16);
private void AssertDefaultSize(Image image)
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Globalization.Tests
{
- public class CurrentCultureTests : RemoteExecutorTestBase
+ public class CurrentCultureTests
{
[Fact]
public void CurrentCulture()
if (PlatformDetection.IsNetNative && !PlatformDetection.IsInAppContainer) // Tide us over until .NET Native ILC tests run are run inside an appcontainer.
return;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo newCulture = new CultureInfo(CultureInfo.CurrentCulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "ar-SA" : "ja-JP");
CultureInfo.CurrentCulture = newCulture;
Assert.Equal(CultureInfo.CurrentCulture, newCulture);
Assert.Equal("de-DE_phoneb", newCulture.CompareInfo.Name);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
if (PlatformDetection.IsNetNative && !PlatformDetection.IsInAppContainer) // Tide us over until .NET Native ILC tests run are run inside an appcontainer.
return;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo newUICulture = new CultureInfo(CultureInfo.CurrentUICulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "ar-SA" : "ja-JP");
CultureInfo.CurrentUICulture = newUICulture;
Assert.Equal(CultureInfo.CurrentUICulture, newUICulture);
Assert.Equal("de-DE_phoneb", newUICulture.CompareInfo.Name);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "Thread cultures is not honored in UWP.")]
public void DefaultThreadCurrentCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo newCulture = new CultureInfo(CultureInfo.DefaultThreadCurrentCulture == null || CultureInfo.DefaultThreadCurrentCulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "ar-SA" : "ja-JP");
CultureInfo.DefaultThreadCurrentCulture = newCulture;
((IAsyncResult)task).AsyncWaitHandle.WaitOne();
task.Wait();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "Thread cultures is not honored in UWP.")]
public void DefaultThreadCurrentUICulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo newUICulture = new CultureInfo(CultureInfo.DefaultThreadCurrentUICulture == null || CultureInfo.DefaultThreadCurrentUICulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "ar-SA" : "ja-JP");
CultureInfo.DefaultThreadCurrentUICulture = newUICulture;
((IAsyncResult)task).AsyncWaitHandle.WaitOne();
task.Wait();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
psi.Environment["LANG"] = langEnvVar;
- RemoteInvoke(expected =>
+ RemoteExecutor.Invoke(expected =>
{
Assert.NotNull(CultureInfo.CurrentCulture);
Assert.NotNull(CultureInfo.CurrentUICulture);
Assert.Equal(expected, CultureInfo.CurrentCulture.Name);
Assert.Equal(expected, CultureInfo.CurrentUICulture.Name);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, expectedCultureName, new RemoteInvokeOptions { StartInfo = psi }).Dispose();
}
psi.Environment["LANG"] = langEnvVar;
}
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.NotNull(CultureInfo.CurrentCulture);
Assert.NotNull(CultureInfo.CurrentUICulture);
Assert.Equal("", CultureInfo.CurrentCulture.Name);
Assert.Equal("", CultureInfo.CurrentUICulture.Name);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, new RemoteInvokeOptions { StartInfo = psi }).Dispose();
}
using System.Collections.Generic;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Globalization.Tests
{
- public class CultureInfoDateTimeFormat : RemoteExecutorTestBase
+ public class CultureInfoDateTimeFormat
{
public static IEnumerable<object[]> DateTimeFormatInfo_Set_TestData()
{
[Fact]
public void TestSettingThreadCultures()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo culture = new CultureInfo("ja-JP");
CultureInfo.CurrentCulture = culture;
DateTime dt = new DateTime(2014, 3, 14, 3, 14, 0);
Assert.Equal(dt.ToString(), dt.ToString(culture));
Assert.Equal(dt.ToString(), dt.ToString(culture.DateTimeFormat));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections.Generic;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Globalization.Tests
{
- public class NumberFormatInfoCurrentInfo : RemoteExecutorTestBase
+ public class NumberFormatInfoCurrentInfo
{
public static IEnumerable<object[]> CurrentInfo_CustomCulture_TestData()
{
[MemberData(nameof(CurrentInfo_CustomCulture_TestData))]
public void CurrentInfo_CustomCulture(CultureInfo newCurrentCulture)
{
- RemoteInvoke((cultureName) =>
+ RemoteExecutor.Invoke((cultureName) =>
{
CultureInfo newCulture = CultureInfo.GetCultureInfo(cultureName);
CultureInfo.CurrentCulture = newCulture;
Assert.Same(newCulture.NumberFormat, NumberFormatInfo.CurrentInfo);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, newCurrentCulture.Name).Dispose();
}
[Fact]
public void CurrentInfo_Subclass_OverridesGetFormat()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfoSubclassOverridesGetFormat("en-US");
Assert.Same(CultureInfoSubclassOverridesGetFormat.CustomFormat, NumberFormatInfo.CurrentInfo);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void CurrentInfo_Subclass_OverridesNumberFormat()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfoSubclassOverridesNumberFormat("en-US");
Assert.Same(CultureInfoSubclassOverridesNumberFormat.CustomFormat, NumberFormatInfo.CurrentInfo);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProjectGuid>{484C92C6-6D2C-45BC-A5E2-4A12BA228E1E}</ProjectGuid>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="CompareInfo\CompareInfoTests.cs" />
<Compile Include="$(CommonTestPath)\System\RandomDataGenerator.cs">
<Link>Common\System\RandomDataGenerator.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netfx' And '$(TargetGroup)' != 'netstandard'">
<Compile Include="CompareInfo\CompareInfoTests.netcoreapp.cs" />
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Globalization.Tests
{
- public class RegionInfoPropertyTests : RemoteExecutorTestBase
+ public class RegionInfoPropertyTests
{
[Theory]
[InlineData("US", "US", "US")]
[Fact]
public void CurrentRegion()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.True(RegionInfo.CurrentRegion.Equals(ri) || RegionInfo.CurrentRegion.Equals(new RegionInfo(CultureInfo.CurrentCulture.Name)));
Assert.Same(RegionInfo.CurrentRegion, RegionInfo.CurrentRegion);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[InlineData("en-US", "United States")]
public void DisplayName(string name, string expected)
{
- RemoteInvoke((string _name, string _expected) =>
+ RemoteExecutor.Invoke((string _name, string _expected) =>
{
CultureInfo.CurrentUICulture = new CultureInfo(_name);
Assert.Equal(_expected, new RegionInfo(_name).DisplayName);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, name, expected).Dispose();
}
// See the LICENSE file in the project root for more information.
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
public void FileNameIsToString_NotFullPath()
{
// We're checking that we're maintaining the original path
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Environment.CurrentDirectory = TestDirectory;
string subdir = Path.GetRandomFileName();
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
#endregion
}
- public sealed class Directory_GetEntries_CurrentDirectory : RemoteExecutorTestBase
+ public sealed class Directory_GetEntries_CurrentDirectory : FileCleanupTestBase
{
[Fact]
public void CurrentDirectory()
Directory.CreateDirectory(testDir);
File.WriteAllText(Path.Combine(testDir, GetTestFileName()), "cat");
Directory.CreateDirectory(Path.Combine(testDir, GetTestFileName()));
- RemoteInvoke((testDirectory) =>
+ RemoteExecutor.Invoke((testDirectory) =>
{
Directory.SetCurrentDirectory(testDirectory);
Assert.NotEmpty(Directory.EnumerateFiles(Directory.GetCurrentDirectory(), "*", SearchOption.AllDirectories));
Assert.NotEmpty(Directory.EnumerateFiles(Directory.GetCurrentDirectory(), "*", SearchOption.TopDirectoryOnly));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, testDir).Dispose();
}
}
using System.Diagnostics;
using System.Runtime.InteropServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
{
- public sealed class Directory_SetCurrentDirectory : RemoteExecutorTestBase
+ public sealed class Directory_SetCurrentDirectory : FileCleanupTestBase
{
[Fact]
public void Null_Path_Throws_ArgumentNullException()
[Fact]
public void SetToValidOtherDirectory()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Directory.SetCurrentDirectory(TestDirectory);
// On OSX, the temp directory /tmp/ is a symlink to /private/tmp, so setting the current
{
Assert.Equal(TestDirectory, Directory.GetCurrentDirectory());
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[ConditionalFact(nameof(CanCreateSymbolicLinks))]
public void SetToPathContainingSymLink()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var path = GetTestFilePath();
var linkPath = GetTestFilePath();
{
Assert.Equal(path, Directory.GetCurrentDirectory());
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
// See the LICENSE file in the project root for more information.
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
string path = GetTestFilePath();
using (FileStream stream = new FileStream(path, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
{
- RemoteInvoke((p) =>
+ RemoteExecutor.Invoke((p) =>
{
FileInfo info = new FileInfo(p);
Assert.True(info.Exists);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, path).Dispose();
}
}
{
stream.Lock(0, 10);
- RemoteInvoke((p) =>
+ RemoteExecutor.Invoke((p) =>
{
FileInfo info = new FileInfo(p);
Assert.True(info.Exists);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, path).Dispose();
stream.Unlock(0, 10);
using System;
using System.Diagnostics;
using System.IO;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
[Fact]
public void Dispose_CallsVirtualDisposeTrueArg_ThrowsDuringFlushWriteBuffer_DisposeThrows()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string fileName = GetTestFilePath();
using (FileStream fscreate = new FileStream(fileName, FileMode.Create))
}
Assert.False(writeDisposeInvoked, "Expected finalizer to have been suppressed");
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Missing fix for https://github.com/dotnet/coreclr/pull/16250")]
public void NoDispose_CallsVirtualDisposeFalseArg_ThrowsDuringFlushWriteBuffer_FinalizerWontThrow()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string fileName = GetTestFilePath();
using (FileStream fscreate = new FileStream(fileName, FileMode.Create))
}
Assert.True(writeDisposeInvoked, "Expected finalizer to be invoked but not throw exception");
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
{
- public class FileStream_LockUnlock : RemoteExecutorTestBase
+ public class FileStream_LockUnlock : FileCleanupTestBase
{
[Fact]
public void InvalidArgs_Throws()
{
fs1.Lock(firstPosition, firstLength);
- RemoteInvoke((secondPath, secondPos, secondLen) =>
+ RemoteExecutor.Invoke((secondPath, secondPos, secondLen) =>
{
using (FileStream fs2 = File.Open(secondPath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
{
Assert.Throws<IOException>(() => fs2.Lock(long.Parse(secondPos), long.Parse(secondLen)));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, path, secondPosition.ToString(), secondLength.ToString()).Dispose();
fs1.Unlock(firstPosition, firstLength);
- RemoteInvoke((secondPath, secondPos, secondLen) =>
+ RemoteExecutor.Invoke((secondPath, secondPos, secondLen) =>
{
using (FileStream fs2 = File.Open(secondPath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
{
fs2.Lock(long.Parse(secondPos), long.Parse(secondLen));
fs2.Unlock(long.Parse(secondPos), long.Parse(secondLen));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, path, secondPosition.ToString(), secondLength.ToString()).Dispose();
}
}
using System;
using System.Globalization;
using System.IO;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
[Fact]
public void NameReturnsUnknownForHandle()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
// See the LICENSE file in the project root for more information.
using System.IO;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
[Fact]
public void FileShareOpen_Inheritable()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
int i = 0;
foreach (FileAccess access in new[] { FileAccess.ReadWrite, FileAccess.Write, FileAccess.Read })
CreateFileStream(fileName, FileMode.Open, access, share | FileShare.Inheritable).Dispose();
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
namespace System.IO.Tests
{
- public abstract partial class FileSystemTest : RemoteExecutorTestBase
+ public abstract partial class FileSystemTest : FileCleanupTestBase
{
public static readonly byte[] TestBuffer = { 0xBA, 0x5E, 0xBA, 0x11, 0xF0, 0x07, 0xBA, 0x11 };
<PropertyGroup>
<ProjectGuid>{F0D49126-6A1C-42D5-9428-4374C868BAF8}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\IO\PathFeatures.cs">
<Link>Common\System\IO\PathFeatures.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uapaot' or '$(TargetGroup)' == 'uap'">
<Reference Include="mscorlib" />
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.MemoryMappedFiles.Tests
{
- public class CrossProcessTests : RemoteExecutorTestBase
+ public class CrossProcessTests : FileCleanupTestBase
{
[Fact]
public void DataShared()
acc.Flush();
// Spawn and then wait for the other process, which will verify the data and write its own known pattern
- RemoteInvoke(new Func<string, int>(DataShared_OtherProcess), file.Path).Dispose();
+ RemoteExecutor.Invoke(new Func<string, int>(DataShared_OtherProcess), file.Path).Dispose();
// Now verify we're seeing the data from the other process
for (int i = 0; i < capacity; i++)
acc.Write(i, unchecked((byte)(capacity - i - 1)));
}
acc.Flush();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
<PropertyGroup>
<ProjectGuid>{9D6F6254-B5A3-40FF-8925-68AA8D1CE933}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
</Compile>
<Compile Include="XunitAssemblyAttributes.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Diagnostics;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Pipes.Tests
{
- public class AnonymousPipeTest_CrossProcess : RemoteExecutorTestBase
+ public class AnonymousPipeTest_CrossProcess
{
[Fact]
public void PingPong()
// Then spawn another process to communicate with.
using (var outbound = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable))
using (var inbound = new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable))
- using (var remote = RemoteInvoke(new Func<string, string, int>(ChildFunc), outbound.GetClientHandleAsString(), inbound.GetClientHandleAsString()))
+ using (var remote = RemoteExecutor.Invoke(new Func<string, string, int>(ChildFunc), outbound.GetClientHandleAsString(), inbound.GetClientHandleAsString()))
{
// Close our local copies of the handles now that we've passed them of to the other process
outbound.DisposeLocalCopyOfClientHandle();
outbound.WriteByte((byte)b);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
public void ServerClosesPipe_ClientReceivesEof()
{
using (var pipe = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable))
- using (var remote = RemoteInvoke(new Func<string, int>(ChildFunc), pipe.GetClientHandleAsString()))
+ using (var remote = RemoteExecutor.Invoke(new Func<string, int>(ChildFunc), pipe.GetClientHandleAsString()))
{
pipe.DisposeLocalCopyOfClientHandle();
pipe.Write(new byte[] { 1, 2, 3, 4, 5 }, 0, 5);
}
Assert.Equal(-1, pipe.ReadByte());
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
public void ClientClosesPipe_ServerReceivesEof()
{
using (var pipe = new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable))
- using (var remote = RemoteInvoke(new Func<string, int>(ChildFunc), pipe.GetClientHandleAsString(), new RemoteInvokeOptions { CheckExitCode = false }))
+ using (var remote = RemoteExecutor.Invoke(new Func<string, int>(ChildFunc), pipe.GetClientHandleAsString(), new RemoteInvokeOptions { CheckExitCode = false }))
{
pipe.DisposeLocalCopyOfClientHandle();
pipe.Write(new byte[] { 1, 2, 3, 4, 5 }, 0, 5);
}
Thread.CurrentThread.Join();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
}
using System.Globalization;
using System.Security.Principal;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.Win32.SafeHandles;
using Xunit;
namespace System.IO.Pipes.Tests
{
[ActiveIssue(22271, TargetFrameworkMonikers.UapNotUapAot)]
- public sealed class NamedPipeTest_CrossProcess : RemoteExecutorTestBase
+ public sealed class NamedPipeTest_CrossProcess
{
[Fact]
public void InheritHandles_AvailableInChildProcess()
using (var client = new NamedPipeClientStream(".", pipeName, PipeDirection.Out, PipeOptions.None, TokenImpersonationLevel.None, HandleInheritability.Inheritable))
{
Task.WaitAll(server.WaitForConnectionAsync(), client.ConnectAsync());
- using (RemoteInvoke(new Func<string, int>(ChildFunc), client.SafePipeHandle.DangerousGetHandle().ToString()))
+ using (RemoteExecutor.Invoke(new Func<string, int>(ChildFunc), client.SafePipeHandle.DangerousGetHandle().ToString()))
{
client.Dispose();
for (int i = 0; i < 5; i++)
childClient.WriteByte((byte)i);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
// another process with which to communicate
using (var outbound = new NamedPipeServerStream(outName, PipeDirection.Out))
using (var inbound = new NamedPipeClientStream(".", inName, PipeDirection.In))
- using (RemoteInvoke(new Func<string, string, int>(PingPong_OtherProcess), outName, inName))
+ using (RemoteExecutor.Invoke(new Func<string, string, int>(PingPong_OtherProcess), outName, inName))
{
// Wait for both pipes to be connected
Task.WaitAll(outbound.WaitForConnectionAsync(), inbound.ConnectAsync());
// another process with which to communicate
using (var outbound = new NamedPipeServerStream(outName, PipeDirection.Out))
using (var inbound = new NamedPipeClientStream(".", inName, PipeDirection.In))
- using (RemoteInvoke(new Func<string, string, int>(PingPong_OtherProcess), outName, inName))
+ using (RemoteExecutor.Invoke(new Func<string, string, int>(PingPong_OtherProcess), outName, inName))
{
// Wait for both pipes to be connected
await Task.WhenAll(outbound.WaitForConnectionAsync(), inbound.ConnectAsync());
outbound.WriteByte((byte)b);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
private static string GetUniquePipeName()
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
-using Xunit;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.DotNet.XUnitExtensions;
+using Xunit;
namespace System.IO.Pipes.Tests
{
/// <summary>
/// Negative tests for PipeOptions.CurrentUserOnly in Unix.
/// </summary>
- public class NamedPipeTest_CurrentUserOnly_Unix : RemoteExecutorTestBase
+ public class NamedPipeTest_CurrentUserOnly_Unix
{
[Theory]
[OuterLoop("Needs sudo access")]
{
Task serverTask = server.WaitForConnectionAsync(CancellationToken.None);
- using (RemoteInvoke(
+ using (RemoteExecutor.Invoke(
new Func<string, string, int>(ConnectClientFromRemoteInvoker),
pipeName,
clientPipeOptions == PipeOptions.CurrentUserOnly ? "true" : "false",
client.Connect();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
}
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Pipes.Tests
{
- public class NamedPipeTest_RunAsClient : RemoteExecutorTestBase
+ public class NamedPipeTest_RunAsClient
{
[DllImport("libc", SetLastError = true)]
internal static extern unsafe int seteuid(uint euid);
{
string pipeName = Path.GetRandomFileName();
uint pairID = (uint)(Math.Abs(new Random(5125123).Next()));
- RemoteInvoke(new Func<string, string, int>(ServerConnectAsId), pipeName, pairID.ToString()).Dispose();
+ RemoteExecutor.Invoke(new Func<string, string, int>(ServerConnectAsId), pipeName, pairID.ToString()).Dispose();
}
private static int ServerConnectAsId(string pipeName, string pairIDString)
uint pairID = uint.Parse(pairIDString);
Assert.NotEqual(-1, seteuid(pairID));
using (var outbound = new NamedPipeServerStream(pipeName, PipeDirection.Out))
- using (var handle = RemoteInvoke(new Func<string, string, int>(ClientConnectAsID), pipeName, pairIDString))
+ using (var handle = RemoteExecutor.Invoke(new Func<string, string, int>(ClientConnectAsID), pipeName, pairIDString))
{
// Connect as the unpriveleged user, but RunAsClient as the superuser
outbound.WaitForConnection();
Assert.True(ran, "Expected delegate to have been invoked");
Assert.Equal(pairID, ranAs);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
private static int ClientConnectAsID(string pipeName, string pairIDString)
Assert.NotEqual(-1, seteuid(pairID));
inbound.Connect();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
}
namespace System.IO.Pipes.Tests
{
- public partial class NamedPipeTest_RunAsClient : RemoteExecutorTestBase
+ public partial class NamedPipeTest_RunAsClient
{
[Theory]
[InlineData(TokenImpersonationLevel.None)]
<PropertyGroup>
<ProjectGuid>{142469EC-D665-4FE2-845A-FDA69F9CC557}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
- <!-- Compiled Source Files -->
<ItemGroup>
<Compile Include="AnonymousPipeTests\AnonymousPipeTest.CreateServer.cs" />
<Compile Include="AnonymousPipeTests\AnonymousPipeTest.CreateClient.cs" />
<Compile Include="NamedPipeTests\NamedPipeTest.RunAsClient.Unix.cs" />
<Compile Include="NativeOverlapped.unix.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Xunit;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
+using Xunit;
namespace System.IO.Tests
{
- public partial class StringWriterTests : RemoteExecutorTestBase
+ public partial class StringWriterTests
{
static int[] iArrInvalidValues = new int[] { -1, -2, -100, -1000, -10000, -100000, -1000000, -10000000, -100000000, -1000000000, int.MinValue, short.MinValue };
static int[] iArrLargeValues = new int[] { int.MaxValue, int.MaxValue - 1, int.MaxValue / 2, int.MaxValue / 10, int.MaxValue / 100 };
[Fact]
public static void TestWriteMisc()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // floating-point formatting comparison depends on culture
var sw = new StringWriter();
[Fact]
public static void TestWriteLineMisc()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US"); // floating-point formatting comparison depends on culture
var sw = new StringWriter();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <RootNamespace>System.IO</RootNamespace>
- <AssemblyName>System.IO.Tests</AssemblyName>
<ProjectGuid>{492EC54D-D2C4-4B3F-AC1F-646B3F7EBB02}</ProjectGuid>
+ <RootNamespace>System.IO</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="BinaryReader\BinaryReaderTests.netcoreapp.cs" Condition="'$(TargetGroup)' == 'netcoreapp'" />
<Compile Include="TextWriter\TextWriterTests.netcoreapp.cs" Condition="'$(TargetGroup)' == 'netcoreapp'" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<ProjectGuid>{DC683D60-34EC-4D85-B6E0-E97FDB37A583}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\Json\JsonObjectTests.cs" />
<Compile Include="System\Json\JsonPrimitiveTests.cs" />
<Compile Include="System\Json\JsonValueTests.cs" />
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file
using System.IO;
using System.Text;
using System.Globalization;
-using Xunit;
using System.Collections;
using System.Collections.Generic;
+using Microsoft.DotNet.RemoteExecutor;
+using Xunit;
namespace System.Json.Tests
{
- public class JsonValueTests : RemoteExecutorTestBase
+ public class JsonValueTests
{
[Fact]
public void JsonValue_Load_LoadWithTrailingCommaInDictionary()
[InlineData("0.000000000000000000000000000011", 1.1E-29)]
public void JsonValue_Parse_Double(string json, double expected)
{
- RemoteInvoke((jsonInner, expectedInner) =>
+ RemoteExecutor.Invoke((jsonInner, expectedInner) =>
{
foreach (string culture in new[] { "en", "fr", "de" })
{
[InlineData(1.123456789e-28)] // Values around the smallest positive decimal value
public void JsonValue_Parse_Double_ViaJsonPrimitive(double number)
{
- RemoteInvoke(numberText =>
+ RemoteExecutor.Invoke(numberText =>
{
double numberInner = double.Parse(numberText, CultureInfo.InvariantCulture);
foreach (string culture in new[] { "en", "fr", "de" })
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Linq.Parallel.Tests
{
- public class EtwTests : RemoteExecutorTestBase
+ public class EtwTests
{
[Fact]
public static void TestEtw()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener(new Guid("159eeeec-4a14-4418-a8fe-faabcd987887"), EventLevel.Verbose))
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{A7074928-82C3-4739-88FE-9B528977950C}</ProjectGuid>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
<!-- Avoid extreme slowness when running NETFX tests (ie with xunit.console.exe) -->
<XUnitNoAppdomain>true</XUnitNoAppdomain>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
- <!-- Compiled Source Files -->
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\Diagnostics\Tracing\TestEventListener.cs">
<Link>Common\System\Diagnostics\Tracing\TestEventListener.cs</Link>
<Compile Include="PlinqModesTests.cs" />
<Compile Include="WithCancellationTests.cs" />
<Compile Include="XunitAssemblyAttributes.cs" />
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
\ No newline at end of file
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProjectGuid>{15DB0DCC-68B4-4CFB-8BD2-F26BCCAF5A3F}</ProjectGuid>
<IncludePartialFacadeTests Condition="'$(TargetGroup)' == 'netcoreapp' OR '$(TargetGroup)' == 'uap'">true</IncludePartialFacadeTests>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<ItemGroup Condition="'$(IncludePartialFacadeTests)' == 'true'">
<!-- Tests specific to netcoreapp and uap -->
<ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Http.Functional.Tests
[Fact]
public void SendAsync_ExpectedDiagnosticSourceLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool requestLogged = false;
Guid requestGuid = Guid.Empty;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceNoLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool requestLogged = false;
bool responseLogged = false;
Assert.False(activityStopLogged, "HttpRequestOut.Stop was logged while logging disabled.");
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[InlineData(true)]
public void SendAsync_HttpTracingEnabled_Succeeds(bool useSsl)
{
- RemoteInvoke(async (useSocketsHttpHandlerString, useSslString) =>
+ RemoteExecutor.Invoke(async (useSocketsHttpHandlerString, useSslString) =>
{
using (var listener = new TestEventListener("Microsoft-System-Net-Http", EventLevel.Verbose))
{
Assert.InRange(events.Count, 1, int.MaxValue);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString(), useSsl.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticExceptionLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool exceptionLogged = false;
bool responseLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticCancelledLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool cancelLogged = false;
var diagnosticListenerObserver = new FakeDiagnosticListenerObserver(kvp =>
"Cancellation was not logged within 1 second timeout.");
diagnosticListenerObserver.Disable();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceActivityLoggingRequestId()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool requestLogged = false;
bool responseLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceActivityLoggingW3C()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool requestLogged = false;
bool responseLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceActivityLogging_InvalidBaggage()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool activityStopLogged = false;
bool exceptionLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceActivityLoggingDoesNotOverwriteHeader()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool activityStartLogged = false;
bool activityStopLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceActivityLoggingDoesNotOverwriteW3CTraceParentHeader()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool activityStartLogged = false;
bool activityStopLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceUrlFilteredActivityLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool activityStartLogged = false;
bool activityStopLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticExceptionActivityLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool exceptionLogged = false;
bool activityStopLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
return;
}
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool exceptionLogged = false;
bool activityStopLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool requestLogged = false;
bool responseLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticExceptionOnlyActivityLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool exceptionLogged = false;
bool activityLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticStopOnlyActivityLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool activityStartLogged = false;
bool activityStopLogged = false;
diagnosticListenerObserver.Disable();
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_ExpectedDiagnosticCancelledActivityLogging()
{
- RemoteInvoke(useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(useSocketsHttpHandlerString =>
{
bool cancelLogged = false;
var diagnosticListenerObserver = new FakeDiagnosticListenerObserver(kvp =>
"Cancellation was not logged within 1 second timeout.");
diagnosticListenerObserver.Disable();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void SendAsync_NullRequest_ThrowsArgumentNullException()
{
- RemoteInvoke(async () =>
+ RemoteExecutor.Invoke(async () =>
{
var diagnosticListenerObserver = new FakeDiagnosticListenerObserver(null);
using (DiagnosticListener.AllListeners.Subscribe(diagnosticListenerObserver))
}
diagnosticListenerObserver.Disable();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
// UAP HTTP stack caches connections per-process. This causes interference when these tests run in
// the same process as the other tests. Each test needs to be isolated to its own process.
// See dicussion: https://github.com/dotnet/corefx/issues/21945
- RemoteInvoke(async (certIndexString, expectedStatusCodeString, useSocketsHttpHandlerString) =>
+ RemoteExecutor.Invoke(async (certIndexString, expectedStatusCodeString, useSocketsHttpHandlerString) =>
{
X509Certificate2 clientCert = null;
Assert.Equal(clientCert, receivedCert);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}, certIndex.ToString(), expectedStatusCode.ToString(), UseSocketsHttpHandler.ToString()).Dispose();
}
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Http.Functional.Tests
psi.Environment.Add("http_proxy", $"http://{proxyUri.Host}:{proxyUri.Port}");
}
- RemoteInvoke(async (useProxyString, useSocketsHttpHandlerString) =>
+ RemoteExecutor.Invoke(async (useProxyString, useSocketsHttpHandlerString) =>
{
using (HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString))
using (var client = new HttpClient(handler))
// Correctness of user and password is done in server part.
Assert.True(response.StatusCode == HttpStatusCode.OK);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, useProxy.ToString(), UseSocketsHttpHandler.ToString(), new RemoteInvokeOptions { StartInfo = psi }).Dispose();
if (useProxy)
{
using System.Security.Authentication.ExtendedProtection;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Http.Functional.Tests
File.WriteAllText(sslCertFile, "");
psi.Environment.Add("SSL_CERT_FILE", sslCertFile);
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
const string Url = "https://www.microsoft.com";
{
await Assert.ThrowsAsync<HttpRequestException>(() => client.GetAsync(Url));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString(), new RemoteInvokeOptions { StartInfo = psi }).Dispose();
}
}
using System.Security.Authentication.ExtendedProtection;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Http.Functional.Tests
// UAP HTTP stack caches connections per-process. This causes interference when these tests run in
// the same process as the other tests. Each test needs to be isolated to its own process.
// See dicussion: https://github.com/dotnet/corefx/issues/21945
- RemoteInvoke((remoteUrl, remoteExpectedErrors, useSocketsHttpHandlerString) =>
+ RemoteExecutor.Invoke((remoteUrl, remoteExpectedErrors, useSocketsHttpHandlerString) =>
{
UseCallback_BadCertificate_ExpectedPolicyErrors_Helper(
remoteUrl,
bool.Parse(useSocketsHttpHandlerString),
(SslPolicyErrors)Enum.Parse(typeof(SslPolicyErrors), remoteExpectedErrors)).Wait();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, url, expectedErrors.ToString(), UseSocketsHttpHandler.ToString()).Dispose();
}
else
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
-
using Microsoft.DotNet.XUnitExtensions;
-
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
// UAP HTTP stack caches connections per-process. This causes interference when these tests run in
// the same process as the other tests. Each test needs to be isolated to its own process.
// See dicussion: https://github.com/dotnet/corefx/issues/21945
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
using (var client = CreateHttpClient(useSocketsHttpHandlerString))
{
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}, UseSocketsHttpHandler.ToString()).Dispose();
}
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using System.IO;
using System.Reflection;
using System.Net.Test.Common;
namespace System.Net.Http.Functional.Tests
{
- public abstract class HttpClientHandlerTestBase : RemoteExecutorTestBase
+ public abstract class HttpClientHandlerTestBase : FileCleanupTestBase
{
protected virtual bool UseSocketsHttpHandler => true;
protected virtual bool UseHttp2LoopbackServer => false;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
[Fact]
public void Authentication_UseStreamContent_Throws()
{
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
// This test validates the current limitation of CoreFx's NetFxToWinRtStreamAdapter
// which throws exceptions when trying to rewind a .NET Stream when it needs to be
await Assert.ThrowsAsync<HttpRequestException>(() => client.PostAsync(uri, content));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void Authentication_UseMultiInterfaceNonRewindableStreamContent_Throws()
{
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
string username = "testuser";
string password = "password";
await Assert.ThrowsAsync<HttpRequestException>(() => client.PostAsync(uri, content));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void Authentication_UseMultiInterfaceStreamContent_Success()
{
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
string username = "testuser";
string password = "password";
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void Authentication_UseMemoryStreamVisibleBufferContent_Success()
{
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
string username = "testuser";
string password = "password";
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
[Fact]
public void Authentication_UseMemoryStreamNotVisibleBufferContent_Success()
{
- RemoteInvoke(async useSocketsHttpHandlerString =>
+ RemoteExecutor.Invoke(async useSocketsHttpHandlerString =>
{
string username = "testuser";
string password = "password";
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, UseSocketsHttpHandler.ToString()).Dispose();
}
}
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
[InlineData(true)]
public void ConnectionsPooledThenDisposed_NoUnobservedTaskExceptions(bool secure)
{
- RemoteInvoke(async secureString =>
+ RemoteExecutor.Invoke(async secureString =>
{
var releaseServer = new TaskCompletionSource<bool>();
await LoopbackServer.CreateClientAndServerAsync(async uri =>
await releaseServer.Task;
}),
new LoopbackServer.Options { UseSsl = bool.Parse(secureString) });
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, secure.ToString()).Dispose();
}
[InlineData("", true)]
public void HttpClientHandler_SettingEnvironmentVariableChangesDefault(string envVarValue, bool expectedUseSocketsHandler)
{
- RemoteInvoke((innerEnvVarValue, innerExpectedUseSocketsHandler) =>
+ RemoteExecutor.Invoke((innerEnvVarValue, innerExpectedUseSocketsHandler) =>
{
Environment.SetEnvironmentVariable(EnvironmentVariableSettingName, innerEnvVarValue);
using (var handler = new HttpClientHandler())
{
Assert.Equal(bool.Parse(innerExpectedUseSocketsHandler), IsSocketsHttpHandler(handler));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, envVarValue, expectedUseSocketsHandler.ToString()).Dispose();
}
[Fact]
public void HttpClientHandler_SettingAppContextChangesDefault()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppContext.SetSwitch(AppContextSettingName, isEnabled: true);
using (var handler = new HttpClientHandler())
Assert.False(IsSocketsHttpHandler(handler));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void HttpClientHandler_AppContextOverridesEnvironmentVariable()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Environment.SetEnvironmentVariable(EnvironmentVariableSettingName, "true");
using (var handler = new HttpClientHandler())
Assert.True(IsSocketsHttpHandler(handler));
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
<DefineConstants Condition="'$(TargetsWindows)'=='true'">$(DefineConstants);TargetsWindows</DefineConstants>
<DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="XUnitAssemblyAttributes.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<SupplementalTestData Include="$(PackagesDir)system.net.testdata\1.0.1-prerelease\content\**\*.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsOSX)'=='true'">
using System.Globalization;
using System.Linq;
using System.Net.Http.Headers;
-
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Http.Tests
{
- public class CacheControlHeaderValueTest : RemoteExecutorTestBase
+ public class CacheControlHeaderValueTest
{
[Fact]
public void Properties_SetAndGetAllProperties_SetValueReturnedInGetter()
[Fact]
public void ToString_NegativeValues_UsesMinusSignRegardlessOfCurrentCulture()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var cacheControl = new CacheControlHeaderValue()
{
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using System.Diagnostics;
using System.Net.Http;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
-using System.Diagnostics;
namespace System.Net.Http.Tests
{
- public class HttpEnvironmentProxyTest : RemoteExecutorTestBase
+ public class HttpEnvironmentProxyTest
{
private readonly ITestOutputHelper _output;
private static readonly Uri fooHttp = new Uri("http://foo.com");
[Fact]
public void HttpProxy_EnvironmentProxy_Loaded()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
IWebProxy p;
u = p.GetProxy(fooHttps);
Assert.True(u != null && u.Host == "1.1.1.5" && u.Port == 3005);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[InlineData("http://1.2.3.4:8888/foo", "1.2.3.4", "8888", null, null)]
public void HttpProxy_Uri_Parsing(string _input, string _host, string _port, string _user , string _password)
{
- RemoteInvoke((input, host, port, user, password) =>
+ RemoteExecutor.Invoke((input, host, port, user, password) =>
{
// Remote exec does not allow to pass null at this moment.
if (user == "null")
Assert.Equal(password, nc.Password);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, _input, _host, _port, _user ?? "null" , _password ?? "null").Dispose();
}
[Fact]
public void HttpProxy_CredentialParsing_Basic()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
IWebProxy p;
Assert.Null(p.Credentials.GetCredential(fooHttp, "Basic"));
Assert.Null(p.Credentials.GetCredential(null, null));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void HttpProxy_Exceptions_Match()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
IWebProxy p;
Assert.False(p.IsBypassed(new Uri("http://1test.com")));
Assert.True(p.IsBypassed(new Uri("http://www.test.com")));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using System.Diagnostics;
using System.Net.Http;
+using System.Net.Http.WinHttpHandlerUnitTests;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
-using System.Diagnostics;
-using System.Net.Http.WinHttpHandlerUnitTests;
namespace System.Net.Http.Tests
{
- public class HttpSystemProxyTest : RemoteExecutorTestBase
+ public class HttpSystemProxyTest
{
private readonly ITestOutputHelper _output;
private const string FakeProxyString = "http://proxy.contoso.com";
[InlineData("https=https://proxy.secure.com", false, true)]
public void HttpProxy_SystemProxy_Loaded(string rawProxyString, bool hasInsecureProxy, bool hasSecureProxy)
{
- RemoteInvoke((proxyString, insecureProxy, secureProxy) =>
+ RemoteExecutor.Invoke((proxyString, insecureProxy, secureProxy) =>
{
IWebProxy p;
Assert.Equal(Boolean.Parse(secureProxy) ? new Uri(secureProxyUri) : null, p.GetProxy(new Uri(fooHttps)));
Assert.Equal(Boolean.Parse(insecureProxy) ? new Uri(insecureProxyUri) : null, p.GetProxy(new Uri(fooWs)));
Assert.Equal(Boolean.Parse(secureProxy) ? new Uri(secureProxyUri) : null, p.GetProxy(new Uri(fooWss)));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, rawProxyString, hasInsecureProxy.ToString(), hasSecureProxy.ToString()).Dispose();
}
[InlineData("123.123.123.123", "http://123.123.123.123/")]
public void HttpProxy_SystemProxy_Loaded(string rawProxyString, string expectedUri)
{
- RemoteInvoke((proxyString, expectedString) =>
+ RemoteExecutor.Invoke((proxyString, expectedString) =>
{
IWebProxy p;
Assert.Equal(expectedString, p.GetProxy(new Uri(fooHttp)).ToString());
Assert.Equal(expectedString, p.GetProxy(new Uri(fooHttps)).ToString());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, rawProxyString, expectedUri).Dispose();
}
[InlineData("http://www.b\u00e9b\u00e9.eu/", true)]
public void HttpProxy_Local_Bypassed(string name, bool shouldBypass)
{
- RemoteInvoke((url, expected) =>
+ RemoteExecutor.Invoke((url, expected) =>
{
bool expectedResult = Boolean.Parse(expected);
IWebProxy p;
Uri u = new Uri(url);
Assert.Equal(expectedResult, p.GetProxy(u) == null);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, name, shouldBypass.ToString()).Dispose();
}
[InlineData("[::]", 1)]
public void HttpProxy_Local_Parsing(string bypass, int count)
{
- RemoteInvoke((bypassValue, expected) =>
+ RemoteExecutor.Invoke((bypassValue, expected) =>
{
int expectedCount = Convert.ToInt32(expected);
IWebProxy p;
{
Assert.Null(sp.BypassList);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, bypass, count.ToString()).Dispose();
}
[InlineData(" ; ")]
public void HttpProxy_InvalidSystemProxy_Null(string rawProxyString)
{
- RemoteInvoke((proxyString) =>
+ RemoteExecutor.Invoke((proxyString) =>
{
IWebProxy p;
Assert.Equal(null, p.GetProxy(new Uri(fooHttps)));
Assert.Equal(null, p.GetProxy(new Uri(fooWs)));
Assert.Equal(null, p.GetProxy(new Uri(fooWss)));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, rawProxyString).Dispose();
}
}
<ProjectGuid>{5F9C3C9F-652E-461E-B2D6-85D264F5A733}</ProjectGuid>
<StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release</Configurations>
</PropertyGroup>
<!-- Do not reference these assemblies from the TargetingPack since we are building part of the source code for tests. -->
<Link>ProductionCode\System\Net\Http\WinInetProxyHelper.cs</Link>
</Compile>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Mail.Tests
{
- public class LoggingTest : RemoteExecutorTestBase
+ public class LoggingTest
{
[Fact]
[ActiveIssue(20470, TargetFrameworkMonikers.UapAot)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "NetEventSource is only part of .NET Core.")]
public void EventSource_EventsRaisedAsExpected()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("Microsoft-System-Net-Mail", EventLevel.Verbose))
{
Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself
Assert.InRange(events.Count, 1, int.MaxValue);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{A26D88B7-6EF6-4C8C-828B-7B57732CCE38}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference Include="System.Net.NetworkInformation" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Primitives.Functional.Tests
{
- public class LoggingTest : RemoteExecutorTestBase
+ public class LoggingTest
{
[Fact]
[ActiveIssue(20470, TargetFrameworkMonikers.UapAot)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "NetEventSource is only part of .NET Core.")]
public void EventSource_EventsRaisedAsExpected()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("Microsoft-System-Net-Primitives", EventLevel.Verbose))
{
Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself
Assert.InRange(events.Count, 1, int.MaxValue);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{E671BC9F-A64C-4504-8B00-7A3215B99AF9}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="IPEndPointParsing.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<Reference Include="System.Memory" />
</ItemGroup>
<ItemGroup>
using System.Collections;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
#pragma warning disable CS0618 // obsolete warnings
namespace System.Net.Tests
{
- public class AuthenticationManagerTest : RemoteExecutorTestBase
+ public class AuthenticationManagerTest
{
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "AuthenticationManager supported on NETFX")]
[Fact]
[Fact]
public void Register_Unregister_ModuleCountUnchanged()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
int initialCount = GetModuleCount();
IAuthenticationModule module = new CustomModule();
AuthenticationManager.Unregister(module);
Assert.Equal(initialCount, GetModuleCount());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
public void Register_UnregisterByScheme_ModuleCountUnchanged()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
int initialCount = GetModuleCount();
IAuthenticationModule module = new CustomModule();
AuthenticationManager.Unregister("custom");
Assert.Equal(initialCount, GetModuleCount());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
{
Assert.Null(AuthenticationManager.CredentialPolicy);
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
ICredentialPolicy cp = new DummyCredentialPolicy();
AuthenticationManager.CredentialPolicy = cp;
AuthenticationManager.CredentialPolicy = null;
Assert.Null(AuthenticationManager.CredentialPolicy);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
Assert.Empty(AuthenticationManager.CustomTargetNameDictionary);
Assert.Same(AuthenticationManager.CustomTargetNameDictionary, AuthenticationManager.CustomTargetNameDictionary);
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string theKey = "http://www.contoso.com";
string theValue = "HTTP/www.contoso.com";
AuthenticationManager.CustomTargetNameDictionary.Clear();
Assert.Equal(0, AuthenticationManager.CustomTargetNameDictionary.Count);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
-
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Tests
{
- public class GlobalProxySelectionTest : RemoteExecutorTestBase
+ public class GlobalProxySelectionTest
{
private class MyWebProxy : IWebProxy
{
[Fact]
public void Select_Success()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var myProxy = new MyWebProxy();
Assert.True(GlobalProxySelection.Select.IsBypassed(null)); // This is true for EmptyWebProxy, but not for most proxies
#pragma warning restore 0618
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Text;
using System.Threading;
using System.Threading.Tasks;
-
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
{
using Configuration = System.Net.Test.Common.Configuration;
- public partial class HttpWebRequestTest : RemoteExecutorTestBase
+ public partial class HttpWebRequestTest
{
private const string RequestBody = "This is data to POST.";
private readonly byte[] _requestBodyBytes = Encoding.UTF8.GetBytes(RequestBody);
[Fact]
public void DefaultMaximumResponseHeadersLength_SetAndGetLength_ValuesMatch()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
int defaultMaximumResponseHeadersLength = HttpWebRequest.DefaultMaximumResponseHeadersLength;
const int NewDefaultMaximumResponseHeadersLength = 255;
HttpWebRequest.DefaultMaximumResponseHeadersLength = defaultMaximumResponseHeadersLength;
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void DefaultMaximumErrorResponseLength_SetAndGetLength_ValuesMatch()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
int defaultMaximumErrorsResponseLength = HttpWebRequest.DefaultMaximumErrorResponseLength;
const int NewDefaultMaximumErrorsResponseLength = 255;
HttpWebRequest.DefaultMaximumErrorResponseLength = defaultMaximumErrorsResponseLength;
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void DefaultCachePolicy_SetAndGetPolicyReload_ValuesMatch()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
RequestCachePolicy requestCachePolicy = HttpWebRequest.DefaultCachePolicy;
HttpWebRequest.DefaultCachePolicy = requestCachePolicy;
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
proxyTask = proxyServer.AcceptConnectionPerformAuthenticationAndCloseAsync("Proxy-Authenticate: Basic realm=\"NetCore\"\r\n");
psi.Environment.Add("http_proxy", $"http://{proxyUri.Host}:{proxyUri.Port}");
- RemoteInvoke(async (user, pw) =>
+ RemoteExecutor.Invoke(async (user, pw) =>
{
WebRequest.DefaultWebProxy.Credentials = new NetworkCredential(user, pw);
HttpWebRequest request = HttpWebRequest.CreateHttp(Configuration.Http.RemoteEchoServer);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, cred.UserName, cred.Password, new RemoteInvokeOptions { StartInfo = psi }).Dispose();
await proxyTask;
<PropertyGroup>
<ProjectGuid>{E520B5FD-C6FF-46CF-8079-6C8098013EA3}</ProjectGuid>
<StringResourcesPath>../src/Resources/Strings.resx</StringResourcesPath>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
<Compile Include="$(CommonTestPath)\System\Threading\Tasks\TaskTimeoutExtensions.cs">
<Link>Common\System\Threading\Tasks\TaskTimeoutExtensions.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="AuthorizationTest.cs" />
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Tests
{
- public class WebRequestTest : RemoteExecutorTestBase
+ public class WebRequestTest
{
static WebRequestTest()
{
[Fact]
public void DefaultWebProxy_SetThenGet_ValuesMatch()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
IWebProxy p = new WebProxy();
WebRequest.DefaultWebProxy = p;
Assert.Same(p, WebRequest.DefaultWebProxy);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Security.Tests
{
- public class LoggingTest : RemoteExecutorTestBase
+ public class LoggingTest
{
[Fact]
[ActiveIssue(20470, TargetFrameworkMonikers.UapAot)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "NetEventSource is only part of .NET Core.")]
public void EventSource_EventsRaisedAsExpected()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("Microsoft-System-Net-Security", EventLevel.Verbose))
{
Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself
Assert.InRange(events.Count, 1, int.MaxValue);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{A55A2B9A-830F-4330-A0E7-02A9FB30ABD2}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-OSX-Debug;netcoreapp-OSX-Release;netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-OSX-Debug;netstandard-OSX-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetsUnix)' == 'true' ">
<ItemGroup>
<SupplementalTestData Include="$(PackagesDir)system.net.testdata\1.0.1-prerelease\content\**\*.*" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
using System.Diagnostics;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Tests
{
- public class ServicePointManagerTest : RemoteExecutorTestBase
+ public class ServicePointManagerTest
{
[Fact]
public static void RequireEncryption_ExpectedDefault()
{
- RemoteInvoke(() => Assert.Equal(EncryptionPolicy.RequireEncryption, ServicePointManager.EncryptionPolicy)).Dispose();
+ RemoteExecutor.Invoke(() => Assert.Equal(EncryptionPolicy.RequireEncryption, ServicePointManager.EncryptionPolicy)).Dispose();
}
[Fact]
public static void CheckCertificateRevocationList_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.False(ServicePointManager.CheckCertificateRevocationList);
[Fact]
public static void DefaultConnectionLimit_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(2, ServicePointManager.DefaultConnectionLimit);
[Fact]
public static void DnsRefreshTimeout_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(120000, ServicePointManager.DnsRefreshTimeout);
[Fact]
public static void EnableDnsRoundRobin_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.False(ServicePointManager.EnableDnsRoundRobin);
[Fact]
public static void Expect100Continue_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(ServicePointManager.Expect100Continue);
[Fact]
public static void MaxServicePointIdleTime_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(100000, ServicePointManager.MaxServicePointIdleTime);
[Fact]
public static void MaxServicePoints_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(0, ServicePointManager.MaxServicePoints);
[Fact]
public static void ReusePort_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.False(ServicePointManager.ReusePort);
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Desktop default SecurityProtocol to Ssl3; explicitly changed to SystemDefault for core.")]
public static void SecurityProtocol_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var orig = (SecurityProtocolType)0; // SystemDefault.
Assert.Equal(orig, ServicePointManager.SecurityProtocol);
[Fact]
public static void ServerCertificateValidationCallback_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Null(ServicePointManager.ServerCertificateValidationCallback);
[Fact]
public static void UseNagleAlgorithm_Roundtrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(ServicePointManager.UseNagleAlgorithm);
[Fact]
public static void InvalidArguments_Throw()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
const int ssl2Client = 0x00000008;
const int ssl2Server = 0x00000004;
[Fact]
public static void SecurityProtocol_Ssl3_NotSupported()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
const int ssl2Client = 0x00000008;
const int ssl2Server = 0x00000004;
[Fact]
public static void FindServicePoint_ReturnsCachedServicePoint()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
const string Localhost = "http://localhost";
string address1 = "http://" + Guid.NewGuid().ToString("N");
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Desktop ServicePoint lifetime is slightly longer due to implementation details of real implementation")]
public static void FindServicePoint_Collectible()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string address = "http://" + Guid.NewGuid().ToString("N");
[Fact]
public static void FindServicePoint_ReturnedServicePointMatchesExpectedValues()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string address = "http://" + Guid.NewGuid().ToString("N");
[Fact]
public static void FindServicePoint_PropertiesRoundtrip()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string address = "http://" + Guid.NewGuid().ToString("N");
[Fact]
public static void FindServicePoint_NewServicePointsInheritCurrentValues()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string address1 = "http://" + Guid.NewGuid().ToString("N");
string address2 = "http://" + Guid.NewGuid().ToString("N");
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{DC3BBD1F-37C8-40B2-B248-E12E8D0D146B}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<!-- TODO #13070: Add net463 to the condition after the TFM gets updated to the actual .NET Framework 4.6.3.-->
<Compile Include="TlsSystemDefault.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Tests
{
- public class TlsSystemDefault : RemoteExecutorTestBase
+ public class TlsSystemDefault
{
[Fact]
public void ServicePointManager_SecurityProtocolDefault_Ok()
{
- RemoteInvoke(() => Assert.Equal(SecurityProtocolType.SystemDefault, ServicePointManager.SecurityProtocol)).Dispose();
+ RemoteExecutor.Invoke(() => Assert.Equal(SecurityProtocolType.SystemDefault, ServicePointManager.SecurityProtocol)).Dispose();
}
[Fact]
public void ServicePointManager_CheckAllowedProtocols_SystemDefault_Allowed()
{
- RemoteInvoke(() => ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault).Dispose();
+ RemoteExecutor.Invoke(() => ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault).Dispose();
}
}
}
using System.IO;
using System.IO.Pipes;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Net.Sockets.Tests
{
- public class CreateSocket : RemoteExecutorTestBase
+ public class CreateSocket
{
public static object[][] DualModeSuccessInputs = {
new object[] { SocketType.Stream, ProtocolType.Tcp },
{
// Run the test in another process so as to not have trouble with other tests
// launching child processes that might impact inheritance.
- RemoteInvoke((validateClientString, acceptApiString) =>
+ RemoteExecutor.Invoke((validateClientString, acceptApiString) =>
{
bool validateClient = bool.Parse(validateClientString);
int acceptApi = int.Parse(acceptApiString);
// Create a child process that blocks waiting to receive a signal on the anonymous pipe.
// The whole purpose of the child is to test whether handles are inherited, so we
// keep the child process alive until we're done validating that handles close as expected.
- using (RemoteInvoke(clientPipeHandle =>
+ using (RemoteExecutor.Invoke(clientPipeHandle =>
{
using (var clientPipe = new AnonymousPipeClientStream(PipeDirection.In, clientPipeHandle))
{
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
namespace System.Net.Sockets.Tests
{
- public class LoggingTest : RemoteExecutorTestBase
+ public class LoggingTest
{
public readonly ITestOutputHelper _output;
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "NetEventSource is only part of .NET Core.")]
public void EventSource_EventsRaisedAsExpected()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("Microsoft-System-Net-Sockets", EventLevel.Verbose))
{
Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself
Assert.InRange(events.Count, 1, int.MaxValue);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
[Fact]
public void BlockingRead_DoesntRequireAnotherThreadPoolThread()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Set the max number of worker threads to a low value.
ThreadPool.GetMaxThreads(out int workerThreads, out int completionPortThreads);
// MemberDatas that are generally useful
//
- public abstract class MemberDatas : RemoteExecutorTestBase
+ public abstract class MemberDatas
{
public static readonly object[][] Loopbacks = new[]
{
<PropertyGroup>
<ProjectGuid>{8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
</Compile>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
</Project>
\ No newline at end of file
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Xunit;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Resources;
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
+using Xunit;
[assembly:NeutralResourcesLanguage("en")]
}
}
- public class ResourceManagerTests : RemoteExecutorTestBase
+ public class ResourceManagerTests
{
[Fact]
public static void ExpectMissingManifestResourceException()
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "UWP does not use satellite assemblies in most cases")]
public static void GetString_ExpectEvents()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Events only fire first time. Remote to make sure test runs in a separate process
Remote_ExpectEvents();
<PropertyGroup>
<ProjectGuid>{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}</ProjectGuid>
<RootNamespace>System.Resources.Tests</RootNamespace>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
- <TestRuntime>true</TestRuntime>
<BinPlaceSatelliteAssemblies>true</BinPlaceSatelliteAssemblies>
+ <TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="MissingManifestResourceExceptionTests.cs" />
<SupplementalTestData Include="Resources\bitmap.bmp" />
<SupplementalTestData Include="Resources\icon.ico" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
<!--
MSBuild on .NET Core doesn't support non-string resources. See https://github.com/Microsoft/msbuild/issues/2221
Workaround this for now by invoking the desktop resgen.exe on Windows manually to regenerate the resource files.
<ProjectGuid>{6C314C9B-3D28-4B05-9B4C-B57A00A9B3B9}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants Condition="'$(TargetsUnix)' == 'true'">$(DefineConstants);Unix</DefineConstants>
- <Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\ApplicationIdTests.cs" />
</Compile>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
<ProjectReference Include="AssemblyResolveTestApp\AssemblyResolveTestApp.csproj">
<Project>{ad83807c-8be5-4f27-85df-9793613233e1}</Project>
<Name>AssemblyResolveTestApp</Name>
using System.Reflection;
using System.Resources;
using System.Runtime.ExceptionServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class AppDomainTests : RemoteExecutorTestBase
+ public partial class AppDomainTests : FileCleanupTestBase
{
[Fact]
public void CurrentDomain_Not_Null()
[Fact]
public void TargetFrameworkTest()
{
- string targetFrameworkName = "DUMMY-TFA";
+ string targetFrameworkName = ".NETStandard,Version=v2.0";
if (PlatformDetection.IsInAppContainer)
{
targetFrameworkName = ".NETCore,Version=v5.0";
targetFrameworkName = ".NETCoreApp,Version=v2.0";
}
- RemoteInvoke((_targetFrameworkName) => {
+ RemoteExecutor.Invoke((_targetFrameworkName) => {
Assert.Contains(_targetFrameworkName, AppContext.TargetFrameworkName);
}, targetFrameworkName).Dispose();
}
[Fact]
public void UnhandledException_Add_Remove()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
AppDomain.CurrentDomain.UnhandledException -= new UnhandledExceptionEventHandler(MyHandler);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void UnhandledException_NotCalled_When_Handled()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(NotExpectedToBeCalledHandler);
try
{
{
}
AppDomain.CurrentDomain.UnhandledException -= new UnhandledExceptionEventHandler(NotExpectedToBeCalledHandler);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
System.IO.File.Delete("success.txt");
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.CheckExitCode = false;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
throw new Exception("****This Unhandled Exception is Expected****");
#pragma warning disable 0162
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
#pragma warning restore 0162
}, options).Dispose();
public void Id()
{
// if running directly on some platforms Xunit may be Id = 1
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assert.Equal(1, AppDomain.CurrentDomain.Id);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void FirstChanceException_Add_Remove()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
EventHandler<FirstChanceExceptionEventArgs> handler = (sender, e) =>
{
};
AppDomain.CurrentDomain.FirstChanceException += handler;
AppDomain.CurrentDomain.FirstChanceException -= handler;
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void FirstChanceException_Called()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
bool flag = false;
EventHandler<FirstChanceExceptionEventArgs> handler = (sender, e) =>
{
}
AppDomain.CurrentDomain.FirstChanceException -= handler;
Assert.True(flag, "FirstChanceHandler not called");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void ProcessExit_Add_Remove()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
EventHandler handler = (sender, e) =>
{
};
AppDomain.CurrentDomain.ProcessExit += handler;
AppDomain.CurrentDomain.ProcessExit -= handler;
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
public void ProcessExit_Called()
{
string path = GetTestFilePath();
- RemoteInvoke((pathToFile) =>
+ RemoteExecutor.Invoke((pathToFile) =>
{
EventHandler handler = (sender, e) =>
{
};
AppDomain.CurrentDomain.ProcessExit += handler;
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, path).Dispose();
Assert.True(File.Exists(path));
[ActiveIssue(21680, TargetFrameworkMonikers.UapAot)]
public void ExecuteAssemblyByName()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
string name = "TestApp";
var assembly = Assembly.Load(name);
Assert.Equal(5, AppDomain.CurrentDomain.ExecuteAssemblyByName(assembly.FullName));
AssemblyName assemblyName = assembly.GetName();
assemblyName.CodeBase = null;
Assert.Equal(105, AppDomain.CurrentDomain.ExecuteAssemblyByName(assemblyName, new string[3] { "50", "25", "25" }));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void GetData_SetData()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AssertExtensions.Throws<ArgumentNullException>("name", () => { AppDomain.CurrentDomain.SetData(null, null); });
AppDomain.CurrentDomain.SetData("", null);
Assert.Null(AppDomain.CurrentDomain.GetData(""));
AppDomain.CurrentDomain.SetData("randomkey", 4);
Assert.Equal(4, AppDomain.CurrentDomain.GetData("randomkey"));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void SetData_SameKeyMultipleTimes_ReplacesOldValue()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
string key = Guid.NewGuid().ToString("N");
for (int i = 0; i < 3; i++)
{
Assert.Equal(i.ToString(), AppDomain.CurrentDomain.GetData(key));
}
AppDomain.CurrentDomain.SetData(key, null);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
public void IsDefaultAppDomain()
{
// Xunit may be default app domain if run directly
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(AppDomain.CurrentDomain.IsDefaultAppDomain());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
public void toString()
{
// Workaround issue: UWP culture is process wide
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
[Fact]
public void Unload()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AssertExtensions.Throws<ArgumentNullException>("domain", () => { AppDomain.Unload(null); });
Assert.Throws<CannotUnloadAppDomainException>(() => { AppDomain.Unload(AppDomain.CurrentDomain); });
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void MonitoringIsEnabled()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assert.False(AppDomain.MonitoringIsEnabled);
Assert.Throws<ArgumentException>(() => { AppDomain.MonitoringIsEnabled = false; });
{
Assert.Throws<PlatformNotSupportedException>(() => { AppDomain.MonitoringIsEnabled = true; });
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void AppendPrivatePath()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.AppendPrivatePath("test");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void ClearPrivatePath()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.ClearPrivatePath();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void ClearShadowCopyPath()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.ClearShadowCopyPath();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void SetCachePath()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.SetCachePath("test");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void SetShadowCopyFiles()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.SetShadowCopyFiles();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void SetShadowCopyPath()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AppDomain.CurrentDomain.SetShadowCopyPath("test");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void GetAssemblies()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
Assert.NotNull(assemblies);
Assert.True(assemblies.Length > 0, "There must be assemblies already loaded in the process");
}
}
Assert.True(ctr > 0, "Assembly.LoadFile should cause file to be loaded again");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void AssemblyLoad()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
bool AssemblyLoadFlag = false;
AssemblyLoadEventHandler handler = (sender, args) =>
{
AppDomain.CurrentDomain.AssemblyLoad -= handler;
}
Assert.True(AssemblyLoadFlag);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
{
CopyTestAssemblies();
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
ResolveEventHandler handler = (sender, e) =>
{
return Assembly.LoadFile(Path.Combine(Environment.CurrentDirectory, "AssemblyResolveTestApp.dll"));
Type t = Type.GetType("AssemblyResolveTestApp.Class1, AssemblyResolveTestApp", true);
Assert.NotNull(t);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
{
CopyTestAssemblies();
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assembly a = Assembly.LoadFile(Path.Combine(Environment.CurrentDirectory, "TestAppOutsideOfTPA.exe"));
ResolveEventHandler handler = (sender, e) =>
MethodInfo myMethodInfo = ptype.GetMethod("foo");
object ret = myMethodInfo.Invoke(null, null);
Assert.NotNull(ret);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void AssemblyResolve_IsNotCalledForCoreLibResources()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
bool assemblyResolveHandlerCalled = false;
AppDomain.CurrentDomain.AssemblyResolve +=
CultureInfo.CurrentUICulture = previousUICulture;
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[ActiveIssue(21680, TargetFrameworkMonikers.UapAot)]
public void TypeResolve()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assert.Throws<TypeLoadException>(() => Type.GetType("Program", true));
ResolveEventHandler handler = (sender, args) =>
AppDomain.CurrentDomain.TypeResolve -= handler;
}
Assert.NotNull(t);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapNotUapAot, "In UWP the resources always exist in the resources.pri file even if the assembly is not loaded")]
public void ResourceResolve()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
ResourceManager res = new ResourceManager(typeof(FxResources.TestApp.SR));
Assert.Throws<MissingManifestResourceException>(() => res.GetString("Message"));
AppDomain.CurrentDomain.ResourceResolve -= handler;
}
Assert.Equal(s, "Happy Halloween");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void SetThreadPrincipal()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assert.Throws<ArgumentNullException>(() => { AppDomain.CurrentDomain.SetThreadPrincipal(null); });
var identity = new System.Security.Principal.GenericIdentity("NewUser");
var principal = new System.Security.Principal.GenericPrincipal(identity, null);
AppDomain.CurrentDomain.SetThreadPrincipal(principal);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Runtime.Remoting;
using System.Security;
using System.Security.Permissions;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
[Fact]
public void GetSetupInformation()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assert.Equal(AppContext.BaseDirectory, AppDomain.CurrentDomain.SetupInformation.ApplicationBase);
Assert.Equal(AppContext.TargetFrameworkName, AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void GetPermissionSet()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assert.Equal(new PermissionSet(PermissionState.Unrestricted), AppDomain.CurrentDomain.PermissionSet);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.IO;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public class Environment_Exit : RemoteExecutorTestBase
+ public class Environment_Exit
{
public static object[][] ExitCodeValues = new object[][]
{
[MemberData(nameof(ExitCodeValues))]
public static void CheckExitCode(int expectedExitCode)
{
- RemoteInvoke(s => int.Parse(s), expectedExitCode.ToString(), new RemoteInvokeOptions { ExpectedExitCode = expectedExitCode }).Dispose();
+ RemoteExecutor.Invoke(s => int.Parse(s), expectedExitCode.ToString(), new RemoteInvokeOptions { ExpectedExitCode = expectedExitCode }).Dispose();
}
[Theory]
}
else
{
- psi.FileName = HostRunner;
+ psi.FileName = RemoteExecutor.HostRunner;
psi.Arguments = $"{AppName} {expectedExitCode} {mode}";
}
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
[ActiveIssue("https://github.com/dotnet/corefx/issues/21413", TargetFrameworkMonikers.Uap)]
- public class GetCommandLineArgs : RemoteExecutorTestBase
+ public class GetCommandLineArgs
{
public static IEnumerable<object[]> GetCommandLineArgs_TestData()
{
switch (args.Length)
{
case 1:
- RemoteInvoke((arg) => CheckCommandLineArgs(new string[] { arg }), args[0]).Dispose();
+ RemoteExecutor.Invoke((arg) => CheckCommandLineArgs(new string[] { arg }), args[0]).Dispose();
break;
case 2:
- RemoteInvoke((arg1, arg2) => CheckCommandLineArgs(new string[] { arg1, arg2 }), args[0], args[1]).Dispose();
+ RemoteExecutor.Invoke((arg1, arg2) => CheckCommandLineArgs(new string[] { arg1, arg2 }), args[0], args[1]).Dispose();
break;
case 3:
- RemoteInvoke((arg1, arg2, arg3) => CheckCommandLineArgs(new string[] { arg1, arg2, arg3 }), args[0], args[1], args[2]).Dispose();
+ RemoteExecutor.Invoke((arg1, arg2, arg3) => CheckCommandLineArgs(new string[] { arg1, arg2, arg3 }), args[0], args[1], args[2]).Dispose();
break;
default:
string[] cmdLineArgs = Environment.GetCommandLineArgs();
Assert.InRange(cmdLineArgs.Length, 5, int.MaxValue); /*AppName, AssemblyName, TypeName, MethodName, ExceptionFile */
- Assert.Contains(TestConsoleApp, cmdLineArgs[0]); /*The host returns the fullName*/
+ Assert.Contains(RemoteExecutor.Path, cmdLineArgs[0]); /*The host returns the fullName*/
Type t = typeof(GetCommandLineArgs);
MethodInfo mi = t.GetMethod("CheckCommandLineArgs");
Assert.Equal(args[i], cmdLineArgs[i + 5]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}
}
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public class SetEnvironmentVariable : RemoteExecutorTestBase
+ public class SetEnvironmentVariable
{
private const string NullString = "\u0000";
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix to allow arbitrary length environment variables.")]
public void EnvironmentVariableTooLarge_Throws()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string longVar;
string val = "Test_SetEnvironmentVariable_EnvironmentVariableTooLarge_Throws";
catch (OutOfMemoryException)
{
// not enough memory to allocate a string at test time
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
try
{
// expected
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix to allow arbitrary length environment variables.")]
public void EnvironmentVariableValueTooLarge_Throws()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string var = "Test_SetEnvironmentVariable_EnvironmentVariableValueTooLarge_Throws";
string longVal;
catch (OutOfMemoryException)
{
// not enough memory to allocate a string at test time
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
try
{
// expected
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
-using Xunit;
+using Microsoft.DotNet.RemoteExecutor;
using Microsoft.DotNet.XUnitExtensions;
+using Xunit;
namespace System.Tests
{
- public class EnvironmentTests : RemoteExecutorTestBase
+ public class EnvironmentTests : FileCleanupTestBase
{
[Fact]
public void CurrentDirectory_Null_Path_Throws_ArgumentNullException()
[Fact]
public void CurrentDirectory_SetToValidOtherDirectory()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Environment.CurrentDirectory = TestDirectory;
Assert.Equal(Directory.GetCurrentDirectory(), Environment.CurrentDirectory);
Assert.Equal(TestDirectory, Directory.GetCurrentDirectory());
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[ActiveIssue("21404", TargetFrameworkMonikers.Uap)]
public void FailFast_ExpectFailureExitCode()
{
- using (RemoteInvokeHandle handle = RemoteInvoke(() => { Environment.FailFast("message"); return SuccessExitCode; }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(() => { Environment.FailFast("message"); return RemoteExecutor.SuccessExitCode; }))
{
Process p = handle.Process;
handle.Process = null;
p.WaitForExit();
- Assert.NotEqual(SuccessExitCode, p.ExitCode);
+ Assert.NotEqual(RemoteExecutor.SuccessExitCode, p.ExitCode);
}
- using (RemoteInvokeHandle handle = RemoteInvoke(() => { Environment.FailFast("message", new Exception("uh oh")); return SuccessExitCode; }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(() => { Environment.FailFast("message", new Exception("uh oh")); return RemoteExecutor.SuccessExitCode; }))
{
Process p = handle.Process;
handle.Process = null;
p.WaitForExit();
- Assert.NotEqual(SuccessExitCode, p.ExitCode);
+ Assert.NotEqual(RemoteExecutor.SuccessExitCode, p.ExitCode);
}
}
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
- using (RemoteInvokeHandle handle = RemoteInvoke(
- () => { Environment.FailFast("message", new ArgumentException("bad arg")); return SuccessExitCode; },
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(
+ () => { Environment.FailFast("message", new ArgumentException("bad arg")); return RemoteExecutor.SuccessExitCode; },
new RemoteInvokeOptions { StartInfo = psi }))
{
Process p = handle.Process;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
- using (RemoteInvokeHandle handle = RemoteInvoke(
- () => { Environment.FailFast("message", new StackOverflowException("SO exception")); return SuccessExitCode; },
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(
+ () => { Environment.FailFast("message", new StackOverflowException("SO exception")); return RemoteExecutor.SuccessExitCode; },
new RemoteInvokeOptions { StartInfo = psi }))
{
Process p = handle.Process;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
- using (RemoteInvokeHandle handle = RemoteInvoke(
- () => { Environment.FailFast("message", new ArgumentException("first exception", new NullReferenceException("inner exception"))); return SuccessExitCode; },
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(
+ () => { Environment.FailFast("message", new ArgumentException("first exception", new NullReferenceException("inner exception"))); return RemoteExecutor.SuccessExitCode; },
new RemoteInvokeOptions { StartInfo = psi }))
{
Process p = handle.Process;
namespace System.IO.Tests
{
- public partial class PathTestsBase : RemoteExecutorTestBase
+ public partial class PathTestsBase
{
protected static string Sep = Path.DirectorySeparatorChar.ToString();
protected static string AltSep = Path.AltDirectorySeparatorChar.ToString();
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
[Fact]
public void GetTempPath_SetEnvVar_Unix()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
foreach (string[] tempPath in GetTempPath_SetEnvVar_Data())
{
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.IO.Tests
[Fact]
public void GetTempPath_SetEnvVar()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
foreach (string[] tempPath in GetTempPath_SetEnvVar_Data())
{
using System.Diagnostics;
using System.IO;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
namespace System.Runtime.Tests
{
- public class ProfileOptimizationTest : RemoteExecutorTestBase
+ public class ProfileOptimizationTest : FileCleanupTestBase
{
// Active issue https://github.com/dotnet/corefx/issues/31792
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotRedHatFamily6))]
{
string profileFile = GetTestFileName();
- RemoteInvoke((_profileFile) =>
+ RemoteExecutor.Invoke((_profileFile) =>
{
// tracking down why test sporadically fails on RedHat69
// write to the file first to check permissions
using System.Diagnostics;
using System.IO;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public class UnloadingAndProcessExitTests : RemoteExecutorTestBase
+ public class UnloadingAndProcessExitTests : FileCleanupTestBase
{
[ActiveIssue("https://github.com/dotnet/corefx/issues/23307", TargetFrameworkMonikers.Uap)]
[Fact]
System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += acl => OnUnloading(1);
File.AppendAllText(f, "h");
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
};
- using (var remote = RemoteInvoke(otherProcess, fileName))
+ using (var remote = RemoteExecutor.Invoke(otherProcess, fileName))
{
}
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Numerics.Tests
{
- public partial class ToStringTest : RemoteExecutorTestBase
+ public partial class ToStringTest
{
private static bool s_noZeroOut = true;
[Fact]
public static void RunRegionSpecificStandardFormatToStringTests()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo[] cultures = new CultureInfo[] { new CultureInfo("en-US"), new CultureInfo("en-GB"), new CultureInfo("fr-CA"),
new CultureInfo("ar-SA"), new CultureInfo("de-DE"), new CultureInfo("he-IL"),
using System.Diagnostics;
using System.Globalization;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Numerics.Tests
{
- public partial class parseTest : RemoteExecutorTestBase
+ public partial class parseTest
{
private readonly static int s_samples = 10;
private readonly static Random s_random = new Random(100);
[OuterLoop]
public static void RunParseToStringTests(CultureInfo culture)
{
- RemoteInvoke((cultureName) =>
+ RemoteExecutor.Invoke((cultureName) =>
{
byte[] tempByteArray1 = new byte[0];
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{28AE24F8-BEF4-4358-B612-ADD9D587C8E1}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="ComplexTests.cs" />
<Compile Include="ComplexTests.netcoreapp.cs" Condition="'$(TargetGroup)' == 'netcoreapp'" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Runtime.Serialization.Formatters.Tests
{
- public partial class BinaryFormatterTests : RemoteExecutorTestBase
+ public partial class BinaryFormatterTests : FileCleanupTestBase
{
// On 32-bit we can't test these high inputs as they cause OutOfMemoryExceptions.
[ConditionalTheory(typeof(Environment), nameof(Environment.Is64BitProcess))]
}
// In another process, deserialize from that file and serialize to another
- RemoteInvoke((remoteInput, remoteOutput) =>
+ RemoteExecutor.Invoke((remoteInput, remoteOutput) =>
{
Assert.False(File.Exists(remoteOutput));
using (FileStream input = File.OpenRead(remoteInput))
{
var b = new BinaryFormatter();
b.Serialize(output, b.Deserialize(input));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
}, outputPath, inputPath).Dispose();
<PropertyGroup>
<ProjectGuid>{13CE5E71-D373-4EA6-B3CB-166FF089A42A}</ProjectGuid>
<SkipIncludeNewtonsoftJson>true</SkipIncludeNewtonsoftJson>
- <Configurations>netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netcoreapp-Debug;netcoreapp-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netcoreapp-Debug;netcoreapp-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="BinaryFormatterTestData.cs" />
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<Reference Include="System.Text.Json" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
<ProjectGuid>{B1BF7CE0-CAB5-4FA2-A39C-450B05D5DB1C}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1718</NoWarn>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release;uapaot-Debug;uapaot-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release;uapaot-Debug;uapaot-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\EnumTypes.cs">
<Compile Include="$(CommonTestPath)\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs">
<Link>Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="TestLoadAssembly\TestLoadAssembly.csproj">
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Remoting;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class ActivatorTests : RemoteExecutorTestBase
+ public partial class ActivatorTests
{
[Fact]
public void CreateInstance_NonPublicValueTypeWithPrivateDefaultConstructor_Success()
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "Assembly.LoadFile is not supported in AppX.")]
public static void CreateInstanceAssemblyResolve()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs args) => Assembly.LoadFile(Path.Combine(Directory.GetCurrentDirectory(), "TestLoadAssembly.dll"));
ObjectHandle oh = Activator.CreateInstance(",,,,", "PublicClassSample");
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.ComponentModel.Tests
{
- public partial class DefaultValueAttributeTests : RemoteExecutorTestBase
+ public partial class DefaultValueAttributeTests
{
[Fact]
public static void Ctor()
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void Ctor_TypeDescriptorNotFound_ExceptionFallback(Type type, bool returnNull, string stringToConvert, int expectedValue)
{
- RemoteInvoke((innerType, innerReturnNull, innerStringToConvert, innerExpectedValue) =>
+ RemoteExecutor.Invoke((innerType, innerReturnNull, innerStringToConvert, innerExpectedValue) =>
{
FieldInfo s_convertFromInvariantString = typeof(DefaultValueAttribute).GetField("s_convertFromInvariantString", BindingFlags.GetField | Reflection.BindingFlags.NonPublic | Reflection.BindingFlags.Static);
Assert.NotNull(s_convertFromInvariantString);
using System.Globalization;
using System.Linq;
using System.Numerics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class DecimalTests : RemoteExecutorTestBase
+ public partial class DecimalTests
{
[Fact]
public static void MaxValue()
[Fact]
public static void Test_ToString()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
{
ToString((decimal)testdata[0], (string)testdata[1], (IFormatProvider)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections.Generic;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
[Fact]
public static void TryFormat()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System.Diagnostics;
using System.Globalization;
using System.Runtime.CompilerServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class DoubleTests : RemoteExecutorTestBase
+ public partial class DoubleTests
{
// NOTE: Consider duplicating any tests added here in SingleTests.cs
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public static void Test_ToString_NetFramework()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
{
ToString((double)testdata[0], (string)testdata[1], (IFormatProvider)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public static void Test_ToString_NotNetFramework()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
{
ToString((double)testdata[0], (string)testdata[1], (IFormatProvider)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
[Fact]
public static void TryFormat()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Runtime.InteropServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public class ExitCodeTests : RemoteExecutorTestBase
+ public class ExitCodeTests
{
private const int SIGTERM = 15;
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.StartInfo.RedirectStandardOutput = true;
- using (RemoteInvokeHandle remoteExecution = RemoteInvoke(action, exitCodeOnSigterm?.ToString() ?? string.Empty, options))
+ using (RemoteInvokeHandle remoteExecution = RemoteExecutor.Invoke(action, exitCodeOnSigterm?.ToString() ?? string.Empty, options))
{
Process process = remoteExecution.Process;
Assert.Equal(0, rv);
// Process exits in a timely manner
- bool exited = process.WaitForExit(FailWaitTimeoutMilliseconds);
+ bool exited = process.WaitForExit(RemoteExecutor.FailWaitTimeoutMilliseconds);
Assert.True(exited);
// Check exit code
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class FormattableStringTests : RemoteExecutorTestBase
+ public partial class FormattableStringTests
{
[Fact]
public static void Invariant_Null_ThrowsArgumentNullException()
[Fact]
public static void Invariant_DutchCulture_FormatsDoubleBasedOnInvariantCulture()
{
- RemoteInvoke(
+ RemoteExecutor.Invoke(
() =>
{
CultureInfo.CurrentCulture = new CultureInfo("nl"); // would be 123,456 in Dutch
string actual = FormattableString.Invariant($"Invariant culture is used {d}");
Assert.Equal(expected, actual);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IFormattableToString_UsesSuppliedFormatProvider()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("nl"); // would be 123,456 in Dutch
double d = 123.456;
string actual = ((IFormattable)((FormattableString)$"Invariant culture is used {d}")).ToString(null, CultureInfo.InvariantCulture);
Assert.Equal(expected, actual);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class FormattableStringTests : RemoteExecutorTestBase
+ public partial class FormattableStringTests
{
[Fact]
public static void CurrentCulture_ImplicityAndExplicitMethodsReturnSameString()
[Fact]
public static void CurrentCulture_DutchCulture_FormatsDoubleBasedOnCurrentCulture()
{
- RemoteInvoke(
- () =>
- {
- var dutchCulture = new CultureInfo("nl");
- CultureInfo.CurrentCulture = dutchCulture;
- double d = 123.456;
- string expected = string.Format(dutchCulture, "Dutch decimal separator is comma {0}", d);
- string actual = FormattableString.CurrentCulture($"Dutch decimal separator is comma {d}");
- Assert.Equal(expected, actual);
+ RemoteExecutor.Invoke(() =>
+ {
+ var dutchCulture = new CultureInfo("nl");
+ CultureInfo.CurrentCulture = dutchCulture;
+ double d = 123.456;
+ string expected = string.Format(dutchCulture, "Dutch decimal separator is comma {0}", d);
+ string actual = FormattableString.CurrentCulture($"Dutch decimal separator is comma {d}");
+ Assert.Equal(expected, actual);
- return SuccessExitCode;
- }).Dispose();
+ return RemoteExecutor.SuccessExitCode;
+ }).Dispose();
}
}
}
using System.Diagnostics;
using System.Threading;
using System.Runtime;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
public static void LatencyRoundtrips_LowLatency(GCLatencyMode value) => LatencyRoundtrips(value);
}
- public class GCExtendedTests : RemoteExecutorTestBase
- {
+ public class GCExtendedTests {
private const int TimeoutMilliseconds = 10 * 30 * 1000; //if full GC is triggered it may take a while
/// <summary>
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Func<WeakReference> getweakref = delegate ()
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true);
Assert.Throws<ArgumentNullException>(() => GC.GetGeneration(weakref));
#endif
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke((approachString, timeoutString) =>
+ RemoteExecutor.Invoke((approachString, timeoutString) =>
{
TestWait(bool.Parse(approachString), int.Parse(timeoutString));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, approach.ToString(), timeout.ToString(), options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(1024));
// at this point, the GC should have booted us out of the no GC region
// since we allocated too much.
Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget));
Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(NoGCRequestedBudget));
Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget, true));
Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(NoGCRequestedBudget, true));
Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget, NoGCRequestedBudget));
Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(NoGCRequestedBudget, NoGCRequestedBudget));
Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget, NoGCRequestedBudget, true));
Assert.Throws<InvalidOperationException>(() => GC.TryStartNoGCRegion(NoGCRequestedBudget, NoGCRequestedBudget, true));
Assert.Throws<InvalidOperationException>(() => GC.EndNoGCRegion());
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// The budget for this test is 4mb, because the act of throwing an exception with a message
// contained in a resource file has to potential to allocate a lot on CoreRT. In particular, when compiling
GC.EndNoGCRegion();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget));
Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
GC.EndNoGCRegion();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget, true));
Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
GC.EndNoGCRegion();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget, NoGCRequestedBudget));
Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
GC.EndNoGCRegion();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.True(GC.TryStartNoGCRegion(NoGCRequestedBudget, NoGCRequestedBudget, true));
Assert.Equal(GCSettings.LatencyMode, GCLatencyMode.NoGCRegion);
GC.EndNoGCRegion();
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(sizeString =>
+ RemoteExecutor.Invoke(sizeString =>
{
AssertExtensions.Throws<ArgumentOutOfRangeException>("totalSize", () => GC.TryStartNoGCRegion(long.Parse(sizeString)));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, size.ToString(), options).Dispose();
}
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.TimeOut = TimeoutMilliseconds;
- RemoteInvoke(sizeString =>
+ RemoteExecutor.Invoke(sizeString =>
{
AssertExtensions.Throws<ArgumentOutOfRangeException>("lohSize", () => GC.TryStartNoGCRegion(1024, long.Parse(sizeString)));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, size.ToString(), options).Dispose();
}
using System.IO;
using System.Linq;
using System.Runtime.Loader;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Reflection.Tests
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "AssemblyLoadContext not available in NetFx")]
- public class IsCollectibleTests : RemoteExecutorTestBase
+ public class IsCollectibleTests
{
static public string asmNameString = "TestCollectibleAssembly";
static public string asmPath = Path.Combine(Environment.CurrentDirectory, "TestCollectibleAssembly.dll");
[Fact]
public void Assembly_IsCollectibleFalse_WhenUsingAssemblyLoad()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
Assembly asm = Assembly.LoadFrom(asmPath);
Assert.NotNull(asm);
Assert.Contains(asm, alc.Assemblies);
#endif
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void Assembly_IsCollectibleFalse_WhenUsingAssemblyLoadContext()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AssemblyLoadContext alc = new AssemblyLoadContext("Assembly_IsCollectibleFalse_WhenUsingAssemblyLoadContext");
Assembly asm = alc.LoadFromAssemblyPath(asmPath);
Assert.Contains(asm, alc.Assemblies);
#endif
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void Assembly_IsCollectibleTrue_WhenUsingTestAssemblyLoadContext()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
AssemblyLoadContext alc = new TestAssemblyLoadContext();
Assembly asm = alc.LoadFromAssemblyPath(asmPath);
Assert.Contains(asm, alc.Assemblies);
#endif
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[InlineData("MyStaticGenericMethod")]
public void MemberInfo_IsCollectibleFalse_WhenUsingAssemblyLoad(string memberName)
{
- RemoteInvoke((marshalledName) =>
+ RemoteExecutor.Invoke((marshalledName) =>
{
Type t1 = Type.GetType(
"TestCollectibleAssembly.MyTestClass, TestCollectibleAssembly, Version=1.0.0.0",
Assert.False(member.IsCollectible);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, memberName).Dispose();
}
[InlineData("MyGenericMethod")]
public void MemberInfoGeneric_IsCollectibleFalse_WhenUsingAssemblyLoad(string memberName)
{
- RemoteInvoke((marshalledName) =>
+ RemoteExecutor.Invoke((marshalledName) =>
{
Type t1 = Type.GetType(
"TestCollectibleAssembly.MyGenericTestClass`1[System.Int32], TestCollectibleAssembly, Version=1.0.0.0",
Assert.False(member.IsCollectible);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, memberName).Dispose();
}
[InlineData("MyStaticGenericMethod")]
public void MemberInfo_IsCollectibleTrue_WhenUsingAssemblyLoadContext(string memberName)
{
- RemoteInvoke((marshalledName) =>
+ RemoteExecutor.Invoke((marshalledName) =>
{
AssemblyLoadContext alc = new TestAssemblyLoadContext();
Assert.True(member.IsCollectible);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, memberName).Dispose();
}
[InlineData("MyGenericMethod")]
public void MemberInfoGeneric_IsCollectibleTrue_WhenUsingAssemblyLoadContext(string memberName)
{
- RemoteInvoke((marshalledName) =>
+ RemoteExecutor.Invoke((marshalledName) =>
{
AssemblyLoadContext alc = new TestAssemblyLoadContext();
Assert.True(member.IsCollectible);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, memberName).Dispose();
}
[Fact]
public void GenericWithCollectibleTypeParameter_IsCollectibleTrue_WhenUsingAssemblyLoadContext()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AssemblyLoadContext alc = new TestAssemblyLoadContext();
Assert.True(t1.IsCollectible);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Runtime.ExceptionServices.Tests
{
- public class HandleProcessCorruptedStateExceptionsTests : RemoteExecutorTestBase
+ public class HandleProcessCorruptedStateExceptionsTests
{
[DllImport("kernel32.dll")]
static extern void RaiseException(uint dwExceptionCode, uint dwExceptionFlags, uint nNumberOfArguments, IntPtr lpArguments);
// We expect the launched process to crash; don't let it write the resulting AV message to the console.
var psi = new ProcessStartInfo() { RedirectStandardError = true, RedirectStandardOutput = true };
- using (RemoteInvokeHandle handle = RemoteInvoke(() => { CauseAVInNative(); return SuccessExitCode; }, new RemoteInvokeOptions { CheckExitCode = false, StartInfo = psi }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(() => { CauseAVInNative(); return RemoteExecutor.SuccessExitCode; }, new RemoteInvokeOptions { CheckExitCode = false, StartInfo = psi }))
{
Process p = handle.Process;
p.WaitForExit();
if (PlatformDetection.IsFullFramework)
- Assert.Equal(SuccessExitCode, p.ExitCode);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, p.ExitCode);
else
- Assert.NotEqual(SuccessExitCode, p.ExitCode);
+ Assert.NotEqual(RemoteExecutor.SuccessExitCode, p.ExitCode);
}
}
}
using System.Diagnostics;
using System.Globalization;
using System.Runtime.CompilerServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class SingleTests : RemoteExecutorTestBase
+ public partial class SingleTests
{
// NOTE: Consider duplicating any tests added here in DoubleTests.cs
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public static void Test_ToString_NetFramework()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
{
ToString((float)testdata[0], (string)testdata[1], (IFormatProvider)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public static void Test_ToString_NotNetFramework()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
{
ToString((float)testdata[0], (string)testdata[1], (IFormatProvider)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
[Fact]
public static void TryFormat()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
{
- public partial class StringGetHashCodeTests : RemoteExecutorTestBase
+ public partial class StringGetHashCodeTests
{
/// <summary>
/// Ensure that hash codes are randomized by getting the hash in two processes
[MemberData(nameof(GetHashCode_TestData))]
public void GetHashCodeWithStringComparer_UseSameStringInTwoProcesses_ReturnsDifferentHashCodes(int getHashCodeIndex)
{
- Func<string, string, int> method = (parentHash, i) => int.Parse(parentHash) != s_GetHashCodes[int.Parse(i)]() ? SuccessExitCode : -1;
+ Func<string, string, int> method = (parentHash, i) => int.Parse(parentHash) != s_GetHashCodes[int.Parse(i)]() ? RemoteExecutor.SuccessExitCode : -1;
int parentHashCode = s_GetHashCodes[getHashCodeIndex]();
int exitCode, retry = 0;
do
{
// very small chance the child and parent hashcode are the same. To further reduce chance of collision we try up to 3 times
- using (RemoteInvokeHandle handle = RemoteInvoke(method, parentHashCode.ToString(), getHashCodeIndex.ToString(), new RemoteInvokeOptions { CheckExitCode = false }))
+ using (RemoteInvokeHandle handle = RemoteExecutor.Invoke(method, parentHashCode.ToString(), getHashCodeIndex.ToString(), new RemoteInvokeOptions { CheckExitCode = false }))
{
exitCode = handle.ExitCode;
retry++;
}
- } while (exitCode != SuccessExitCode && retry < 3);
- Assert.Equal(SuccessExitCode, exitCode);
+ } while (exitCode != RemoteExecutor.SuccessExitCode && retry < 3);
+ Assert.Equal(RemoteExecutor.SuccessExitCode, exitCode);
}
public static IEnumerable<object[]> GetHashCode_TestData()
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Tests
public static void Contains_StringComparison_TurkishI()
{
string str = "\u0069\u0130";
- RemoteInvoke((source) =>
+ RemoteExecutor.Invoke((source) =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.True(source.Contains("\u0069\u0069", StringComparison.CurrentCultureIgnoreCase));
Assert.True(source.AsSpan().Contains("\u0069\u0069", StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, str).Dispose();
- RemoteInvoke((source) =>
+ RemoteExecutor.Invoke((source) =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.False(source.Contains("\u0069\u0069", StringComparison.CurrentCultureIgnoreCase));
Assert.False(source.AsSpan().Contains("\u0069\u0069", StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, str).Dispose();
}
{
string src = "\u0069\u0130";
- RemoteInvoke((source) =>
+ RemoteExecutor.Invoke((source) =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.Equal("\u0069a", source.Replace("\u0130", "a", StringComparison.CurrentCulture));
Assert.Equal("aa", source.Replace("\u0130", "a", StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, src).Dispose();
- RemoteInvoke((source) =>
+ RemoteExecutor.Invoke((source) =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.Equal("\u0069a", source.Replace("\u0130", "a", StringComparison.CurrentCulture));
Assert.Equal("\u0069a", source.Replace("\u0130", "a", StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, src).Dispose();
}
[Fact]
public static void IndexOf_TurkishI_TurkishCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");
Assert.Equal(10, span.IndexOf(new char[] { value }, StringComparison.Ordinal));
Assert.Equal(10, span.IndexOf(new char[] { value }, StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_TurkishI_InvariantCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Assert.Equal(10, s.IndexOf(value, StringComparison.CurrentCulture));
Assert.Equal(10, s.IndexOf(value, StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_TurkishI_EnglishUSCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Assert.Equal(10, s.IndexOf(value, StringComparison.CurrentCulture));
Assert.Equal(10, s.IndexOf(value, StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_EquivalentDiacritics_EnglishUSCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Exhibit a\u0300\u00C0";
char value = '\u00C0';
Assert.Equal(10, s.IndexOf(value, StringComparison.Ordinal));
Assert.Equal(10, s.IndexOf(value, StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_EquivalentDiacritics_InvariantCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Exhibit a\u0300\u00C0";
char value = '\u00C0';
Assert.Equal(10, s.IndexOf(value, StringComparison.CurrentCulture));
Assert.Equal(8, s.IndexOf(value, StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_CyrillicE_EnglishUSCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Foo\u0400Bar";
char value = '\u0400';
Assert.Equal(3, s.IndexOf(value, StringComparison.Ordinal));
Assert.Equal(3, s.IndexOf(value, StringComparison.OrdinalIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void IndexOf_CyrillicE_InvariantCulture_Char()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string s = "Foo\u0400Bar";
char value = '\u0400';
Assert.Equal(3, s.IndexOf(value, StringComparison.CurrentCulture));
Assert.Equal(3, s.IndexOf(value, StringComparison.CurrentCultureIgnoreCase));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Globalization;
using System.Tests;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.Tests
{
- public partial class StringBuilderTests : RemoteExecutorTestBase
+ public partial class StringBuilderTests
{
private static readonly string s_chunkSplitSource = new string('a', 30);
private static readonly string s_noCapacityParamName = PlatformDetection.IsFullFramework ? "requiredLength" : "valueCount";
[Fact]
public static void Test_Append_Decimal()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
{
Append_Decimal((string)testdata[0], (double)testdata[1], (string)testdata[2]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void Test_Append_Double()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
foreach (var testdata in Append_Double_TestData())
{
Append_Double((string)testdata[0], (double)testdata[1], (string)testdata[2]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void Test_Append_Float()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
foreach (var testdata in Append_Float_TestData())
{
Append_Float((string)testdata[0], (float)testdata[1], (string)testdata[2]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void Test_Insert_Float()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
foreach (var testdata in Insert_Float_TestData())
{
Insert_Float((string)testdata[0], (int)testdata[1], (float)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void Test_Insert_Double()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
foreach (var testdata in Insert_Double_TestData())
{
Insert_Double((string)testdata[0], (int)testdata[1], (double)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void Test_Insert_Decimal()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
foreach (var testdata in Test_Insert_Decimal_TestData())
{
Insert_Decimal((string)testdata[0], (int)testdata[1], (double)testdata[2], (string)testdata[3]);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
namespace System.Text.Tests
{
- public partial class StringBuilderTests : RemoteExecutorTestBase
+ public partial class StringBuilderTests
{
[Fact]
public static void AppendJoin_NullValues_ThrowsArgumentNullException()
using System.Diagnostics;
using System.IO;
using System.Reflection;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
public class Outside
}
}
- public class TypeTestsExtended : RemoteExecutorTestBase
- {
+ public class TypeTestsExtended {
public class ContextBoundClass : ContextBoundObject
{
public string Value = "The Value property.";
public void GetTypeByName()
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
string test1 = testtype;
Type t1 = Type.GetType(test1,
Assert.NotNull(t2);
Assert.Equal(t1, t2);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
[InlineData("")]
public void GetTypeByName_NoSuchType_ThrowsTypeLoadException(string typeName)
{
- RemoteInvoke(marshalledTypeName =>
+ RemoteExecutor.Invoke(marshalledTypeName =>
{
Assert.Throws<TypeLoadException>(() => Type.GetType(marshalledTypeName, assemblyloader, typeloader, true));
Assert.Null(Type.GetType(marshalledTypeName, assemblyloader, typeloader, false));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, typeName).Dispose();
}
public void GetTypeByNameCaseSensitiveTypeloadFailure()
{
RemoteInvokeOptions options = new RemoteInvokeOptions();
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
//Type load failure due to case sensitive search of type Ptogram
string test3 = "System.Collections.Generic.Dictionary`2[[Program, TestLoadAssembly], [program, TestLoadAssembly]]";
Assert.Null(t2);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, options).Dispose();
}
<DefineConstants Condition="'$(HaveCertificateCreation)'!='true'">$(DefineConstants);NO_EPHEMERALKEYSET_AVAILABLE</DefineConstants>
<DefineConstants Condition="'$(TargetGroup)'=='netcoreapp' OR '$(TargetGroup)'=='uap'">$(DefineConstants);HAVE_THUMBPRINT_OVERLOADS</DefineConstants>
<DefineConstants Condition="'$(TargetsUnix)' == 'true'">$(DefineConstants);Unix</DefineConstants>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-OSX-Debug;netcoreapp-OSX-Release;netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
</Compile>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
<SupplementalTestData Include="$(PackagesDir)system.security.cryptography.x509certificates.testdata\1.0.2-prerelease\content\**\*.*" />
</ItemGroup>
</Project>
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Security.Cryptography.X509Certificates.Tests
{
- public class X509StoreTests : RemoteExecutorTestBase
+ public class X509StoreTests : FileCleanupTestBase
{
[Fact]
public static void OpenMyStore()
var psi = new ProcessStartInfo();
psi.Environment.Add("SSL_CERT_DIR", sslCertDir);
psi.Environment.Add("SSL_CERT_FILE", "/nonexisting");
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
{
// Check nr of certificates in store.
Assert.Equal(2, store.Certificates.Count);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}, new RemoteInvokeOptions { StartInfo = psi }).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{6C36F3AC-54A1-4021-9F5D-CDEFF7347277}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
</PropertyGroup>
<ItemGroup>
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.Tests
public override int MaxCharCount => 2;
}
- public class EncoderFallbackBufferHelperTest : RemoteExecutorTestBase
+ public class EncoderFallbackBufferHelperTest
{
[Fact]
public void Test_EncoderFallbackBufferHelper_ValidateFallbackForDataRoundTrips()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Add the code page provider.
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{835AD07B-7C9A-406F-B16F-59B3B0D017A4}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="EncoderFallbackBufferHelper.cs" />
<Compile Include="EncodingCodePages.cs" />
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
using System.Diagnostics;
using System.Globalization;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.Tests
{
- public class EncodingGetEncodingTest : RemoteExecutorTestBase
+ public class EncodingGetEncodingTest
{
[Fact]
public void GetEncoding_String_Invalid()
public void GetEncoding_EncodingName()
{
// Workaround issue: UWP culture is process wide
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
<PropertyGroup>
<ProjectGuid>{3BB28F2F-51DF-49A3-A0BF-E1C5C0D7E3E0}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="ASCIIEncoding\ASCIIEncodingEncode.cs" />
<Compile Include="Decoder\Decoder.cs" />
<Compile Include="Encoder\Encoder.cs" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.RegularExpressions.Tests
{
- public class RegexCacheTests : RemoteExecutorTestBase
+ public class RegexCacheTests
{
[Theory]
[InlineData(0)]
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "reflection blocked")]
public void Ctor_Cache_Second_drops_first()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Regex.CacheSize = 1;
Assert.True(Regex.IsMatch("1", "1"));
Assert.True(Regex.IsMatch("2", "2")); // previous removed from cache
Assert.True(GetCachedItemsNum() == 1);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "reflection blocked")]
public void Ctor_Cache_Shrink_cache()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Regex.CacheSize = 2;
Assert.True(Regex.IsMatch("1", "1"));
Assert.True(GetCachedItemsNum() == 1);
Regex.CacheSize = 0; // clear
Assert.True(GetCachedItemsNum() == 0);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "reflection blocked")]
public void Ctor_Cache_Promote_entries()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Regex.CacheSize = 3;
Assert.True(Regex.IsMatch("1", "1"));
Assert.True(GetCachedItemsNum() == 3);
Regex.CacheSize = 1; // only 1 stays
Assert.True(GetCachedItemsNum() == 1);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "reflection blocked")]
public void Ctor_Cache_Uses_culture_and_options()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Regex.CacheSize = 0;
Regex.CacheSize = 3;
CultureInfo.CurrentCulture = CultureInfo.CurrentCulture.Equals(CultureInfo.GetCultureInfo("de-DE")) ? CultureInfo.InvariantCulture : CultureInfo.GetCultureInfo("de-DE");
Assert.True(Regex.IsMatch("1", "1", RegexOptions.Multiline));
Assert.True(GetCachedItemsNum() == 3);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
public void Ctor_Cache_Uses_dictionary_linked_list_switch_does_not_throw()
{
// assume the limit is less than the cache size so we cross it two times:
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
int original = Regex.CacheSize;
Regex.CacheSize = 0;
Assert.True(GetCachedItemsNum() == Regex.CacheSize);
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.RegularExpressions.Tests
{
- public class RegexConstructorTests : RemoteExecutorTestBase
+ public class RegexConstructorTests
{
public static IEnumerable<object[]> Ctor_TestData()
{
[Fact]
public static void StaticCtor_InvalidTimeoutObject_ExceptionThrown()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.SetData(RegexHelpers.DefaultMatchTimeout_ConfigKeyName, true);
Assert.Throws<TypeInitializationException>(() => Regex.InfiniteMatchTimeout);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public static void StaticCtor_InvalidTimeoutRange_ExceptionThrown()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.SetData(RegexHelpers.DefaultMatchTimeout_ConfigKeyName, TimeSpan.Zero);
Assert.Throws<TypeInitializationException>(() => Regex.InfiniteMatchTimeout);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
}
using System.Diagnostics;
using System.Globalization;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.RegularExpressions.Tests
{
- public class RegexGroupTests : RemoteExecutorTestBase
+ public class RegexGroupTests
{
private static readonly CultureInfo s_enUSCulture = new CultureInfo("en-US");
private static readonly CultureInfo s_invariantCulture = new CultureInfo("");
[Fact]
public void GroupsEnUS()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = s_enUSCulture;
foreach (object[] testCase in Groups_CustomCulture_TestData_enUS())
{
GroupsTest(testCase);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void GroupsCzech()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = s_czechCulture;
foreach (object[] testCase in Groups_CustomCulture_TestData_Czech())
{
GroupsTest(testCase);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void GroupsDanish()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = s_danishCulture;
foreach (object[] testCase in Groups_CustomCulture_TestData_Danish())
{
GroupsTest(testCase);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void GroupsTurkish()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = s_turkishCulture;
foreach (object[] testCase in Groups_CustomCulture_TestData_Turkish())
{
GroupsTest(testCase);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void GroupsAzeriLatin()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = s_azeriLatinCulture;
foreach (object[] testCase in Groups_CustomCulture_TestData_AzeriLatin())
{
GroupsTest(testCase);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void GroupsBasic()
{
- RemoteInvoke(() => {
+ RemoteExecutor.Invoke(() => {
CultureInfo.CurrentCulture = GetDefaultCultureForTests();
foreach (object[] testCase in Groups_Basic_TestData())
{
GroupsTest(testCase);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
using System.Diagnostics;
using System.Globalization;
using System.Linq;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Text.RegularExpressions.Tests
{
- public class RegexMatchTests : RemoteExecutorTestBase
+ public class RegexMatchTests
{
public static IEnumerable<object[]> Match_Basic_TestData()
{
[Fact]
public void Match_Timeout_Throws()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
const string Pattern = @"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$";
string input = new string('a', 50) + "@a.a";
AppDomain.CurrentDomain.SetData(RegexHelpers.DefaultMatchTimeout_ConfigKeyName, TimeSpan.FromMilliseconds(100));
Assert.Throws<RegexMatchTimeoutException>(() => new Regex(Pattern).Match(input));
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void Match_SpecialUnicodeCharacters_enUS()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = new CultureInfo("en-US");
Match("\u0131", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
Match("\u0131", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[Fact]
public void Match_SpecialUnicodeCharacters_Invariant()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
Match("\u0131", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
Match("\u0130", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
Match("\u0130", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Full framework needs fix for #26484")]
public void Match_ExcessPrefix()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
// Should not throw out of memory
Assert.False(Regex.IsMatch("a", @"a{2147483647,}"));
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{94B106C2-D574-4392-80AB-3EE308A078DF}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<PropertyGroup>
- <!-- Temporary property to diagnose hanging test
- <XunitShowProgress>true</XunitShowProgress>
- <XunitMaxThreads>1</XunitMaxThreads>
- -->
</PropertyGroup>
<ItemGroup>
<Compile Include="CaptureCollectionTests.cs" />
<Compile Include="..\src\System\Text\RegularExpressions\RegexParseError.cs">
<Link>System\Text\RegularExpressions\RegexParseError.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
<Compile Include="GroupCollectionReadOnlyDictionaryTests.cs" />
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tasks.Dataflow.Tests
{
- public class EtwTests : RemoteExecutorTestBase
+ public class EtwTests
{
[Fact]
public void TestEtw()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener(new Guid("16F53577-E41D-43D4-B47E-C17025BF4025"), EventLevel.Verbose))
{
});
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{72E21903-0FBA-444E-9855-3B4F05DFC1F9}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Link>Common\System\Diagnostics\DebuggerAttributes.cs</Link>
</Compile>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Linq;
-
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tasks.Tests
{
- public class EtwTests : RemoteExecutorTestBase
+ public class EtwTests
{
[Fact]
public static void TestEtw()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
var eventSourceName = PlatformDetection.IsFullFramework ? "System.Threading.Tasks.TplEventSource" : "System.Threading.Tasks.Parallel.EventSource";
using (var listener = new TestEventListener(eventSourceName, EventLevel.Verbose))
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{DE29C320-2ECA-43FD-9F41-6F4F6C6BACD5}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<PropertyGroup>
<Compile Include="$(CommonTestPath)\System\Threading\ThreadPoolHelpers.cs">
<Link>CommonTest\System\Threading\ThreadPoolHelpers.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
</Project>
using System.Collections.Concurrent;
using System.Linq;
using System.Runtime.CompilerServices;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tasks.Tests
{
- public partial class AsyncTaskMethodBuilderTests : RemoteExecutorTestBase
+ public partial class AsyncTaskMethodBuilderTests
{
[OuterLoop]
[Fact]
public static void DroppedIncompleteStateMachine_RaisesIncompleteAsyncMethodEvent()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("System.Threading.Tasks.TplEventSource", EventLevel.Verbose))
{
Assert.Contains("stored data", description);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}).Dispose();
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{B6C09633-D161-499A-8FE1-46B2D53A16E7}</ProjectGuid>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="Helpers.cs" />
<Link>Common\System\Diagnostics\Tracing\TestEventListener.cs</Link>
</Compile>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<ProjectGuid>{33F5A50E-B823-4FDD-8571-365C909ACEAE}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="CompressedStackTests.cs" />
<Compile Include="$(CommonTestPath)\System\Threading\ThreadTestHelpers.cs">
<Link>CommonTest\System\Threading\ThreadPoolHelpers.cs</Link>
</Compile>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
<ProjectReference Include="STAMain\STAMain.csproj">
<Name>STAMain</Name>
</ProjectReference>
using System.Security.Principal;
using System.Threading.Tasks;
using System.Threading.Tests;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Threads.Tests
{
- public class DummyClass : RemoteExecutorTestBase
+ public class DummyClass
{
- public static string HostRunnerTest = HostRunner;
+ public static string HostRunnerTest = RemoteExecutor.HostRunner;
}
public static partial class ThreadTests
[PlatformSpecific(TestPlatforms.Windows)]
public static void ApartmentState_NoAttributePresent_DefaultState_Windows()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(ApartmentState.MTA, Thread.CurrentThread.GetApartmentState());
Assert.Throws<InvalidOperationException>(() => Thread.CurrentThread.SetApartmentState(ApartmentState.STA));
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public static void ApartmentState_NoAttributePresent_STA_Windows_Desktop()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Throws<InvalidOperationException>(() => Thread.CurrentThread.SetApartmentState(ApartmentState.STA));
Thread.CurrentThread.SetApartmentState(ApartmentState.MTA);
[PlatformSpecific(TestPlatforms.AnyUnix)]
public static void ApartmentState_NoAttributePresent_DefaultState_Unix()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(ApartmentState.Unknown, Thread.CurrentThread.GetApartmentState());
Assert.Throws<PlatformNotSupportedException>(() => Thread.CurrentThread.SetApartmentState(ApartmentState.MTA));
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsWindowsNanoServer))]
public static void ApartmentState_NoAttributePresent_DefaultState_Nano()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Throws<InvalidOperationException>(() => Thread.CurrentThread.SetApartmentState(ApartmentState.STA));
Assert.Equal(ApartmentState.MTA, Thread.CurrentThread.GetApartmentState());
[PlatformSpecific(TestPlatforms.AnyUnix)]
public static void ApartmentState_NoAttributePresent_STA_Unix()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Throws<PlatformNotSupportedException>(() => Thread.CurrentThread.SetApartmentState(ApartmentState.STA));
}).Dispose();
{
// We run test on remote process because we need to set same principal policy
// On netfx default principal policy is PrincipalPolicy.UnauthenticatedPrincipal
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.NoPrincipal);
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "SetPrincipal doesn't work on UAP.")]
public static void WindowsPrincipalPolicyTest_Windows()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Assert.Equal(Environment.UserDomainName + @"\" + Environment.UserName, Thread.CurrentPrincipal.Identity.Name);
[PlatformSpecific(TestPlatforms.AnyUnix)]
public static void WindowsPrincipalPolicyTest_Unix()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Assert.Throws<PlatformNotSupportedException>(() => Thread.CurrentPrincipal);
[Fact]
public static void UnauthenticatedPrincipalTest()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.UnauthenticatedPrincipal);
Assert.Equal(string.Empty, Thread.CurrentPrincipal.Identity.Name);
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Default principal policy on .NET Framework is Unauthenticated Principal")]
public static void DefaultPrincipalPolicyTest()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Null(Thread.CurrentPrincipal);
}).Dispose();
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework, "Default principal policy on .NET Core is No Principal")]
public static void DefaultPrincipalPolicyTest_Desktop()
{
- DummyClass.RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
Assert.Equal(string.Empty, Thread.CurrentPrincipal.Identity.Name);
}).Dispose();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{403AD1B8-6F95-4A2E-92A2-727606ABD866}</ProjectGuid>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
</PropertyGroup>
using System.Diagnostics;
using System.Diagnostics.Tracing;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tests
{
- public class EtwTests : RemoteExecutorTestBase
+ public class EtwTests
{
[Fact]
public void TestEtw()
{
- RemoteInvoke(() =>
+ RemoteExecutor.Invoke(() =>
{
using (var listener = new TestEventListener("System.Threading.SynchronizationEventSource", EventLevel.Verbose))
{
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tests
{
- public class EventWaitHandleTests : RemoteExecutorTestBase
+ public class EventWaitHandleTests
{
[Theory]
[InlineData(false, EventResetMode.AutoReset)]
// Create the two events and the other process with which to synchronize
using (var inbound = new EventWaitHandle(true, mode, inboundName))
using (var outbound = new EventWaitHandle(false, mode, outboundName))
- using (var remote = RemoteInvoke(PingPong_OtherProcess, mode.ToString(), outboundName, inboundName))
+ using (var remote = RemoteExecutor.Invoke(PingPong_OtherProcess, mode.ToString(), outboundName, inboundName))
{
// Repeatedly wait for one event and then set the other
for (int i = 0; i < 10; i++)
{
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ Assert.True(inbound.WaitOne(RemoteExecutor.FailWaitTimeoutMilliseconds));
if (mode == EventResetMode.ManualReset)
{
inbound.Reset();
// Repeatedly wait for one event and then set the other
for (int i = 0; i < 10; i++)
{
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ Assert.True(inbound.WaitOne(RemoteExecutor.FailWaitTimeoutMilliseconds));
if (mode == EventResetMode.ManualReset)
{
inbound.Reset();
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
public static TheoryData<string> GetValidNames()
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tests
{
- public class MutexTests : RemoteExecutorTestBase
+ public class MutexTests : FileCleanupTestBase
{
[Fact]
public void Ctor_ConstructWaitRelease()
IncrementValueInFileNTimes(mutex, f, 10);
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
};
using (var mutex = new Mutex(false, mutexName))
- using (var remote = RemoteInvoke(otherProcess, mutexName, fileName))
+ using (var remote = RemoteExecutor.Invoke(otherProcess, mutexName, fileName))
{
SpinWait.SpinUntil(() => File.Exists(fileName), ThreadTestHelpers.UnexpectedTimeoutMilliseconds);
using System;
using System.Diagnostics;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
namespace System.Threading.Tests
{
- public class SemaphoreTests : RemoteExecutorTestBase
+ public class SemaphoreTests
{
private const int FailedWaitTimeout = 30000;
// Create the two semaphores and the other process with which to synchronize
using (var inbound = new Semaphore(1, 1, inboundName))
using (var outbound = new Semaphore(0, 1, outboundName))
- using (var remote = RemoteInvoke(new Func<string, string, int>(PingPong_OtherProcess), outboundName, inboundName))
+ using (var remote = RemoteExecutor.Invoke(new Func<string, string, int>(PingPong_OtherProcess), outboundName, inboundName))
{
// Repeatedly wait for count in one semaphore and then release count into the other
for (int i = 0; i < 10; i++)
{
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ Assert.True(inbound.WaitOne(RemoteExecutor.FailWaitTimeoutMilliseconds));
outbound.Release();
}
}
// Repeatedly wait for count in one semaphore and then release count into the other
for (int i = 0; i < 10; i++)
{
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ Assert.True(inbound.WaitOne(RemoteExecutor.FailWaitTimeoutMilliseconds));
outbound.Release();
}
}
- return SuccessExitCode;
+ return RemoteExecutor.SuccessExitCode;
}
public static TheoryData<string> GetValidNames()
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{18EF66B3-51EE-46D8-B283-1CB6A1197813}</ProjectGuid>
- <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
<TestRuntime>true</TestRuntime>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="AsyncLocalTests.cs" />
<Link>CommonTest\System\Threading\ThreadTestHelpers.cs</Link>
</Compile>
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
- </ItemGroup>
</Project>
\ No newline at end of file
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.DotNet.RemoteExecutor;
using Xunit;
using Xunit.Abstractions;
namespace System.Transactions.Tests
{
- public class AsyncTransactionScopeTests : RemoteExecutorTestBase
+ public class AsyncTransactionScopeTests
{
// Number of threads to create
private const int iterations = 5;
Transaction.Current = null;
}
- protected override void Dispose(bool disposing)
+ protected void Dispose(bool disposing)
{
Transaction.Current = null;
- base.Dispose(disposing);
}
/// <summary>
[ActiveIssue(31913, TargetFrameworkMonikers.Uap)]
public void AsyncTSTest(int variation)
{
- RemoteInvoke(variationString =>
+ RemoteExecutor.Invoke(variationString =>
{
using (var listener = new TestEventListener(new Guid("8ac2d80a-1f1a-431b-ace4-bff8824aef0b"), System.Diagnostics.Tracing.EventLevel.Verbose))
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{1C397868-9644-48CB-94BF-35805C4AE024}</ProjectGuid>
- <Configurations>netstandard-Debug;netstandard-Release</Configurations>
<CoverageSupported>false</CoverageSupported>
+ <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
+ <Configurations>netstandard-Debug;netstandard-Release</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="NonMsdtcPromoterTests.cs" />
<Compile Include="HelperFunctions.cs" />
<Compile Include="TestEnlistments.cs" />
<Compile Include="TransactionTracingEventListener.cs" />
- <ProjectReference Include="$(CommonTestPath)\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj">
- <Project>{69e46a6f-9966-45a5-8945-2559fe337827}</Project>
- <Name>RemoteExecutorConsoleApp</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />