Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/common/test-variations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<BundleOriginalResources>false</BundleOriginalResources>
</PropertyGroup>

<Target Name="ValidateTestVariation" Condition="'$(TestVariation)' != ''" BeforeTargets="Build">
<Target Name="ValidateTestVariation" Condition="'$(TestVariation)' != '' And '$(OutputType)' == 'exe'" BeforeTargets="Build">
<ItemGroup>
<_FilteredTestVariations Include="@(TestVariations)" Condition="'%(Identity)' == '$(TestVariation)'" />
</ItemGroup>
Expand Down
30 changes: 30 additions & 0 deletions tests/monotouch-test/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,36 @@
<WarningsAsErrors>Nullable</WarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<TestVariations Include="static-registrar-all-optimizations" Description="Static registrar + all optimizations" />
<TestVariations Include="static-registrar-all-optimizations-linkall" Description="Static registrar + all optimizations + Link all" />
<TestVariations Include="static-registrar-optimizations-except-uithread-checks-linkall" Description="Static registrar + all optimizations + Link all" />
<TestVariations Include="managed-static-registrar-all-optimizations-linkall" Description="Managed static registrar + all optimizations" />
</ItemGroup>
<PropertyGroup Condition="'$(TestVariation)' == 'static-registrar-all-optimizations'">
<AppBundleExtraOptions>$(AppBundleExtraOptions) --optimize:all</AppBundleExtraOptions>
<Registrar>static</Registrar>
<DefineConstants>$(DefineConstants);OPTIMIZEALL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TestVariation)' == 'static-registrar-all-optimizations-linkall'">
<AppBundleExtraOptions>$(AppBundleExtraOptions) --optimize:all</AppBundleExtraOptions>
<Registrar>static</Registrar>
<LinkMode>Full</LinkMode>
<DefineConstants>$(DefineConstants);OPTIMIZEALL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TestVariation)' == 'static-registrar-optimizations-except-uithread-checks-linkall'">
<AppBundleExtraOptions>$(AppBundleExtraOptions) --optimize:all,-remove-uithread-checks</AppBundleExtraOptions>
<Registrar>static</Registrar>
<LinkMode>Full</LinkMode>
<DefineConstants>$(DefineConstants);OPTIMIZEALL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TestVariation)' == 'managed-static-registrar-all-optimizations-linkall'">
<AppBundleExtraOptions>$(AppBundleExtraOptions) --optimize:all</AppBundleExtraOptions>
<Registrar>managed-static</Registrar>
<LinkMode>Full</LinkMode>
<DefineConstants>$(DefineConstants);OPTIMIZEALL</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ReferenceNativeSymbol Include="Inexistent" SymbolType="ObjectiveCClass" SymbolMode="Ignore" />
<ReferenceNativeSymbol Include="x_native_field" SymbolType="Field" />
Expand Down
2 changes: 0 additions & 2 deletions tests/xharness/Jenkins/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ namespace Xharness.Jenkins {

class TestData {
public string Variation;
public string AppBundleExtraOptions;
public KnownIssue KnownFailure;
public bool Debug;
public bool Profiling;
public string LinkMode;
public string Defines;
public bool? Ignored;
public bool EnableSGenConc;
public bool UseLlvm;
Expand Down
34 changes: 10 additions & 24 deletions tests/xharness/Jenkins/TestVariationsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ IEnumerable<TestData> GetTestData (RunTestTask test)
case "monotouch-test":
ignore = true;
yield return new TestData { Variation = "Debug (dynamic registrar)", Registrar = "dynamic", Debug = true, Profiling = false, Ignored = ignore };
yield return new TestData { Variation = "Release (all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "static", Debug = false, Profiling = false, Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Debug (all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "static", Debug = true, Profiling = false, Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Debug: SGenConc", AppBundleExtraOptions = "", Debug = true, Profiling = false, EnableSGenConc = true, Ignored = ignore };
yield return new TestData { Variation = "Release (all optimizations)", TestVariation = "static-registrar-all-optimizations", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Debug (all optimizations)", TestVariation = "static-registrar-all-optimizations", Debug = true, Ignored = ignore };
yield return new TestData { Variation = "Debug: SGenConc", Debug = true, Profiling = false, EnableSGenConc = true, Ignored = ignore };
if (supports_interpreter) {
yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Debug = true, Profiling = false, Ignored = ignore, Defines = "" };
yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Debug = true, Profiling = false, Ignored = ignore };
}
yield return new TestData { Variation = "Release (LLVM)", Debug = false, UseLlvm = true, Ignored = ignore };
yield return new TestData { Variation = "Debug (managed static registrar)", Registrar = "managed-static", Debug = true, Profiling = false, Ignored = ignore };
yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "managed-static", Debug = false, Profiling = false, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "managed-static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Release (NativeAOT)", Debug = false, PublishAot = true, Ignored = ignore, LinkMode = "Full" };
break;
}
Expand All @@ -99,15 +99,15 @@ IEnumerable<TestData> GetTestData (RunTestTask test)
// The default is to run monotouch-test with the dynamic registrar (in the simulator), so that's already covered
yield return new TestData { Variation = "Debug (LinkSdk)", Debug = true, Profiling = false, LinkMode = "SdkOnly", Ignored = ignore };
yield return new TestData { Variation = "Debug (static registrar)", Registrar = "static", Debug = true, Profiling = false, Ignored = ignore };
yield return new TestData { Variation = "Release (all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "static", Debug = false, Profiling = false, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Debug (all optimizations)", AppBundleExtraOptions = "--optimize:all,-remove-uithread-checks", Registrar = "static", Debug = true, Profiling = false, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = ignore ?? !jenkins.TestSelection.IsEnabled (TestLabel.All) };
yield return new TestData { Variation = "Release (all optimizations)", TestVariation = "static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Debug (all optimizations)", TestVariation = "static-registrar-optimizations-except-uithread-checks-linkall", Debug = true, Ignored = ignore ?? !jenkins.TestSelection.IsEnabled (TestLabel.All) };

