Skip to content

Commit

Permalink
Fix running tests with UWP (#2047)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored Jan 3, 2024
1 parent 0cce9bc commit 3222493
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 54,10 @@

<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI\PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI\PublicAPI.Unshipped.txt" />
<AdditionalFiles Include="PublicAPI\uap10.0.16299\PublicAPI.Shipped.txt" Condition=" '$(TargetFramework)' == '$(UwpMinimum)' " />
<AdditionalFiles Include="PublicAPI\uap10.0.16299\PublicAPI.Unshipped.txt" Condition=" '$(TargetFramework)' == '$(UwpMinimum)' " />
<AdditionalFiles Include="PublicAPI\PublicAPI.Shipped.txt" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " />
<AdditionalFiles Include="PublicAPI\PublicAPI.Unshipped.txt" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " />
<Compile Update="Resources\Resource.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -1,6 1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using System.Diagnostics;
using System.Reflection;

Expand Down Expand Up @@ -74,3 75,4 @@ protected override Task SynchronizedRunTestsAsync(VSTestRunTestExecutionRequest
return Task.CompletedTask;
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,6 1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
namespace Microsoft.Testing.Platform.Extensions.MSTest;

internal sealed class MSTestExtension : IExtension
Expand All @@ -15,3 16,4 @@ internal sealed class MSTestExtension : IExtension

public Task<bool> IsEnabledAsync() => Task.FromResult(true);
}
#endif
Original file line number Diff line number Diff line change
@@ -1,6 1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using System.Reflection;

using Microsoft.Testing.Platform.Builder;
Expand All @@ -23,3 24,4 @@ public static void AddMSTest(this ITestApplicationBuilder testApplicationBuilder
(capabilities, serviceProvider) => new MSTestBridgedTestFramework(extension, getTestAssemblies, serviceProvider, capabilities));
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,6 1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using System.Reflection;

using Microsoft.Testing.Platform.Builder;
Expand All @@ -17,3 18,4 @@ public static void AddExtensions(ITestApplicationBuilder testApplicationBuilder,
testApplicationBuilder.AddMSTest(() => new[] { Assembly.GetEntryAssembly()! });
}
}
#endif

0 comments on commit 3222493

Please sign in to comment.