[mmptest] Remove the link-gdiplus-1/2 tests, they can't be ported to Unified. Partial fix for #4975. (#6497)

These tests verify that a linked project that references Bitmap[Data] from
System.Drawing ends up with a libgdiplus.dylib (or not) in the .app.

The problem when porting to Unified is that the only way to depend on
libgdiplus.dylib is using the system mono, and in that mode mmp doesn't allow
linking.

So just remove these tests.

Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975.
This commit is contained in:
Rolf Bjarne Kvinge 2019-07-05 09:39:48 +02:00 коммит произвёл GitHub
Родитель 22b5ac5653
Коммит 9d74fb68d1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 0 добавлений и 332 удалений

Просмотреть файл

@ -11,8 +11,6 @@ export XamarinMacFrameworkRoot=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.fra
TESTS_4_0 = \ TESTS_4_0 = \
link-gdiplus-1 \
link-gdiplus-2 \
link-posix-1 \ link-posix-1 \
link-posix-2 \ link-posix-2 \
link-system.web-icalls \ link-system.web-icalls \

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.link-gdiplus-1</string>
<key>CFBundleName</key>
<string>link-gdiplus-1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -1,46 +0,0 @@
using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
// Test
// * application references System.Drawing
// * application creates a Bitmap which pinvoke into gdiplus
// * linker includes libgdiplus.dylib in the application bundle
//
// Requirement
// * Link SDK or Link All must be enabled
namespace Xamarin.Mac.Linker.Test {
class GdiPlus1 {
static void Main (string[] args)
{
NSApplication.Init ();
Test.EnsureLinker (true);
bool gdiplus = false;
string msg = "Bitmap created";
try {
Bitmap b = new Bitmap (32, 32);
gdiplus = (b != null);
}
catch (Exception e) {
msg = e.ToString ();
}
Test.Log.WriteLine ("{0}\t{1}", gdiplus ? "[PASS]" : "[FAIL]", msg);
string path = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
bool bundled = File.Exists (Path.Combine (path, "libgdiplus.dylib"));
Test.Log.WriteLine ("{0}\t{1}", bundled ? "[PASS]" : "[FAIL]", "libgdiplus present in bundle");
Test.Terminate ();
}
}
}