if (mac_supports_arm64) {
yield return new TestData { Variation = "Debug (ARM64)", Debug = true, Profiling = false, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, };
yield return new TestData { Variation = "Release (NativeAOT, ARM64)", Debug = false, PublishAot = true, Ignored = ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, LinkMode = "Full" };
}
yield return new TestData { Variation = "Debug (managed static registrar)", Registrar = "managed-static", Debug = true, Profiling = false, Ignored = ignore };
yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "managed-static", Debug = false, Profiling = false, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "managed-static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Release (NativeAOT, x64)", Debug = false, PublishAot = true, Ignored = ignore, RuntimeIdentifier = x64_sim_runtime_identifier, LinkMode = "Full" };
if (supports_interpreter) {
yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Debug = true, Profiling = false, Ignored = ignore };
Expand Down Expand Up @@ -140,12 +140,12 @@ IEnumerable<TestData> GetTestData (RunTestTask test)
yield return new TestData { Variation = "Debug (static registrar)", Registrar = "static", Debug = true, Ignored = ignore, };
yield return new TestData { Variation = "Debug (static registrar, ARM64)", Registrar = "static", Debug = true, Profiling = false, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, };
yield return new TestData { Variation = "Release (managed static registrar)", Registrar = "managed-static", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "managed-static", Debug = false, Profiling = false, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "managed-static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Release (NativeAOT)", Debug = false, PublishAot = true, Ignored = ignore, LinkMode = "Full" };
yield return new TestData { Variation = "Release (NativeAOT, ARM64)", Debug = false, PublishAot = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, LinkMode = "Full" };
yield return new TestData { Variation = "Release (NativeAOT, x64)", Debug = false, PublishAot = true, Ignored = ignore, RuntimeIdentifier = x64_runtime_identifier, LinkMode = "Full" };
yield return new TestData { Variation = "Release (static registrar)", Registrar = "static", Debug = false, Ignored = ignore };
yield return new TestData { Variation = "Release (static registrar, all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "static", Debug = false, Profiling = false, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = ignore };
yield return new TestData { Variation = "Release (static registrar, all optimizations)", TestVariation = "static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore };
if (test.Platform == TestPlatform.MacCatalyst) {
yield return new TestData { Variation = "Release (ARM64, LLVM)", Debug = false, UseLlvm = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier };
}
Expand All @@ -172,12 +172,10 @@ public IEnumerable<T> CreateTestVariations<T> (IEnumerable<T> tests, Func<MSBuil
foreach (var task in tests.ToArray ()) {
foreach (var test_data in GetTestData (task)) {
var variation = test_data.Variation;
var bundler_arguments = test_data.AppBundleExtraOptions;
var configuration = test_data.Debug ? task.ProjectConfiguration : task.ProjectConfiguration.Replace ("Debug", "Release");
var debug = test_data.Debug;
var profiling = test_data.Profiling;
var link_mode = test_data.LinkMode;
var defines = test_data.Defines;
var ignored = test_data.Ignored;
var known_failure = test_data.KnownFailure;
var candidates = test_data.Candidates;
Expand All @@ -199,22 +197,10 @@ public IEnumerable<T> CreateTestVariations<T> (IEnumerable<T> tests, Func<MSBuil
var isMac = task.Platform.IsMac ();
var canSymlink = task.Platform.CanSymlink ();

if (!string.IsNullOrEmpty (bundler_arguments)) {
clone.Xml.AppendAppBundleExtraOptions (bundler_arguments);
}
if (!string.IsNullOrEmpty (link_mode)) {
clone.Xml.SetProperty ("LinkMode", link_mode);
clone.Xml.SetProperty ("MtouchLink", link_mode);
}
if (!string.IsNullOrEmpty (defines)) {
clone.Xml.AddAdditionalDefines (defines);
if (clone.ProjectReferences is not null) {
foreach (var pr in clone.ProjectReferences) {
pr.Xml.AddAdditionalDefines (defines);
pr.Xml.Save (pr.Path);
}
}
}
clone.Xml.SetProperty (isMac ? "Profiling" : "MTouchProfiling", profiling ? "True" : "False");
if (test_data.EnableSGenConc)
clone.Xml.SetProperty ("EnableSGenConc", "true");
Expand Down
6 changes: 0 additions & 6 deletions tests/xharness/ProjectFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public static void AppendToProperty (this XmlDocument csproj, string node, strin
propertyGroup.InsertBefore (csproj.CreateComment ($" This property was created by xharness "), newNode);
}

public static void AppendAppBundleExtraOptions (this XmlDocument csproj, string value)
{
csproj.AppendToProperty ("AppBundleExtraOptions", value, " ");
}

static int IndexOf (this XmlNodeList @this, XmlNode node)
{
for (var i = 0; i < @this.Count; i++) {
Expand Down Expand Up @@ -254,7 +249,6 @@ public static void ResolveAllPaths (this XmlDocument csproj, string project_path
var nodes_with_variables = new string []
{
"MtouchExtraArgs",
"AppBundleExtraOptions",
"MonoBundlingExtraArgs",
};
Func<string, string>? convert = null;
Expand Down
Loading