Skip to content

Commit 8400fea

Browse files
authored
Fixes some annoyances with running tests from VS (#3017)
* Fixes some annoyances with running tests from VS * Insert spaces instead of tabs
1 parent 8eafee9 commit 8400fea

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

Tests/Realm.Tests/Realm.Tests.csproj

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<UnityBuild>false</UnityBuild>
4-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<!--
5+
The Visual Studio Run Tests context menu command (Ctrl+R, T) always picks the first target framework
6+
in the project file, but the NUnit test adapter doesn't support .NET Standard 2.0, so it should never be
7+
first in the list.
8+
-->
59
<TargetFrameworks Condition="'$(MSBuildVersion)' &gt;= '17.0'">$(TargetFrameworks);net6.0</TargetFrameworks>
610
<TargetFrameworks Condition="'$(RuntimeIdentifier)' != 'osx-arm64'">$(TargetFrameworks);netcoreapp3.1</TargetFrameworks>
711
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
12+
<TargetFrameworks>$(TargetFrameworks);netstandard2.0</TargetFrameworks>
813
<LangVersion>9.0</LangVersion>
914
<RootNamespace>Realms.Tests</RootNamespace>
1015
<IsTestProject>true</IsTestProject>
@@ -27,9 +32,10 @@
2732
<ItemGroup Condition="'$(UnityBuild)' != 'true'">
2833
<PackageReference Include="NUnit" Version="3.13.2" />
2934
<PackageReference Include="NUnitLite" Version="3.13.2" />
30-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"
35+
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"
3136
Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' OR '$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
3237
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
38+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
3339
</ItemGroup>
3440

3541
<ItemGroup Condition="'$(UnityBuild)' == 'true'">
@@ -93,16 +99,20 @@
9399
</ItemGroup>
94100

95101
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(UseRealmNupkgsWithVersion)' == ''">
96-
<None Include="..\..\wrappers\build\Darwin\$(Configuration)\librealm-wrappers.dylib" Condition="$(RuntimeIdentifier.StartsWith('osx'))">
97-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
102+
<None Include="..\..\wrappers\build\Darwin\$(Configuration)\librealm-wrappers.dylib"
103+
Condition="$([MSBuild]::IsOsPlatform('OSX'))">
104+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
98105
</None>
99-
<None Include="..\..\wrappers\build\Linux\$(Configuration)\librealm-wrappers.so" Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
106+
<None Include="..\..\wrappers\build\Linux\$(Configuration)\librealm-wrappers.so"
107+
Condition="$([MSBuild]::IsOsPlatform('Linux')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64' ">
100108
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
101109
</None>
102-
<None Include="..\..\wrappers\build\Windows\$(Configuration)-x64\realm-wrappers.dll" Condition="'$(RuntimeIdentifier)' == 'win-x64'">
110+
<None Include="..\..\wrappers\build\Windows\$(Configuration)-x64\realm-wrappers.dll"
111+
Condition="$([MSBuild]::IsOsPlatform('Windows')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64' ">
103112
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
104113
</None>
105-
<None Include="..\..\wrappers\build\Windows\$(Configuration)-arm64\realm-wrappers.dll" Condition="'$(RuntimeIdentifier)' == 'win-arm64'">
114+
<None Include="..\..\wrappers\build\Windows\$(Configuration)-arm64\realm-wrappers.dll"
115+
Condition="$([MSBuild]::IsOsPlatform('Windows')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64' ">
106116
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
107117
</None>
108118
</ItemGroup>

0 commit comments

Comments
 (0)