Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
81d1146
refactor(formatting): escape dots in strings to prevent namespace int…
thomhurst Oct 23, 2025
f1b749d
test(aot): add tests for AOT compatibility with enum arguments to pre…
thomhurst Oct 23, 2025
36a6f49
refactor(assertions): simplify assertion calls by removing unnecessar…
thomhurst Oct 23, 2025
fe7681d
refactor(matrix): streamline enum handling and remove unnecessary dyn…
thomhurst Oct 23, 2025
fa548ef
refactor(attributes): replace RequiresDynamicCode with RequiresUnrefe…
thomhurst Oct 23, 2025
735f0aa
test(aot): enhance AOT compatibility with property injection and dyna…
thomhurst Oct 23, 2025
a1d045b
refactor(tests): remove unused methods and improve AOT compatibility …
thomhurst Oct 23, 2025
3701435
chore(dependencies): update TUnit package version to 0.75.38-PullRequ…
thomhurst Oct 23, 2025
e581a0c
refactor(attributes): skip compiler-internal attributes during attrib…
thomhurst Oct 23, 2025
abb79d3
refactor(PropertyInjection): use non-nullable type names for improved…
thomhurst Oct 23, 2025
3b3f622
refactor(CastHelper): remove unnecessary suppress message for AOT com…
thomhurst Oct 23, 2025
4062403
refactor(CastHelper): simplify casting logic by removing unnecessary …
thomhurst Oct 23, 2025
099962b
refactor(CastHelper): enhance casting logic with AOT-safe conversions…
thomhurst Oct 23, 2025
a2c182b
refactor(CastHelper): optimize casting method by adding direct type c…
thomhurst Oct 23, 2025
2e31d58
refactor(CastHelper): improve AOT handling in TryReflectionConversion…
thomhurst Oct 24, 2025
c4052e9
feat: enhance AOT converter by scanning for conversion operators in s…
thomhurst Oct 24, 2025
9376b1e
feat: improve AOT converter by scanning all types in compilation for …
thomhurst Oct 24, 2025
f24825d
feat: add support for scanning closed generic types in method paramet…
thomhurst Oct 24, 2025
05063b5
feat: add AOT and single file publishing steps to CI pipeline
thomhurst Oct 24, 2025
0cdc612
feat: update TUnit package version references to use TUnitVersion var…
thomhurst Oct 24, 2025
917ea59
feat: add additional suppression message for trimming in reflection mode
thomhurst Oct 24, 2025
4a8ca00
feat: introduce IMemberMetadata interface and update related metadata…
thomhurst Oct 24, 2025
37e1e0a
fix: refine DynamicallyAccessedMembers attributes in Cast methods for…
thomhurst Oct 24, 2025
ecabc37
fix: update DynamicallyAccessedMembers attributes in Cast methods for…
thomhurst Oct 24, 2025
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
Prev Previous commit
Next Next commit
test(aot): add tests for AOT compatibility with enum arguments to pre…
…vent IL3050 warnings
  • Loading branch information
thomhurst committed Oct 24, 2025
commit f1b749dbda3dc9a4c87e6c9f046766499a242bc4
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace TUnit.NugetTester;

/// <summary>
/// Tests for issue #3321 - AOT analysis warnings when using enums in Arguments attribute
/// This test verifies that no IL3050 warnings are emitted when PublishAot is enabled
///
/// Per the issue report, code like this was triggering warnings:
/// - [Arguments(Enum1.Value1)] with enums
///
/// The warning was:
/// - IL3050: Using Array.CreateInstance which requires dynamic code
///
/// This has been suppressed in CastHelper.cs with an UnconditionalSuppressMessage
/// since the array creation happens at test discovery time, not during AOT-compiled execution.
///
/// Note: MatrixDataSource is intentionally NOT AOT-compatible and is marked with
/// RequiresUnreferencedCode/RequiresDynamicCode attributes.
/// </summary>
public class AotCompatibilityTests
{
public enum TestEnum
{
Value1,
Value2,
Value3
}

// Test from issue #3321 - enum parameters in Arguments attribute
[Test]
[Arguments(TestEnum.Value1)]
[Arguments(TestEnum.Value2)]
[Arguments(TestEnum.Value3)]
public async Task EnumArguments_ShouldNotTriggerAotWarnings(TestEnum enumValue)
{
// This test verifies that using enum values in Arguments doesn't trigger IL3050
await Assert.That(enumValue).IsDefined();
}
}