Skip to content

Commit 001a29d

Browse files
committed
Make obsolete only on release (#4353)
1 parent 940c320 commit 001a29d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+94
-10
lines changed

src/Adapter/MSTest.TestAdapter/Execution/LogMessageListener.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution;
1414
/// Listens for log messages and Debug.WriteLine
1515
/// Note that this class is not thread-safe and thus should only be used when unit tests are being run serially.
1616
/// </summary>
17+
#if RELEASE
1718
#if NET6_0_OR_GREATER
1819
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
1920
#else
2021
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2122
#endif
23+
#endif
2224
public class LogMessageListener : IDisposable
2325
{
2426
private static readonly Lock TraceLock = new();

src/Adapter/MSTest.TestAdapter/Execution/TestAssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution;
1818
/// <summary>
1919
/// Defines TestAssembly Info object.
2020
/// </summary>
21+
#if RELEASE
2122
#if NET6_0_OR_GREATER
2223
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
2324
#else
2425
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2526
#endif
27+
#endif
2628
public class TestAssemblyInfo
2729
{
2830
private readonly Lock _assemblyInfoExecuteSyncObject = new();

src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution;
2020
/// <summary>
2121
/// Defines the TestClassInfo object.
2222
/// </summary>
23+
#if RELEASE
2324
#if NET6_0_OR_GREATER
2425
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
2526
#else
2627
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2728
#endif
29+
#endif
2830
public class TestClassInfo
2931
{
3032
private readonly Lock _testClassExecuteSyncObject = new();

src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution;
1919
/// <summary>
2020
/// Class responsible for execution of tests at assembly level and sending tests via framework handle.
2121
/// </summary>
22+
#if RELEASE
2223
#if NET6_0_OR_GREATER
2324
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
2425
#else
2526
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2627
#endif
28+
#endif
2729
public class TestExecutionManager
2830
{
2931
/// <summary>

src/Adapter/MSTest.TestAdapter/Execution/TestMethodInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution;
2121
/// <summary>
2222
/// Defines the TestMethod Info object.
2323
/// </summary>
24+
#if RELEASE
2425
#if NET6_0_OR_GREATER
2526
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
2627
#else
2728
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2829
#endif
30+
#endif
2931
public class TestMethodInfo : ITestMethod
3032
{
3133
/// <summary>

src/Adapter/MSTest.TestAdapter/Execution/TestRunCancellationToken.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;
88
/// <summary>
99
/// Cancellation token supporting cancellation of a test run.
1010
/// </summary>
11+
#if RELEASE
1112
#if NET6_0_OR_GREATER
1213
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
1314
#else
1415
[Obsolete(Constants.PublicTypeObsoleteMessage)]
1516
#endif
17+
#endif
1618
public class TestRunCancellationToken
1719
{
1820
/// <summary>

src/Adapter/MSTest.TestAdapter/Extensions/UnitTestOutcomeExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77

88
namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions;
99

10+
#if RELEASE
1011
#if NET6_0_OR_GREATER
1112
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
1213
#else
1314
[Obsolete(Constants.PublicTypeObsoleteMessage)]
1415
#endif
16+
#endif
1517
public static class UnitTestOutcomeExtensions
1618
{
1719
/// <summary>

src/Adapter/MSTest.TestAdapter/MSTestSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;
2020
/// Adapter Settings for the run.
2121
/// </summary>
2222
[Serializable]
23+
#if RELEASE
2324
#if NET6_0_OR_GREATER
2425
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
2526
#else
2627
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2728
#endif
29+
#endif
2830
public class MSTestSettings
2931
{
3032
/// <summary>

src/Adapter/MSTest.TestAdapter/ObjectModel/TestMethod.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
1616
/// <summary>
1717
/// TestMethod contains information about a unit test method that needs to be executed.
1818
/// </summary>
19+
#if RELEASE
1920
#if NET6_0_OR_GREATER
2021
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
2122
#else
2223
[Obsolete(Constants.PublicTypeObsoleteMessage)]
2324
#endif
25+
#endif
2426
[Serializable]
2527
public sealed class TestMethod : ITestMethod
2628
{

src/Adapter/MSTest.TestAdapter/ObjectModel/UnitTestOutcome.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
66
/// <summary>
77
/// Outcome of a test.
88
/// </summary>
9+
#if RELEASE
910
#if NET6_0_OR_GREATER
1011
[Obsolete(Constants.PublicTypeObsoleteMessage, DiagnosticId = "MSTESTOBS")]
1112
#else
1213
[Obsolete(Constants.PublicTypeObsoleteMessage)]
1314
#endif
15+
#endif
1416
public enum UnitTestOutcome : int
1517
{
1618
/// <summary>

0 commit comments

Comments
 (0)