Просмотреть файл

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}</ProjectGuid>
<ProjectTypeGuids>{42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>linkgdiplus1</RootNamespace>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
<AssemblyName>link-gdiplus-1</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IncludeMonoRuntime>True</IncludeMonoRuntime>
<EnablePackageSigning>False</EnablePackageSigning>
<CreatePackage>False</CreatePackage>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<EnableCodeSigning>False</EnableCodeSigning>
<ConsolePause>False</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
<I18n>
</I18n>
<LinkMode>Full</LinkMode>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LinkMode>Full</LinkMode>
<IncludeMonoRuntime>False</IncludeMonoRuntime>
<EnablePackageSigning>False</EnablePackageSigning>
<CreatePackage>False</CreatePackage>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<EnableCodeSigning>False</EnableCodeSigning>
<ConsolePause>False</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|x86' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\x86\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LinkMode>Full</LinkMode>
<IncludeMonoRuntime>True</IncludeMonoRuntime>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
<EnablePackageSigning>True</EnablePackageSigning>
<CreatePackage>True</CreatePackage>
<CodeSigningKey>3rd Party Mac Developer Application</CodeSigningKey>
<EnableCodeSigning>True</EnableCodeSigning>
<ConsolePause>False</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="XamMac">
<HintPath>..\..\..\..\src\build\compat\XamMac.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
<ItemGroup>
<Compile Include="LinkGdiPlus1.cs" />
<Compile Include="..\common\Test.cs">
<Link>Test.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="..\common\MainMenu.xib">
<Link>MainMenu.xib</Link>
</InterfaceDefinition>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.link-gdiplus-2</string>
<key>CFBundleName</key>
<string>link-gdiplus-2</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

Просмотреть файл

@ -1,38 +0,0 @@
using System;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
// Test
// * application references System.Drawing.BitmapData
// * linker must include all the private fields of the class (used or not)
// * linker does NOT include libgdiplus.dylib in the application bundle
//
// Requirement
// * Link SDK or Link All must be enabled
namespace Xamarin.Mac.Linker.Test {
class GdiPlus2 {
static void Main (string[] args)
{
NSApplication.Init ();
Test.EnsureLinker (true);
int fcount = typeof (BitmapData).GetFields (BindingFlags.NonPublic | BindingFlags.Instance).Length;
Test.Log.WriteLine ("{0}\tBitmapData {1}/17 fields protected by linker", fcount == 17 ? "[PASS]" : "[FAIL]", fcount);
// there's no [DllImport] on BitmapData so libgdiplus.dylib should not be copied into the bundle
string path = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
bool bundled = File.Exists (Path.Combine (path, "libgdiplus.dylib"));
Test.Log.WriteLine ("{0}\t{1}", !bundled ? "[PASS]" : "[FAIL]", "libgdiplus not present in bundle");
Test.Terminate ();
}
}
}

Просмотреть файл

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}</ProjectGuid>
<ProjectTypeGuids>{42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>linkgdiplus2</RootNamespace>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
<AssemblyName>link-gdiplus-2</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IncludeMonoRuntime>True</IncludeMonoRuntime>
<EnablePackageSigning>False</EnablePackageSigning>
<CreatePackage>False</CreatePackage>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<EnableCodeSigning>False</EnableCodeSigning>
<ConsolePause>False</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
<I18n>
</I18n>
<LinkMode>Full</LinkMode>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LinkMode>Full</LinkMode>
<IncludeMonoRuntime>False</IncludeMonoRuntime>
<EnablePackageSigning>False</EnablePackageSigning>
<CreatePackage>False</CreatePackage>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<EnableCodeSigning>False</EnableCodeSigning>
<ConsolePause>False</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|x86' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\x86\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LinkMode>Full</LinkMode>
<IncludeMonoRuntime>True</IncludeMonoRuntime>
<PackageSigningKey>3rd Party Mac Developer Installer</PackageSigningKey>
<EnablePackageSigning>True</EnablePackageSigning>
<CreatePackage>True</CreatePackage>
<CodeSigningKey>3rd Party Mac Developer Application</CodeSigningKey>
<EnableCodeSigning>True</EnableCodeSigning>
<ConsolePause>False</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<UseSGen>false</UseSGen>
<UseRefCounting>false</UseRefCounting>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="XamMac">
<HintPath>..\..\..\..\src\build\compat\XamMac.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
<ItemGroup>
<InterfaceDefinition Include="..\common\MainMenu.xib">
<Link>MainMenu.xib</Link>
</InterfaceDefinition>
</ItemGroup>
<ItemGroup>
<Compile Include="..\common\Test.cs">
<Link>Test.cs</Link>
</Compile>
<Compile Include="LinkGdiPlus2.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -5,8 +5,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-posix-1", "link-posix-
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-posix-2", "link-posix-2\link-posix-2.csproj", "{141239A4-4094-4349-A3F3-00CD16643226}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-posix-2", "link-posix-2\link-posix-2.csproj", "{141239A4-4094-4349-A3F3-00CD16643226}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-gdiplus-1", "link-gdiplus-1\link-gdiplus-1.csproj", "{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-1", "link-webclient-1\link-webclient-1.csproj", "{148DC17B-B29F-48A7-97CD-EECE26015B25}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-1", "link-webclient-1\link-webclient-1.csproj", "{148DC17B-B29F-48A7-97CD-EECE26015B25}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-2", "link-webclient-2\link-webclient-2.csproj", "{FA5882C9-C02D-4C7B-963B-AEA929D01390}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-2", "link-webclient-2\link-webclient-2.csproj", "{FA5882C9-C02D-4C7B-963B-AEA929D01390}"
@ -17,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-httpclient-async", "li
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-3", "link-webclient-3\link-webclient-3.csproj", "{359E3AA4-A0E2-41A5-A5C5-03D322B71FE4}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-3", "link-webclient-3\link-webclient-3.csproj", "{359E3AA4-A0E2-41A5-A5C5-03D322B71FE4}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-gdiplus-2", "link-gdiplus-2\link-gdiplus-2.csproj", "{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-system.web-icalls", "link-system.web-icalls\link-system.web-icalls.csproj", "{6F2CC0E5-BE6A-4B96-AEDE-1A6EFE517166}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-system.web-icalls", "link-system.web-icalls\link-system.web-icalls.csproj", "{6F2CC0E5-BE6A-4B96-AEDE-1A6EFE517166}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-keep-resources-1", "link-keep-resources-1\link-keep-resources-1.csproj", "{0A4EBB71-92E1-448C-BAA6-DFFB9491D8A0}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-keep-resources-1", "link-keep-resources-1\link-keep-resources-1.csproj", "{0A4EBB71-92E1-448C-BAA6-DFFB9491D8A0}"
@ -90,12 +86,6 @@ Global
{148DC17B-B29F-48A7-97CD-EECE26015B25}.Debug|x86.Build.0 = Debug|x86 {148DC17B-B29F-48A7-97CD-EECE26015B25}.Debug|x86.Build.0 = Debug|x86
{148DC17B-B29F-48A7-97CD-EECE26015B25}.Release|x86.ActiveCfg = Release|x86 {148DC17B-B29F-48A7-97CD-EECE26015B25}.Release|x86.ActiveCfg = Release|x86
{148DC17B-B29F-48A7-97CD-EECE26015B25}.Release|x86.Build.0 = Release|x86 {148DC17B-B29F-48A7-97CD-EECE26015B25}.Release|x86.Build.0 = Release|x86
{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}.AppStore|x86.ActiveCfg = AppStore|x86
{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}.AppStore|x86.Build.0 = AppStore|x86
{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}.Debug|x86.ActiveCfg = Debug|x86
{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}.Debug|x86.Build.0 = Debug|x86
{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}.Release|x86.ActiveCfg = Release|x86
{150FA3E6-0AFA-417E-A7FA-B13E95B46CF0}.Release|x86.Build.0 = Release|x86
{1F4422A4-C6B2-49B5-BB1D-6CA4676397CA}.AppStore|x86.ActiveCfg = AppStore|x86 {1F4422A4-C6B2-49B5-BB1D-6CA4676397CA}.AppStore|x86.ActiveCfg = AppStore|x86
{1F4422A4-C6B2-49B5-BB1D-6CA4676397CA}.AppStore|x86.Build.0 = AppStore|x86 {1F4422A4-C6B2-49B5-BB1D-6CA4676397CA}.AppStore|x86.Build.0 = AppStore|x86
{1F4422A4-C6B2-49B5-BB1D-6CA4676397CA}.Debug|x86.ActiveCfg = Debug|x86 {1F4422A4-C6B2-49B5-BB1D-6CA4676397CA}.Debug|x86.ActiveCfg = Debug|x86
@ -198,12 +188,6 @@ Global
{CA9DCC2E-8DD6-4E73-A5E4-980028A9436C}.Debug|x86.Build.0 = Debug|x86 {CA9DCC2E-8DD6-4E73-A5E4-980028A9436C}.Debug|x86.Build.0 = Debug|x86
{CA9DCC2E-8DD6-4E73-A5E4-980028A9436C}.Release|x86.ActiveCfg = Release|x86 {CA9DCC2E-8DD6-4E73-A5E4-980028A9436C}.Release|x86.ActiveCfg = Release|x86
{CA9DCC2E-8DD6-4E73-A5E4-980028A9436C}.Release|x86.Build.0 = Release|x86 {CA9DCC2E-8DD6-4E73-A5E4-980028A9436C}.Release|x86.Build.0 = Release|x86
{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}.AppStore|x86.ActiveCfg = AppStore|x86
{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}.AppStore|x86.Build.0 = AppStore|x86
{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}.Debug|x86.ActiveCfg = Debug|x86
{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}.Debug|x86.Build.0 = Debug|x86
{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}.Release|x86.ActiveCfg = Release|x86
{CB3AC1BE-2C81-4CAF-A9AA-5838816CA705}.Release|x86.Build.0 = Release|x86
{CCE59D9C-CA71-4DB8-8156-98D7A9428534}.AppStore|x86.ActiveCfg = AppStore|Any CPU {CCE59D9C-CA71-4DB8-8156-98D7A9428534}.AppStore|x86.ActiveCfg = AppStore|Any CPU
{CCE59D9C-CA71-4DB8-8156-98D7A9428534}.AppStore|x86.Build.0 = AppStore|Any CPU {CCE59D9C-CA71-4DB8-8156-98D7A9428534}.AppStore|x86.Build.0 = AppStore|Any CPU
{CCE59D9C-CA71-4DB8-8156-98D7A9428534}.Debug|x86.ActiveCfg = Debug|Any CPU {CCE59D9C-CA71-4DB8-8156-98D7A9428534}.Debug|x86.ActiveCfg = Debug|Any CPU