-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tests] Ignore AOT tests if no cross-* (#855)
This commit makes a number of changes to the unit tests to allow us to handle different behaviour between xamarin-android and monodroid. Firstly we can now ignore AOT based tests if the compilers or runtime is not available. This means we can share the test inputs between repos. We also split out the Debugger Attribute test inputs into a `ManifestTest.OSS.cs` file to we can provide different inputs in monodroid. This is because there is a difference in behaviour between the two systems. In certain cases in monodroid we *do* want a debug runtime/attribute where in xamarin-android we never do. For example in xamarin-android having: * `$(DebugSymbols)`=None * `$(EmbedAssembliesIntoApk)`=False * `$(Optimize)`=False will result in `//application/@android:debuggable` *not* being added. This is correct behavior in xamarin-android because we *always* embed assemblies regardless of the value of `$(EmbedAssembliesIntoApk)`. In monodroid however that is incorrect, so we need separate test cases. This commit also moves some of the logic to do with `$(EmbedAssembliesIntoApk)` into `Xamarin.Android.Common.targets`. This is protected by the `$(_XASupportsFastDev)` property. This means the logic is all in one place rather than being split up across `.targets`. This should make it easier to maintain.
- Loading branch information
1 parent
3416fb5
commit 410cba8
Showing
7 changed files
with
69 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.OSS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using Xamarin.ProjectTools; | ||
using System.IO; | ||
using System.Xml; | ||
using System.Xml.Linq; | ||
using System.Xml.XPath; | ||
using Xamarin.Tools.Zip; | ||
|
||
namespace Xamarin.Android.Build.Tests | ||
{ | ||
public partial class ManifestTest : BaseTest | ||
{ | ||
static object [] DebuggerAttributeCases = new object [] { | ||
// DebugType, isRelease, extpected | ||
new object[] { "", true, false, }, | ||
new object[] { "", false, true, }, | ||
new object[] { "None", true, false, }, | ||
new object[] { "None", false, false, }, | ||
new object[] { "PdbOnly", true, false, }, | ||
new object[] { "PdbOnly", false, true, }, | ||
new object[] { "Full", true, false, }, | ||
new object[] { "Full", false, true, }, | ||
new object[] { "Portable", true, false, }, | ||
new object[] { "Portable", false, true, }, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters