Skip to content

Commit 0c40475

Browse files
authored
Add missing issues.targets from #36253 (#36351)
* Add missing issues.targets from #36253 PR #36253 enabled building all tests on OSX. It was intended to include this list of tests to disable on unsupported platforms. This was dropped as part of rebasing for dev/infra branch. Lack of CI on dev/infra allowed this to be missed. * Revise issues.targets * Add src/coreclr/tests/src/baseservices/typeequivalence/simple * Remove #if Windows from DllImportPathTest
1 parent e350ee1 commit 0c40475

6 files changed

Lines changed: 994 additions & 25 deletions

File tree

src/coreclr/tests/issues.targets

Lines changed: 955 additions & 0 deletions
Large diffs are not rendered by default.

src/coreclr/tests/src/Interop/DllImportAttribute/DllImportPath/DllImportPathTest.cs

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ class Test
1313
private const string PathEnvSubdirectoryName = "Subdirectory";
1414
private const string PathEnvFileName = "MovedNativeLib";
1515

16-
#if TARGET_WINDOWS
17-
private const string RelativePath1 = @".\RelativeNative\..\DllImportPath_Relative";
18-
private const string RelativePath3 = @"..\DllImportPathTest\DllImportPath_Relative";
19-
#else
20-
private const string RelativePath1 = @"./RelativeNative/../libDllImportPath_Relative";
21-
private const string RelativePath3 = @"../DllImportPathTest/libDllImportPath_Relative";
22-
#endif
16+
private const string RelativePath1Windows = @".\RelativeNative\..\DllImportPath_Relative";
17+
private const string RelativePath3Windows = @"..\DllImportPathTest\DllImportPath_Relative";
18+
19+
private const string RelativePath1Unix = @"./RelativeNative/../libDllImportPath_Relative";
20+
private const string RelativePath3Unix = @"../DllImportPathTest/libDllImportPath_Relative";
2321

2422
private const string UnicodeFileName = "DllImportPath_Unicode✔";
2523

@@ -35,14 +33,20 @@ class Test
3533
[DllImport(@".\DllImportPath.Local.dll", EntryPoint = "GetZero")]
3634
private static extern int GetZero_LocalWithDot2();
3735

38-
[DllImport(RelativePath1, EntryPoint = "GetZero")]
39-
private static extern int GetZero_Relative1();
36+
[DllImport(RelativePath1Windows, EntryPoint = "GetZero")]
37+
private static extern int GetZero_Relative1Windows();
38+
39+
[DllImport(RelativePath1Unix, EntryPoint = "GetZero")]
40+
private static extern int GetZero_Relative1Unix();
4041

4142
[DllImport(@"..\DllImportPathTest\DllImportPath_Relative.dll", EntryPoint = "GetZero")]
4243
private static extern int GetZero_Relative2();
4344

44-
[DllImport(RelativePath3, EntryPoint = "GetZero")]
45-
private static extern int GetZero_Relative3();
45+
[DllImport(RelativePath3Windows, EntryPoint = "GetZero")]
46+
private static extern int GetZero_Relative3Windows();
47+
48+
[DllImport(RelativePath3Unix, EntryPoint = "GetZero")]
49+
private static extern int GetZero_Relative3Unix();
4650

4751
[DllImport(@".\..\DllImportPathTest\DllImportPath_Relative.dll", EntryPoint = "GetZero")]
4852
private static extern int GetZero_Relative4();
@@ -77,22 +81,37 @@ static void TestNativeLibraryProbingOnRelativePath()
7781
{
7882
string strManaged = "Managed";
7983
string native = " Native";
84+
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
8085

81-
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // We need to ensure that the subdirectory exists for off-Windows.
86+
if (!isWindows) // We need to ensure that the subdirectory exists for off-Windows.
8287
{
8388
var currentDirectory = Directory.GetCurrentDirectory();
8489
var info = new DirectoryInfo(currentDirectory);
8590
info.CreateSubdirectory(RelativeSubdirectoryName);
8691
}
8792

88-
GetZero_Relative1();
93+
if (isWindows)
94+
{
95+
GetZero_Relative1Windows();
96+
}
97+
else
98+
{
99+
GetZero_Relative1Unix();
100+
}
89101

90102
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
91103
{
92104
GetZero_Relative2();
93105
}
94106

95-
GetZero_Relative3();
107+
if (isWindows)
108+
{
109+
GetZero_Relative3Windows();
110+
}
111+
else
112+
{
113+
GetZero_Relative3Unix();
114+
}
96115

97116
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
98117
{

src/coreclr/tests/src/baseservices/typeequivalence/TypeEquivalence.props

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/coreclr/tests/src/baseservices/typeequivalence/contracts/TypeContracts.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="$([MSBuild]::GetPathOfFileAbove(TypeEquivalence.props))" />
32
<PropertyGroup>
43
<OutputType>Library</OutputType>
4+
<!-- The Type Equivalence feature is unsupported outside of windows -->
5+
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
56
</PropertyGroup>
67
<ItemGroup>
78
<Compile Include="Types.cs" />

src/coreclr/tests/src/baseservices/typeequivalence/impl/TypeImpl.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="$([MSBuild]::GetPathOfFileAbove(TypeEquivalence.props))" />
32
<PropertyGroup>
43
<OutputType>Library</OutputType>
4+
<!-- The Type Equivalence feature is unsupported outside of windows -->
5+
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
56
</PropertyGroup>
67
<ItemGroup>
78
<Compile Include="Impls.cs" />

src/coreclr/tests/src/baseservices/typeequivalence/simple/Simple.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="$([MSBuild]::GetPathOfFileAbove(TypeEquivalence.props))" />
32
<PropertyGroup>
43
<OutputType>Exe</OutputType>
4+
<!-- The Type Equivalence feature is unsupported outside of windows -->
5+
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
56
</PropertyGroup>
67
<ItemGroup>
78
<Compile Include="Simple.cs" />

0 commit comments

Comments
 (0)