From 740c3724e792e81d0c093ffe2e002dbba84e0e03 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 8 Jul 2019 08:21:38 -0700 Subject: [PATCH] [mmptest] Port link-posix-1 to Unified, and remove the link-posix-2 test. Partial fix for #4975. (#6509) link-posix-2 depends on Mono.Posix.dll and the behavior of the linker, but it's only possible to link XM Modern projects, but the Modern profile doesn't contain Mono.Posix.dll. Fixes part of https://github.com/xamarin/xamarin-macios/issues/4975. --- tests/mmptest/regression/Makefile | 3 +- .../regression/link-posix-1/LinkPosix1.cs | 8 +- .../link-posix-1/link-posix-1.csproj | 40 ++------ .../regression/link-posix-2/Info.plist | 20 ---- .../regression/link-posix-2/LinkPosix2.cs | 40 -------- .../link-posix-2/link-posix-2.csproj | 95 ------------------- tests/mmptest/regression/tests.sln | 8 -- 7 files changed, 12 insertions(+), 202 deletions(-) delete mode 100644 tests/mmptest/regression/link-posix-2/Info.plist delete mode 100644 tests/mmptest/regression/link-posix-2/LinkPosix2.cs delete mode 100644 tests/mmptest/regression/link-posix-2/link-posix-2.csproj diff --git a/tests/mmptest/regression/Makefile b/tests/mmptest/regression/Makefile index 76de6aff84..60b4972cc5 100644 --- a/tests/mmptest/regression/Makefile +++ b/tests/mmptest/regression/Makefile @@ -11,8 +11,6 @@ export XamarinMacFrameworkRoot=$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.fra TESTS_4_0 = \ - link-posix-1 \ - link-posix-2 \ link-keep-resources-1 \ link-preserve-assembly \ link-uithread-1 \ @@ -36,6 +34,7 @@ DISABLED_TESTS_MONO_4_4 = \ link-remove-attributes-1 TESTS_UNIFIED = \ + link-posix-1 \ custom-bundle-name TESTS_4_5 = \ diff --git a/tests/mmptest/regression/link-posix-1/LinkPosix1.cs b/tests/mmptest/regression/link-posix-1/LinkPosix1.cs index 2c2d81e58b..2ec494ffaf 100644 --- a/tests/mmptest/regression/link-posix-1/LinkPosix1.cs +++ b/tests/mmptest/regression/link-posix-1/LinkPosix1.cs @@ -4,9 +4,9 @@ using System; using System.IO; using System.IO.Compression; using System.Reflection; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.ObjCRuntime; +using Foundation; +using AppKit; +using ObjCRuntime; // Test // * application does not reference assembly Mono.Posix.dll @@ -44,4 +44,4 @@ namespace Xamarin.Mac.Linker.Test { Test.Terminate (); } } -} \ No newline at end of file +} diff --git a/tests/mmptest/regression/link-posix-1/link-posix-1.csproj b/tests/mmptest/regression/link-posix-1/link-posix-1.csproj index b0dfce96dd..d3496075f3 100644 --- a/tests/mmptest/regression/link-posix-1/link-posix-1.csproj +++ b/tests/mmptest/regression/link-posix-1/link-posix-1.csproj @@ -6,11 +6,13 @@ 8.0.30703 2.0 {BB0442BD-28A5-4F1E-8101-F5060AB9E8D2} - {42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe linkposix1 Resources link-posix-1 + Xamarin.Mac + v2.0 True @@ -25,14 +27,9 @@ False Mac Developer False - False x86 - 3rd Party Mac Developer Installer - - Full false - false none @@ -41,39 +38,17 @@ prompt 4 Full - False + True False False Mac Developer False - False x86 false - false - - - none - True - bin\x86\AppStore - prompt - 4 - Full - True - 3rd Party Mac Developer Installer - True - True - 3rd Party Mac Developer Application - True - False - x86 - false - false - - ..\..\..\..\src\build\compat\XamMac.dll - + @@ -84,11 +59,10 @@ - - + MainMenu.xib - \ No newline at end of file + diff --git a/tests/mmptest/regression/link-posix-2/Info.plist b/tests/mmptest/regression/link-posix-2/Info.plist deleted file mode 100644 index cb9abb17c1..0000000000 --- a/tests/mmptest/regression/link-posix-2/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleIdentifier - com.yourcompany.link-posix-2 - CFBundleName - link-posix-1 - CFBundleVersion - 1 - LSMinimumSystemVersion - 10.9 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - LSUIElement - 1 - - diff --git a/tests/mmptest/regression/link-posix-2/LinkPosix2.cs b/tests/mmptest/regression/link-posix-2/LinkPosix2.cs deleted file mode 100644 index 42905df2be..0000000000 --- a/tests/mmptest/regression/link-posix-2/LinkPosix2.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using Mono.Posix; -using MonoMac.Foundation; -using MonoMac.AppKit; -using MonoMac.ObjCRuntime; - -// Test -// * application references Mono.Posix -// * application call method which pinvoke into libc -// * linker does not include libMonoPosixHelper.dylib in the application bundle -// -// Requirement -// * Link SDK or Link All must be enabled - -namespace Xamarin.Mac.Linker.Test { - - class Posix2 { - - static void Main (string[] args) - { - NSApplication.Init (); - - Test.EnsureLinker (true); - -#pragma warning disable 618 - var host = Syscall.GetHostName (); -#pragma warning restore 618 - Test.Log.WriteLine ("{0}\t{1} {2}", !String.IsNullOrEmpty (host) ? "[PASS]" : "[FAIL]", "Syscall.GetHostName returned", host); - - string path = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location); - string dylib = Path.Combine (path, "libMonoPosixHelper.dylib"); - bool bundled = File.Exists (dylib); - Test.Log.WriteLine ("{0}\t{1} : {2}", !bundled ? "[PASS]" : "[FAIL]", "MonoPosixHelper not present in bundle", dylib); - - Test.Terminate (); - } - } -} \ No newline at end of file diff --git a/tests/mmptest/regression/link-posix-2/link-posix-2.csproj b/tests/mmptest/regression/link-posix-2/link-posix-2.csproj deleted file mode 100644 index 10f13925b9..0000000000 --- a/tests/mmptest/regression/link-posix-2/link-posix-2.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {141239A4-4094-4349-A3F3-00CD16643226} - {42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - linkposix2 - Resources - link-posix-2 - - - True - full - False - bin\Debug - DEBUG; - prompt - 4 - True - False - False - Mac Developer - False - False - x86 - 3rd Party Mac Developer Installer - - - Full - false - false - - - none - True - bin\Release - prompt - 4 - Full - False - False - False - Mac Developer - False - False - x86 - false - false - - - none - True - bin\x86\AppStore - prompt - 4 - Full - True - 3rd Party Mac Developer Installer - True - True - 3rd Party Mac Developer Application - True - False - x86 - false - false - - - - - - ..\..\..\..\src\build\compat\XamMac.dll - - - - - - - - Test.cs - - - - - - - - MainMenu.xib - - - \ No newline at end of file diff --git a/tests/mmptest/regression/tests.sln b/tests/mmptest/regression/tests.sln index 3a9dc83a30..68b210641f 100644 --- a/tests/mmptest/regression/tests.sln +++ b/tests/mmptest/regression/tests.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-posix-1", "link-posix-1\link-posix-1.csproj", "{BB0442BD-28A5-4F1E-8101-F5060AB9E8D2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-posix-2", "link-posix-2\link-posix-2.csproj", "{141239A4-4094-4349-A3F3-00CD16643226}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-1", "link-webclient-1\link-webclient-1.csproj", "{148DC17B-B29F-48A7-97CD-EECE26015B25}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "link-webclient-2", "link-webclient-2\link-webclient-2.csproj", "{FA5882C9-C02D-4C7B-963B-AEA929D01390}" @@ -64,12 +62,6 @@ Global {0A4EBB71-92E1-448C-BAA6-DFFB9491D8A0}.Debug|x86.Build.0 = Debug|x86 {0A4EBB71-92E1-448C-BAA6-DFFB9491D8A0}.Release|x86.ActiveCfg = Release|x86 {0A4EBB71-92E1-448C-BAA6-DFFB9491D8A0}.Release|x86.Build.0 = Release|x86 - {141239A4-4094-4349-A3F3-00CD16643226}.AppStore|x86.ActiveCfg = AppStore|x86 - {141239A4-4094-4349-A3F3-00CD16643226}.AppStore|x86.Build.0 = AppStore|x86 - {141239A4-4094-4349-A3F3-00CD16643226}.Debug|x86.ActiveCfg = Debug|x86 - {141239A4-4094-4349-A3F3-00CD16643226}.Debug|x86.Build.0 = Debug|x86 - {141239A4-4094-4349-A3F3-00CD16643226}.Release|x86.ActiveCfg = Release|x86 - {141239A4-4094-4349-A3F3-00CD16643226}.Release|x86.Build.0 = Release|x86 {148DC17B-B29F-48A7-97CD-EECE26015B25}.AppStore|x86.ActiveCfg = AppStore|x86 {148DC17B-B29F-48A7-97CD-EECE26015B25}.AppStore|x86.Build.0 = AppStore|x86 {148DC17B-B29F-48A7-97CD-EECE26015B25}.Debug|x86.ActiveCfg = Debug|x86