diff --git a/src/Scenarios/InterProcessCommunication.sln b/src/Scenarios/InterProcessCommunication.sln
deleted file mode 100644
index 1412a645bdbc..000000000000
--- a/src/Scenarios/InterProcessCommunication.sln
+++ /dev/null
@@ -1,53 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.22823.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InterProcessCommunication.Tests", "tests\InterProcessCommunication\InterProcessCommunication.Tests.csproj", "{C8B651EA-21B8-45B3-9617-3BA952D0F12B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteExecutorConsoleApp", "..\Common\tests\System\Diagnostics\RemoteExecutorConsoleApp\RemoteExecutorConsoleApp.csproj", "{F5E941C8-AF2F-47AB-A066-FF25470CE382}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{EFFF9E5B-58A0-4D0E-891D-40EF450FE7DA}"
- ProjectSection(SolutionItems) = preProject
- ..\.nuget\packages.Windows_NT.config = ..\.nuget\packages.Windows_NT.config
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Linux_Debug|Any CPU = Linux_Debug|Any CPU
- Linux_Release|Any CPU = Linux_Release|Any CPU
- OSX_Debug|Any CPU = OSX_Debug|Any CPU
- OSX_Release|Any CPU = OSX_Release|Any CPU
- Windows_Debug|Any CPU = Windows_Debug|Any CPU
- Windows_Release|Any CPU = Windows_Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Linux_Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Linux_Debug|Any CPU.Build.0 = Debug|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Linux_Release|Any CPU.ActiveCfg = Release|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Linux_Release|Any CPU.Build.0 = Release|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.OSX_Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.OSX_Debug|Any CPU.Build.0 = Debug|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.OSX_Release|Any CPU.ActiveCfg = Release|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.OSX_Release|Any CPU.Build.0 = Release|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Windows_Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Windows_Debug|Any CPU.Build.0 = Debug|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Windows_Release|Any CPU.ActiveCfg = Release|Any CPU
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}.Windows_Release|Any CPU.Build.0 = Release|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Linux_Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Linux_Debug|Any CPU.Build.0 = Debug|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Linux_Release|Any CPU.ActiveCfg = Release|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Linux_Release|Any CPU.Build.0 = Release|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.OSX_Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.OSX_Debug|Any CPU.Build.0 = Debug|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.OSX_Release|Any CPU.ActiveCfg = Release|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.OSX_Release|Any CPU.Build.0 = Release|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Windows_Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Windows_Debug|Any CPU.Build.0 = Debug|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Windows_Release|Any CPU.ActiveCfg = Release|Any CPU
- {F5E941C8-AF2F-47AB-A066-FF25470CE382}.Windows_Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/Scenarios/tests/InterProcessCommunication/EventWaitHandleTests.cs b/src/Scenarios/tests/InterProcessCommunication/EventWaitHandleTests.cs
deleted file mode 100644
index b8ee044b6d03..000000000000
--- a/src/Scenarios/tests/InterProcessCommunication/EventWaitHandleTests.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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.Diagnostics;
-using System.Threading;
-using Xunit;
-
-namespace InterProcessCommunication.Tests
-{
- public class EventWaitHandleTests : RemoteExecutorTestBase
- {
- [PlatformSpecific(PlatformID.Windows)] // names aren't supported on Unix
- [Theory]
- [InlineData(EventResetMode.ManualReset)]
- [InlineData(EventResetMode.AutoReset)]
- public void PingPong(EventResetMode mode)
- {
- // Create names for the two events
- string outboundName = Guid.NewGuid().ToString("N");
- string inboundName = Guid.NewGuid().ToString("N");
-
- // 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))
- {
- // Repeatedly wait for one event and then set the other
- for (int i = 0; i < 10; i++)
- {
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
- if (mode == EventResetMode.ManualReset)
- {
- inbound.Reset();
- }
- outbound.Set();
- }
- }
- }
-
- private static int PingPong_OtherProcess(string modeName, string inboundName, string outboundName)
- {
- EventResetMode mode = (EventResetMode)Enum.Parse(typeof(EventResetMode), modeName);
-
- // Open the two events
- using (var inbound = EventWaitHandle.OpenExisting(inboundName))
- using (var outbound = EventWaitHandle.OpenExisting(outboundName))
- {
- // Repeatedly wait for one event and then set the other
- for (int i = 0; i < 10; i++)
- {
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
- if (mode == EventResetMode.ManualReset)
- {
- inbound.Reset();
- }
- outbound.Set();
- }
- }
-
- return SuccessExitCode;
- }
-
- }
-}
diff --git a/src/Scenarios/tests/InterProcessCommunication/InterProcessCommunication.Tests.csproj b/src/Scenarios/tests/InterProcessCommunication/InterProcessCommunication.Tests.csproj
deleted file mode 100644
index b6893aac0239..000000000000
--- a/src/Scenarios/tests/InterProcessCommunication/InterProcessCommunication.Tests.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
- Windows_Debug
-
-
-
- {C8B651EA-21B8-45B3-9617-3BA952D0F12B}
- Library
- InterProcessCommunication.Tests
- InterProcessCommunication.Tests
- b62eec4b
-
-
-
-
-
-
-
-
-
-
-
- Common\System\IO\TempFile.cs
-
-
- Common\System\Diagnostics\RemoteExecutorTestBase.cs
-
-
- Common\System\IO\FileCleanupTestBase.cs
-
-
-
-
-
-
-
- {63634289-90D7-4947-8BF3-DBBE98D76C85}
- System.Diagnostics.Process
-
-
- {16EE5522-F387-4C9E-9EF2-B5134B043F37}
- System.IO.MemoryMappedFiles
-
-
- {63634289-90d7-4947-8bf3-dbbe98d76c85}
- System.IO.Pipes
-
-
- {bcf9255a-4321-4277-ad7d-f5094092c554}
- System.IO.UnmanagedMemoryStream
-
-
- {69e46a6f-9966-45a5-8945-2559fe337827}
- RemoteExecutorConsoleApp
-
-
-
-
diff --git a/src/Scenarios/tests/InterProcessCommunication/SemaphoreTests.cs b/src/Scenarios/tests/InterProcessCommunication/SemaphoreTests.cs
deleted file mode 100644
index dc84ce0bc4e4..000000000000
--- a/src/Scenarios/tests/InterProcessCommunication/SemaphoreTests.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// 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.Diagnostics;
-using System.Threading;
-using Xunit;
-
-namespace InterProcessCommunication.Tests
-{
- public class SemaphoreTests : RemoteExecutorTestBase
- {
- [PlatformSpecific(PlatformID.Windows)] // names aren't supported on Unix
- [Fact]
- public void PingPong()
- {
- // Create names for the two semaphores
- string outboundName = Guid.NewGuid().ToString("N");
- string inboundName = Guid.NewGuid().ToString("N");
-
- // 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(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));
- outbound.Release();
- }
- }
- }
-
- private static int PingPong_OtherProcess(string inboundName, string outboundName)
- {
- // Open the two semaphores
- using (var inbound = Semaphore.OpenExisting(inboundName))
- using (var outbound = Semaphore.OpenExisting(outboundName))
- {
- // Repeatedly wait for count in one sempahore and then release count into the other
- for (int i = 0; i < 10; i++)
- {
- Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
- outbound.Release();
- }
- }
-
- return SuccessExitCode;
- }
-
- }
-}
diff --git a/src/Scenarios/tests/InterProcessCommunication/project.json b/src/Scenarios/tests/InterProcessCommunication/project.json
deleted file mode 100644
index 556d6a005a65..000000000000
--- a/src/Scenarios/tests/InterProcessCommunication/project.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.1-rc3-23910",
- "System.Globalization": "4.0.10",
- "System.IO": "4.0.10",
- "System.IO.FileSystem": "4.0.0",
- "System.IO.FileSystem.Primitives": "4.0.0",
- "System.Reflection.Extensions": "4.0.0",
- "System.Runtime": "4.0.20",
- "System.Runtime.Extensions": "4.0.10",
- "System.Runtime.Handles": "4.0.0",
- "System.Threading": "4.0.10",
- "System.Threading.Tasks": "4.0.10",
- "xunit": "2.1.0",
- "xunit.netcore.extensions": "1.0.0-prerelease-00187"
- },
- "frameworks": {
- "dnxcore50": {
- "imports": "portable-net45+win8"
- }
- }
-}
diff --git a/src/Scenarios/tests/InterProcessCommunication/MemoryMappedFilesTests.cs b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs
similarity index 94%
rename from src/Scenarios/tests/InterProcessCommunication/MemoryMappedFilesTests.cs
rename to src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs
index 411c3baafedd..db8e827b2df2 100644
--- a/src/Scenarios/tests/InterProcessCommunication/MemoryMappedFilesTests.cs
+++ b/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs
@@ -3,13 +3,11 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
-using System.IO;
-using System.IO.MemoryMappedFiles;
using Xunit;
-namespace InterProcessCommunication.Tests
+namespace System.IO.MemoryMappedFiles.Tests
{
- public class MemoryMappedFilesTests : RemoteExecutorTestBase
+ public class CrossProcessTests : RemoteExecutorTestBase
{
[Fact]
public void DataShared()
diff --git a/src/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj b/src/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
index db82d9a16672..56d65fb53741 100644
--- a/src/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
+++ b/src/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
@@ -1,4 +1,4 @@
-
+
Windows_Debug
@@ -22,6 +22,7 @@
+
@@ -31,6 +32,9 @@
Common\System\IO\TempFile.cs
+
+ Common\System\Diagnostics\RemoteExecutorTestBase.cs
+
Common\System\IO\FileCleanupTestBase.cs
@@ -51,6 +55,10 @@
{16EE5522-F387-4C9E-9EF2-B5134B043F37}
System.IO.MemoryMappedFiles
+
+ {69e46a6f-9966-45a5-8945-2559fe337827}
+ RemoteExecutorConsoleApp
+
diff --git a/src/System.IO.MemoryMappedFiles/tests/project.json b/src/System.IO.MemoryMappedFiles/tests/project.json
index 67b7312bdd75..3c1b754a96e9 100644
--- a/src/System.IO.MemoryMappedFiles/tests/project.json
+++ b/src/System.IO.MemoryMappedFiles/tests/project.json
@@ -2,6 +2,7 @@
"dependencies": {
"Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0029",
"Microsoft.NETCore.Platforms": "1.0.1-rc3-23910",
+ "System.Diagnostics.Process": "4.1.0-rc3-23910",
"System.IO": "4.0.10",
"System.IO.FileSystem": "4.0.0",
"System.IO.FileSystem.Primitives": "4.0.0",
diff --git a/src/Scenarios/tests/InterProcessCommunication/AnonymousPipesTests.cs b/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.CrossProcess.cs
similarity index 93%
rename from src/Scenarios/tests/InterProcessCommunication/AnonymousPipesTests.cs
rename to src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.CrossProcess.cs
index c365246cea5b..e60bc0278a38 100644
--- a/src/Scenarios/tests/InterProcessCommunication/AnonymousPipesTests.cs
+++ b/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.CrossProcess.cs
@@ -3,13 +3,11 @@
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
-using System.IO;
-using System.IO.Pipes;
using Xunit;
-namespace InterProcessCommunication.Tests
+namespace System.IO.Pipes.Tests
{
- public class AnonymousPipesTests : RemoteExecutorTestBase
+ public class AnonymousPipeTest_CrossProcess : RemoteExecutorTestBase
{
[Fact]
public void PingPong()
diff --git a/src/Scenarios/tests/InterProcessCommunication/NamedPipesTests.cs b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs
similarity index 86%
rename from src/Scenarios/tests/InterProcessCommunication/NamedPipesTests.cs
rename to src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs
index 9b453add822d..69abc7eb7fbf 100644
--- a/src/Scenarios/tests/InterProcessCommunication/NamedPipesTests.cs
+++ b/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs
@@ -2,18 +2,17 @@
// 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.Diagnostics;
-using System.IO.Pipes;
using System.Threading.Tasks;
using Xunit;
-namespace InterProcessCommunication.Tests
+namespace System.IO.Pipes.Tests
{
- public class NamedPipesTests : RemoteExecutorTestBase
+ public sealed class NamedPipeTest_CrossProcess : RemoteExecutorTestBase
{
- [Fact]
- public void PingPong()
+ [Theory]
+ [InlineData(PipeDirection.Out, PipeDirection.In)]
+ public void PingPong(PipeDirection outboundDirection, PipeDirection inboundDirection)
{
// Create names for two pipes
string outName = Guid.NewGuid().ToString("N");
@@ -21,8 +20,8 @@ public void PingPong()
// Create the two named pipes, one for each direction, then create
// another process with which to communicate
- using (var outbound = new NamedPipeServerStream(outName, PipeDirection.Out))
- using (var inbound = new NamedPipeClientStream(".", inName, PipeDirection.In))
+ using (var outbound = new NamedPipeServerStream(outName, outboundDirection))
+ using (var inbound = new NamedPipeClientStream(".", inName, inboundDirection))
using (var remote = RemoteInvoke(PingPong_OtherProcess, outName, inName))
{
// Wait for both pipes to be connected
diff --git a/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj b/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
index be7b5cfdf082..a42de0d47e48 100644
--- a/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
+++ b/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
@@ -1,4 +1,4 @@
-
+
Windows_Debug
@@ -25,6 +25,7 @@
+
@@ -32,6 +33,7 @@
+
@@ -46,6 +48,12 @@
Common\System\PerfUtils.cs
+
+ Common\System\Diagnostics\RemoteExecutorTestBase.cs
+
+
+ Common\System\IO\FileCleanupTestBase.cs
+
@@ -60,6 +68,10 @@
{16ee5522-f387-4c9e-9ef2-b5134b043f37}
System.IO.Pipes
+
+ {69e46a6f-9966-45a5-8945-2559fe337827}
+ RemoteExecutorConsoleApp
+
diff --git a/src/System.IO.Pipes/tests/project.json b/src/System.IO.Pipes/tests/project.json
index 86898b27e35f..0b1362db682b 100644
--- a/src/System.IO.Pipes/tests/project.json
+++ b/src/System.IO.Pipes/tests/project.json
@@ -3,6 +3,7 @@
"Microsoft.DotNet.xunit.performance": "1.0.0-alpha-build0029",
"Microsoft.NETCore.Platforms": "1.0.1-rc3-23910",
"System.Diagnostics.Debug": "4.0.10",
+ "System.Diagnostics.Process": "4.1.0-rc3-23910",
"System.IO": "4.0.10",
"System.IO.FileSystem": "4.0.0",
"System.Runtime": "4.0.20",
diff --git a/src/System.Threading/tests/EventWaitHandleTests.cs b/src/System.Threading/tests/EventWaitHandleTests.cs
index 7017181fc9c8..965dfa9240d8 100644
--- a/src/System.Threading/tests/EventWaitHandleTests.cs
+++ b/src/System.Threading/tests/EventWaitHandleTests.cs
@@ -2,11 +2,12 @@
// 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.Diagnostics;
using Xunit;
namespace System.Threading.Tests
{
- public class EventWaitHandleTests
+ public class EventWaitHandleTests : RemoteExecutorTestBase
{
[Theory]
[InlineData(false, EventResetMode.AutoReset)]
@@ -139,5 +140,56 @@ public void OpenExisting_NotSupported_Unix()
Assert.Throws(() => EventWaitHandle.TryOpenExisting("anything", out ewh));
}
+ [PlatformSpecific(PlatformID.Windows)] // names aren't supported on Unix
+ [Theory]
+ [InlineData(EventResetMode.ManualReset)]
+ [InlineData(EventResetMode.AutoReset)]
+ public void PingPong(EventResetMode mode)
+ {
+ // Create names for the two events
+ string outboundName = Guid.NewGuid().ToString("N");
+ string inboundName = Guid.NewGuid().ToString("N");
+
+ // 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))
+ {
+ // Repeatedly wait for one event and then set the other
+ for (int i = 0; i < 10; i++)
+ {
+ Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ if (mode == EventResetMode.ManualReset)
+ {
+ inbound.Reset();
+ }
+ outbound.Set();
+ }
+ }
+ }
+
+ private static int PingPong_OtherProcess(string modeName, string inboundName, string outboundName)
+ {
+ EventResetMode mode = (EventResetMode)Enum.Parse(typeof(EventResetMode), modeName);
+
+ // Open the two events
+ using (var inbound = EventWaitHandle.OpenExisting(inboundName))
+ using (var outbound = EventWaitHandle.OpenExisting(outboundName))
+ {
+ // Repeatedly wait for one event and then set the other
+ for (int i = 0; i < 10; i++)
+ {
+ Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ if (mode == EventResetMode.ManualReset)
+ {
+ inbound.Reset();
+ }
+ outbound.Set();
+ }
+ }
+
+ return SuccessExitCode;
+ }
+
}
}
diff --git a/src/System.Threading/tests/SemaphoreTests.cs b/src/System.Threading/tests/SemaphoreTests.cs
index 08f7578da889..9f324b4d6e0d 100644
--- a/src/System.Threading/tests/SemaphoreTests.cs
+++ b/src/System.Threading/tests/SemaphoreTests.cs
@@ -2,12 +2,13 @@
// 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.Diagnostics;
using System.Threading.Tasks;
using Xunit;
namespace System.Threading.Tests
{
- public class SemaphoreTests
+ public class SemaphoreTests : RemoteExecutorTestBase
{
private const int FailedWaitTimeout = 30000;
@@ -275,5 +276,44 @@ public void OpenExisting_SameAsOriginal_Windows()
}
}
}
+
+ [PlatformSpecific(PlatformID.Windows)] // names aren't supported on Unix
+ [Fact]
+ public void PingPong()
+ {
+ // Create names for the two semaphores
+ string outboundName = Guid.NewGuid().ToString("N");
+ string inboundName = Guid.NewGuid().ToString("N");
+
+ // 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(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));
+ outbound.Release();
+ }
+ }
+ }
+
+ private static int PingPong_OtherProcess(string inboundName, string outboundName)
+ {
+ // Open the two semaphores
+ using (var inbound = Semaphore.OpenExisting(inboundName))
+ using (var outbound = Semaphore.OpenExisting(outboundName))
+ {
+ // Repeatedly wait for count in one sempahore and then release count into the other
+ for (int i = 0; i < 10; i++)
+ {
+ Assert.True(inbound.WaitOne(FailWaitTimeoutMilliseconds));
+ outbound.Release();
+ }
+ }
+
+ return SuccessExitCode;
+ }
}
}
diff --git a/src/System.Threading/tests/System.Threading.Tests.csproj b/src/System.Threading/tests/System.Threading.Tests.csproj
index b48d1d03226d..ffbe1de5e148 100644
--- a/src/System.Threading/tests/System.Threading.Tests.csproj
+++ b/src/System.Threading/tests/System.Threading.Tests.csproj
@@ -38,6 +38,12 @@
Common\System\Diagnostics\Tracing\TestEventListener.cs
+
+ Common\System\Diagnostics\RemoteExecutorTestBase.cs
+
+
+ Common\System\IO\FileCleanupTestBase.cs
+
@@ -48,6 +54,10 @@
+
+ {69e46a6f-9966-45a5-8945-2559fe337827}
+ RemoteExecutorConsoleApp
+
false
diff --git a/src/System.Threading/tests/project.json b/src/System.Threading/tests/project.json
index 3cb695f62f77..f6f31a6a574b 100644
--- a/src/System.Threading/tests/project.json
+++ b/src/System.Threading/tests/project.json
@@ -4,6 +4,7 @@
"Microsoft.NETCore.Platforms": "1.0.1-rc3-23910",
"System.Collections": "4.0.10",
"System.Diagnostics.Debug": "4.0.10",
+ "System.Diagnostics.Process": "4.1.0-rc3-23910",
"System.Diagnostics.Tracing": "4.0.20",
"System.Runtime": "4.0.20",
"System.Threading": "4.0.10",