Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Robbins <brianrob@microsoft.com>2017-10-26 11:21:32 +0300
committerGitHub <noreply@github.com>2017-10-26 11:21:32 +0300
commit4583f3f5941a08a6baf1dfd5df4983703f1c7130 (patch)
treeb26c3432e1710b522c419ceacb6621013e07c2e3 /src
parent59c4fe3716adb1746772400f1fe74c3fe72f9974 (diff)
Share EventSource tests with Microsoft.Diagnostics.Tracing.EventSource.Redist nuget package. (#24859)
Diffstat (limited to 'src')
-rw-r--r--src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Configurations.props8
-rw-r--r--src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Microsoft.Diagnostics.Tracing.EventSource.Redist.Tests.csproj44
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/EventSourceTestParser.cs5
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/Listeners.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/LoudListener.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs5
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestFilter.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestShutdown.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestUtilities.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs7
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidCallsToWriteEvent.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidEventSources.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/CustomEventSources/SimpleEventSource.cs8
-rw-r--r--src/System.Diagnostics.Tracing/tests/CustomEventSources/UseAbstractEventSource.cs4
-rw-r--r--src/System.Diagnostics.Tracing/tests/CustomEventSources/UseInterfaceEventSource.cs4
25 files changed, 150 insertions, 3 deletions
diff --git a/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Configurations.props b/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Configurations.props
new file mode 100644
index 0000000000..064de9fd71
--- /dev/null
+++ b/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Configurations.props
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <BuildConfigurations>
+ netfx;
+ </BuildConfigurations>
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Microsoft.Diagnostics.Tracing.EventSource.Redist.Tests.csproj b/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Microsoft.Diagnostics.Tracing.EventSource.Redist.Tests.csproj
new file mode 100644
index 0000000000..b76b699b4b
--- /dev/null
+++ b/src/Microsoft.Diagnostics.Tracing.EventSource.Redist/tests/Microsoft.Diagnostics.Tracing.EventSource.Redist.Tests.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <ProjectGuid>{0657A043-0AEE-445E-9BE4-0B3A9D80318F}</ProjectGuid>
+ <DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_ETLEVENTS</DefineConstants>
+ <DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_EVENTCOUNTER_DISPOSE</DefineConstants>
+ <DefineConstants>$(DefineConstants);USE_MDT_EVENTSOURCE</DefineConstants>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SDTTestDir>..\..\System.Diagnostics.Tracing\tests</SDTTestDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Debug|AnyCPU'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Release|AnyCPU'" />
+ <ItemGroup>
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\Harness\EventTestHarness.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\FuzzyTests.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\Harness\Listeners.cs" />
+ <!-- <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestEventCounter.cs" /> -->
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestFilter.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestShutdown.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsEventSourceLifetime.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsManifestGeneration.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsManifestNegative.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsTraits.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsWriteEvent.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsWriteEventToListener.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\EventSourceTestParser.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\LoudListener.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsWrite.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestsUserErrors.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\TestUtilities.cs" />
+ <Compile Include="$(SDTTestDir)\BasicEventSourceTest\XUnitAssemblyAttributes.cs" />
+ <!--EventSources for testing-->
+ <Compile Include="$(SDTTestDir)\CustomEventSources\EventSourceTest.cs" />
+ <Compile Include="$(SDTTestDir)\CustomEventSources\InvalidCallsToWriteEvent.cs" />
+ <Compile Include="$(SDTTestDir)\CustomEventSources\InvalidEventSources.cs" />
+ <Compile Include="$(SDTTestDir)\CustomEventSources\SimpleEventSource.cs" />
+ <Compile Include="$(SDTTestDir)\CustomEventSources\UseAbstractEventSource.cs" />
+ <Compile Include="$(SDTTestDir)\CustomEventSources\UseInterfaceEventSource.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/EventSourceTestParser.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/EventSourceTestParser.cs
index 57b27fba8c..dd1550f492 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/EventSourceTestParser.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/EventSourceTestParser.cs
@@ -4,9 +4,12 @@
using System;
using System.Diagnostics;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using System.Text;
-//using System.Diagnostics.Tracing;
using Address = System.UInt64;
#pragma warning disable 1591 // disable warnings on XML comments not being present
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs
index 72476cb0a5..bb586b47b4 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/FuzzyTests.cs
@@ -7,7 +7,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
using Microsoft.Diagnostics.Tracing.Session;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs
index 5dff1851fb..fc1b1de920 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs
@@ -2,7 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
using System;
using System.Collections.Generic;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/Listeners.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/Listeners.cs
index ff083de8f6..e56fc8b2b2 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/Listeners.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/Listeners.cs
@@ -8,7 +8,11 @@ using Microsoft.Diagnostics.Tracing.Session;
using System;
using System.Collections.Generic;
using System.Diagnostics;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using System.IO;
using System.Text;
using System.Threading;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/LoudListener.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/LoudListener.cs
index f5280d0dbe..7f26da5868 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/LoudListener.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/LoudListener.cs
@@ -4,7 +4,11 @@
using System;
using System.Diagnostics;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
namespace BasicEventSourceTests
{
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs
index 1f655227ea..4b8552614c 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs
@@ -2,7 +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.
+
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue https://github.com/dotnet/corefx/issues/4864
using Microsoft.Diagnostics.Tracing.Session;
#endif
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestFilter.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestFilter.cs
index bbfb09e855..c4486a519b 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestFilter.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestFilter.cs
@@ -4,7 +4,11 @@
using System;
using System.Collections.ObjectModel;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
namespace BasicEventSourceTests
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestShutdown.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestShutdown.cs
index 13c8ca94d0..b88408d1cd 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestShutdown.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestShutdown.cs
@@ -7,7 +7,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
using Microsoft.Diagnostics.Tracing.Session;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestUtilities.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestUtilities.cs
index bbf8c005e5..42970594d2 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestUtilities.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestUtilities.cs
@@ -2,7 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using System.Diagnostics;
using Xunit;
using System;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs
index f9d1ffd2fd..3e313266e8 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsEventSourceLifetime.cs
@@ -8,7 +8,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using System.Reflection;
namespace BasicEventSourceTests
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs
index 26d6f21d4c..927deb0d0e 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.cs
@@ -7,12 +7,15 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
using System.Reflection;
-//using Mdt = MdtEventSources;
-using Sdt = SdtEventSources;
+using SdtEventSources;
using System.Diagnostics;
using System.Threading;
using System.Text.RegularExpressions;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs
index 13b392930e..922168d8b8 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestNegative.cs
@@ -9,7 +9,11 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
using Sdt = SdtEventSources;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs
index f293f21375..a6fd649094 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsTraits.cs
@@ -2,7 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
using System;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs
index 58dae42aaf..53ee612922 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsUserErrors.cs
@@ -2,7 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
using System;
using System.Collections.Generic;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs
index 207cbd0ea2..5743bbe8d8 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWrite.cs
@@ -7,7 +7,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using Xunit;
#if USE_ETW // TODO: Enable when TraceEvent is available on CoreCLR. GitHub issue #4864.
using Microsoft.Diagnostics.Tracing.Session;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs
index 1f8761680d..080f6d7242 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEvent.cs
@@ -11,7 +11,11 @@ using System.Threading.Tasks;
using System.Threading;
using Xunit;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using System.Text.RegularExpressions;
using System.Diagnostics;
using SdtEventSources;
diff --git a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
index 1cc1125c7d..4cbc1c20d1 100644
--- a/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
+++ b/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
@@ -8,7 +8,11 @@ using System.Linq;
using System.Text;
using Xunit;
using System.Threading;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
using SdtEventSources;
namespace BasicEventSourceTests
diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs
index 9757329e4b..6261ab7a4a 100644
--- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs
+++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/EventSourceTest.cs
@@ -5,7 +5,11 @@
using System;
using System.Linq;
using System.Diagnostics;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
// We wish to test both Microsoft.Diagnostics.Tracing (Nuget)
// and System.Diagnostics.Tracing (Framework), we use this Ifdef make each kind
diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidCallsToWriteEvent.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidCallsToWriteEvent.cs
index a2883364d0..4d1939d2ed 100644
--- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidCallsToWriteEvent.cs
+++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidCallsToWriteEvent.cs
@@ -3,7 +3,11 @@
// See the LICENSE file in the project root for more information.
using System;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
// We wish to test both Microsoft.Diagnostics.Tracing (Nuget)
// and System.Diagnostics.Tracing (Framework), we use this Ifdef make each kind
diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidEventSources.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidEventSources.cs
index cac5b01e57..df49cf895d 100644
--- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidEventSources.cs
+++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/InvalidEventSources.cs
@@ -3,7 +3,11 @@
// See the LICENSE file in the project root for more information.
using System;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
// We wish to test both Microsoft.Diagnostics.Tracing (Nuget)
// and System.Diagnostics.Tracing (Framework), we use this Ifdef make each kind
diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/SimpleEventSource.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/SimpleEventSource.cs
index c4a416fea6..30776897b0 100644
--- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/SimpleEventSource.cs
+++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/SimpleEventSource.cs
@@ -5,7 +5,11 @@
// #define FEATURE_ADVANCED_MANAGED_ETW_CHANNELS
using System;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
// We wish to test both Microsoft.Diagnostics.Tracing (Nuget)
// and System.Diagnostics.Tracing (Framework), we use this Ifdef make each kind
@@ -17,7 +21,11 @@ namespace SdtEventSources
namespace DontPollute
{
public sealed class EventSource :
+#if USE_MDT_EVENTSOURCE
+ Microsoft.Diagnostics.Tracing.EventSource
+#else
System.Diagnostics.Tracing.EventSource
+#endif
{
[Event(1)]
public void EventWrite(int i) { this.WriteEvent(1, i); }
diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseAbstractEventSource.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseAbstractEventSource.cs
index 74044f409c..2e6bebbe2a 100644
--- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseAbstractEventSource.cs
+++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseAbstractEventSource.cs
@@ -4,7 +4,11 @@
using System;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
// We wish to test both Microsoft.Diagnostics.Tracing (Nuget)
// and System.Diagnostics.Tracing (Framework), we use this Ifdef make each kind
diff --git a/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseInterfaceEventSource.cs b/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseInterfaceEventSource.cs
index f77edd0991..59aa528d99 100644
--- a/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseInterfaceEventSource.cs
+++ b/src/System.Diagnostics.Tracing/tests/CustomEventSources/UseInterfaceEventSource.cs
@@ -4,7 +4,11 @@
using System;
+#if USE_MDT_EVENTSOURCE
+using Microsoft.Diagnostics.Tracing;
+#else
using System.Diagnostics.Tracing;
+#endif
// We wish to test both Microsoft.Diagnostics.Tracing (Nuget)
// and System.Diagnostics.Tracing (Framework), we use this Ifdef make each kind