Skip to content

Commit

Permalink
Merge branch 'dev/mandel/rgen-init-project' of github.com:xamarin/xam…
Browse files Browse the repository at this point in the history
…arin-macios into dev/mandel/rgen-init-project
  • Loading branch information
mandel-macaque committed Oct 11, 2024
2 parents 6184756 + 3bd3dc6 commit 0203a6a
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions tests/common/ConfigurationXUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,41 @@

namespace Xamarin.Tests {

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
[AttributeUsage (AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public sealed class PlatformInlineDataAttribute : DataAttribute {
readonly object[] dataValues;
public PlatformInlineDataAttribute(ApplePlatform platform, params object[] parameters)
readonly object [] dataValues;
public PlatformInlineDataAttribute (ApplePlatform platform, params object [] parameters)
{
// data values are the join of the platform and all other values passed to the attr
dataValues = parameters.Prepend (platform).ToArray ();
// based on the passed platform and the configuration, decide if we skit the test
switch (platform) {
case ApplePlatform.iOS:
if (!Configuration.include_ios)
Skip = "iOS is not included in this build";
break;
case ApplePlatform.TVOS:
if (!Configuration.include_tvos)
Skip = "tvOS is not included in this build";
break;
case ApplePlatform.MacOSX:
if (!Configuration.include_mac)
Skip = "macOS is not included in this build";
break;
case ApplePlatform.MacCatalyst:
if (!Configuration.include_maccatalyst)
Skip = "Mac Catalyst is not included in this build";
break;
default:
throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}");
case ApplePlatform.iOS:
if (!Configuration.include_ios)
Skip = "iOS is not included in this build";
break;
case ApplePlatform.TVOS:
if (!Configuration.include_tvos)
Skip = "tvOS is not included in this build";
break;
case ApplePlatform.MacOSX:
if (!Configuration.include_mac)
Skip = "macOS is not included in this build";
break;
case ApplePlatform.MacCatalyst:
if (!Configuration.include_maccatalyst)
Skip = "Mac Catalyst is not included in this build";
break;
default:
throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}");
}
}

public object[] DataValues
{
public object [] DataValues {
get { return dataValues; }
}

public override IEnumerable<object[]> GetData (MethodInfo testMethod)
public override IEnumerable<object []> GetData (MethodInfo testMethod)
{
yield return dataValues;
}
Expand Down

0 comments on commit 0203a6a

Please sign in to comment.