Skip to content

Commit

Permalink
Add missing issues.targets from #36253 (#36351)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sdmaclea authored May 15, 2020
1 parent e350ee1 commit 0c40475
Show file tree
Hide file tree
Showing 6 changed files with 994 additions and 25 deletions.
955 changes: 955 additions & 0 deletions src/coreclr/tests/issues.targets

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ class Test
private const string PathEnvSubdirectoryName = "Subdirectory";
private const string PathEnvFileName = "MovedNativeLib";

#if TARGET_WINDOWS
private const string RelativePath1 = @".\RelativeNative\..\DllImportPath_Relative";
private const string RelativePath3 = @"..\DllImportPathTest\DllImportPath_Relative";
#else
private const string RelativePath1 = @"./RelativeNative/../libDllImportPath_Relative";
private const string RelativePath3 = @"../DllImportPathTest/libDllImportPath_Relative";
#endif
private const string RelativePath1Windows = @".\RelativeNative\..\DllImportPath_Relative";
private const string RelativePath3Windows = @"..\DllImportPathTest\DllImportPath_Relative";

private const string RelativePath1Unix = @"./RelativeNative/../libDllImportPath_Relative";
private const string RelativePath3Unix = @"../DllImportPathTest/libDllImportPath_Relative";

private const string UnicodeFileName = "DllImportPath_Unicode✔";

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

[DllImport(RelativePath1, EntryPoint = "GetZero")]
private static extern int GetZero_Relative1();
[DllImport(RelativePath1Windows, EntryPoint = "GetZero")]
private static extern int GetZero_Relative1Windows();

[DllImport(RelativePath1Unix, EntryPoint = "GetZero")]
private static extern int GetZero_Relative1Unix();

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

[DllImport(RelativePath3, EntryPoint = "GetZero")]
private static extern int GetZero_Relative3();
[DllImport(RelativePath3Windows, EntryPoint = "GetZero")]
private static extern int GetZero_Relative3Windows();

[DllImport(RelativePath3Unix, EntryPoint = "GetZero")]
private static extern int GetZero_Relative3Unix();

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

if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // We need to ensure that the subdirectory exists for off-Windows.
if (!isWindows) // We need to ensure that the subdirectory exists for off-Windows.
{
var currentDirectory = Directory.GetCurrentDirectory();
var info = new DirectoryInfo(currentDirectory);
info.CreateSubdirectory(RelativeSubdirectoryName);
}

GetZero_Relative1();
if (isWindows)
{
GetZero_Relative1Windows();
}
else
{
GetZero_Relative1Unix();
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
GetZero_Relative2();
}

GetZero_Relative3();
if (isWindows)
{
GetZero_Relative3Windows();
}
else
{
GetZero_Relative3Unix();
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetPathOfFileAbove(TypeEquivalence.props))" />
<PropertyGroup>
<OutputType>Library</OutputType>
<!-- The Type Equivalence feature is unsupported outside of windows -->
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
</PropertyGroup>
<ItemGroup>
<Compile Include="Types.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetPathOfFileAbove(TypeEquivalence.props))" />
<PropertyGroup>
<OutputType>Library</OutputType>
<!-- The Type Equivalence feature is unsupported outside of windows -->
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
</PropertyGroup>
<ItemGroup>
<Compile Include="Impls.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetPathOfFileAbove(TypeEquivalence.props))" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- The Type Equivalence feature is unsupported outside of windows -->
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
</PropertyGroup>
<ItemGroup>
<Compile Include="Simple.cs" />
Expand Down

0 comments on commit 0c40475

Please sign in to comment.