Skip to content

Commit d303408

Browse files
committed
The collection definitions must be in the same assembly as the test that uses them
1 parent 0d9fa77 commit d303408

File tree

13 files changed

+30
-2
lines changed

13 files changed

+30
-2
lines changed

src/libraries/Common/tests/TestUtilities/System/DisableParallelization.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace System
77
{
8+
// The collection definitions must be in the same assembly as the test that uses them.
9+
// So please use "Compile Include" in the project file to include this class.
810
[CollectionDefinition(nameof(DisableParallelization), DisableParallelization = true)]
911
public class DisableParallelization { }
1012
}

src/libraries/Common/tests/TestUtilities/TestUtilities.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<Compile Include="System\AdminHelpers.cs" />
1919
<Compile Include="System\AssertExtensions.cs" />
2020
<Compile Include="System\IO\StreamExtensions.cs" />
21-
<Compile Include="System\DisableParallelization.cs" />
2221
<Compile Include="System\RetryHelper.cs" />
2322
<Compile Include="System\Buffers\BoundedMemory.cs" />
2423
<Compile Include="System\Buffers\BoundedMemory.Creation.cs" />

src/libraries/System.ComponentModel.TypeConverter/tests/System.ComponentModel.TypeConverter.Tests.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@
152152
<Compile Include="Design\DesignerTransactionTests.cs" />
153153
<Compile Include="Security\Authentication\ExtendedProtection\ExtendedProtectionPolicyTypeConverterTests.cs" />
154154
<Compile Include="XTypeDescriptionProviderTests.cs" />
155-
155+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
156+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
157+
Link="Common\TestUtilities\System\DisableParallelization.cs" />
156158
<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
157159
</ItemGroup>
158160
<ItemGroup>

src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
Link="Common\System\IO\TempFile.cs" />
3636
<Compile Include="$(CommonTestPath)System\IO\TempDirectory.cs"
3737
Link="Common\System\IO\TempDirectory.cs" />
38+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
39+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
40+
Link="Common\TestUtilities\System\DisableParallelization.cs" />
3841
</ItemGroup>
3942
<ItemGroup Condition="'$(TargetsLinux)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
4043
<Compile Include="FileSystemWatcher.Unix.cs" />

src/libraries/System.IO.FileSystem/tests/DisabledFileLockingTests/System.IO.FileSystem.DisabledFileLocking.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<Compile Include="..\PortedCommon\IOInputs.cs" />
2121
<Compile Include="..\PortedCommon\IOServices.cs" />
2222
<Compile Include="$(CommonTestPath)System\IO\PathFeatures.cs" Link="Common\System\IO\PathFeatures.cs" />
23+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
24+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs" Link="Common\TestUtilities\System\DisableParallelization.cs" />
2325
</ItemGroup>
2426
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
2527
<Compile Remove="..\**\*.Windows.cs" />

src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@
217217
<Compile Include="$(CommonTestPath)System\IO\PathFeatures.cs" Link="Common\System\IO\PathFeatures.cs" />
218218
<Content Include="DirectoryInfo\test-dir\dummy.txt" Link="test-dir\dummy.txt" />
219219
<Compile Include="$(CommonPath)System\IO\PathInternal.CaseSensitivity.cs" Link="Common\System\IO\PathInternal.CaseSensitivity.cs" />
220+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
221+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs" Link="Common\TestUtilities\System\DisableParallelization.cs" />
220222
</ItemGroup>
221223
<ItemGroup>
222224
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />

src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@
133133
Link="Common\System\Net\Http\HttpClientHandlerTest.Cookies.cs" />
134134
<Compile Include="$(CommonTestPath)System\Net\Http\HttpClientHandlerTest.DefaultProxyCredentials.cs"
135135
Link="Common\System\Net\Http\HttpClientHandlerTest.DefaultProxyCredentials.cs" />
136+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
137+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
138+
Link="Common\TestUtilities\System\DisableParallelization.cs" />
136139
<Compile Include="HttpClientHandlerTest.AltSvc.cs" />
137140
<Compile Include="SocketsHttpHandlerTest.Cancellation.cs" />
138141
<Compile Include="SocketsHttpHandlerTest.Http2FlowControl.cs" />

src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
Link="Common\System\Net\Configuration.Sockets.cs" />
2525
<Compile Include="$(CommonTestPath)System\Diagnostics\Tracing\TestEventListener.cs"
2626
Link="Common\System\Diagnostics\Tracing\TestEventListener.cs" />
27+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
28+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
29+
Link="Common\TestUtilities\System\DisableParallelization.cs" />
2730
</ItemGroup>
2831
</Project>

src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Functional.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<Compile Include="$(CommonTestPath)System\Security\Cryptography\X509Certificates\CertificateAuthority.cs" Link="CommonTest\System\Security\Cryptography\X509Certificates\CertificateAuthority.cs" />
2323
<Compile Include="$(CommonTestPath)System\Security\Cryptography\X509Certificates\RevocationResponder.cs" Link="CommonTest\System\Security\Cryptography\X509Certificates\RevocationResponder.cs" />
2424
<Compile Include="$(CommonTestPath)System\Threading\Tasks\TaskTimeoutExtensions.cs" Link="TestCommon\System\Threading\Tasks\TaskTimeoutExtensions.cs" />
25+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
26+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs" Link="Common\TestUtilities\System\DisableParallelization.cs" />
2527
<Compile Include="..\..\..\System.Net.Security\tests\FunctionalTests\TestHelper.cs" />
2628
</ItemGroup>
2729
<ItemGroup>

src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
9898
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
9999
<Compile Include="$(CommonTestPath)System\IO\TempFile.cs" Link="Common\System\IO\TempFile.cs" />
100+
<!-- The collection definitions must be in the same assembly as the test that uses them -->
101+
<Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
102+
Link="Common\TestUtilities\System\DisableParallelization.cs" />
100103
</ItemGroup>
101104
<ItemGroup>
102105
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />

0 commit comments

Comments
 (0)