From 883038788a267cd33c3ad243064777be4b7d22f3 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 13 Feb 2018 17:19:31 +0100 Subject: [PATCH] [tests] Fix relative paths in mmptest and make cloned XM nunit projects work properly. (#3464) * [tests] Fix relative paths in mmptest and make cloned XM nunit projects work properly. Fixes this build problem with mmptest: /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest/CustomBuildActions.targets: error : Command 'make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll' exited with code: 255. Fixes https://github.com/xamarin/maccore/issues/633. * [mmp] Improve Driver.IsDefaultMarshalingManagedExceptionMode to work before MarshalManagedException has been initialized. Fixes this test failure: 1) Failed : Xamarin.MMP.Tests.MMPTests.UnifiedDebugBuilds_ShouldLinkToPartialStatic_UnlessDisabled Debug build should use partial static registrar Expected: True But was: False This regressed in 05616184607593ff52a344df8201ec1e62dc91ca, where we wouldn't properly select the partial static registrar because the initialization order changed and we'd do it before selecting the default exception marshaling mode. Changing Driver.IsDefaultMarshalingManagedExceptionMode to work before MarshalManagedException has been initialized to its default value fixes the problem. --- tests/mmptest/CustomBuildActions.targets | 4 ++-- tests/xharness/Jenkins.cs | 2 +- tools/common/Application.cs | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/mmptest/CustomBuildActions.targets b/tests/mmptest/CustomBuildActions.targets index c94c2f2646..3d700b29a4 100644 --- a/tests/mmptest/CustomBuildActions.targets +++ b/tests/mmptest/CustomBuildActions.targets @@ -5,7 +5,7 @@ $(BuildDependsOn);CreateNativeLibs - - + + diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index c8e62d48fc..47ef2558e6 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -612,7 +612,7 @@ namespace xharness build.SpecifyConfiguration = build.ProjectConfiguration != "Debug"; RunTestTask exec; if (project.IsNUnitProject) { - var dll = Path.Combine (Path.GetDirectoryName (project.Path), project.Xml.GetOutputAssemblyPath (build.ProjectPlatform, build.ProjectConfiguration).Replace ('\\', '/')); + var dll = Path.Combine (Path.GetDirectoryName (build.TestProject.Path), project.Xml.GetOutputAssemblyPath (build.ProjectPlatform, build.ProjectConfiguration).Replace ('\\', '/')); exec = new NUnitExecuteTask (build) { Ignored = ignored || !IncludeClassicMac, TestLibrary = dll, diff --git a/tools/common/Application.cs b/tools/common/Application.cs index 7e5183aea7..049b7d656c 100644 --- a/tools/common/Application.cs +++ b/tools/common/Application.cs @@ -64,7 +64,12 @@ namespace Xamarin.Bundler { public bool EnableSGenConc; public MarshalObjectiveCExceptionMode MarshalObjectiveCExceptions; public MarshalManagedExceptionMode MarshalManagedExceptions; - public bool IsDefaultMarshalManagedExceptionMode; + + bool is_default_marshal_managed_exception_mode; + public bool IsDefaultMarshalManagedExceptionMode { + get { return is_default_marshal_managed_exception_mode || MarshalManagedExceptions == MarshalManagedExceptionMode.Default; } + set { is_default_marshal_managed_exception_mode = value; } + } public List RootAssemblies = new List (); public List SharedCodeApps = new List (); // List of appexes we're sharing code with. public string RegistrarOutputLibrary;