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
4 changes: 3 additions & 1 deletion TUnit.Engine/Framework/TUnitServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ public TUnitServiceProvider(IExtension extension,
Filter = filter;
TestSessionId = context.Request.Session.SessionUid.Value;

// Get framework services
var loggerFactory = frameworkServiceProvider.GetLoggerFactory();
var outputDevice = frameworkServiceProvider.GetOutputDevice();
CommandLineOptions = frameworkServiceProvider.GetCommandLineOptions();
var configuration = frameworkServiceProvider.GetConfiguration();

TestContext.Configuration = new ConfigurationAdapter(configuration);

VerbosityService = Register(new VerbosityService(CommandLineOptions));
DiscoveryDiagnostics.Initialize(VerbosityService);
Expand Down
2 changes: 1 addition & 1 deletion TUnit.TestProject/ConfigurationTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace TUnit.TestProject;

[Skip("Issue with AOT - https://github.com/microsoft/testfx/issues/4972")]
[SkipIfNotDynamicCodeSupported("Issue with AOT - https://github.com/microsoft/testfx/issues/4972")]
public class ConfigurationTests
{
[Test]
Expand Down
20 changes: 20 additions & 0 deletions TUnit.TestProject/SkipIfNotDynamicCodeSupportedAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Runtime.CompilerServices;

namespace TUnit.TestProject;

[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)]
public class SkipIfNotDynamicCodeSupportedAttribute : SkipAttribute
{
public SkipIfNotDynamicCodeSupportedAttribute(string reason) : base(reason)
{
}

public override Task<bool> ShouldSkip(TestRegisteredContext context)
{
#if NET
return Task.FromResult(!RuntimeFeature.IsDynamicCodeSupported);
#else
return Task.FromResult(false);
#endif
}
}
Loading