Conversation
Remove DesktopOnly restriction from VaryingCompilationReferences test. Replace MscorlibRef with compilation0.References to use the correct base references on any platform. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove WindowsDesktopOnly/WindowsOnly restrictions from three tests: - InvalidCharacterInPdbPath: uses Embedded PDB, not native - SwitchExpression_MethodBody_02: works with portable PDB - SyntaxOffset_OutVarInInitializers_SwitchExpression: works with portable PDB Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove DesktopOnly restriction from PortablePdb_DeterministicCompilationWithSJIS. Add Encoding.RegisterProvider(CodePagesEncodingProvider.Instance) for SJIS encoding availability on .NET Core. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove WindowsOnly restrictions from 5 of 7 EnC assembly reference tests: - ChangingCompilationDependencies - DependencyVersionWildcards_Compilation - DependencyVersionWildcards_Metadata - DependencyVersionWildcardsCollisions - CurrentCompilationVersionWildcards CompilationReferences_Less/More kept as WindowsOnly due to stream-based EmitDifference producing BadImageFormatException on portable PDB path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… to .NET Core Remove WindowsDesktopOnly restriction - dynamic types are available on .NET Core via TargetFramework.StandardAndCSharp. The TestExecutionNeedsDesktopTypes reason was overly conservative. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
34 test files with 155 desktop/Windows-only methods identified for porting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove DesktopOnly restriction from all 22 test methods. These are pure compilation/diagnostic tests with no desktop-specific dependencies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove DesktopOnly restriction from LongTupleDeclaration and Serialization tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove DesktopOnly restriction from: - CodeGenThrowTests: 3 tests - CodeGenUsingStatementTests: ObjectCreateInsideUsing - CodeGenNullCoalescingAssignmentTests: IndexerLvalue - CodeGenIterators: TestIteratorWithNullableAsCollectionVariable_Null Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 13 tests from DesktopOnly/WindowsOnly to Fact: - DestructorTests: 4 ported - CodeGenShortCircuitOperatorTests: 2 ported - CodeGenScriptTests: 2 ported - CodeGenDynamicTests: 1 ported - CodeGenCapturing: 3 ported (2 WindowsOnly→Fact, 1 multi-condition fix) - CodeGenOverridingAndHiding: already runs on .NET Core (ClrOnly) - CodeGenInParametersTests: already runs on .NET Core (ClrOnly) Skipped classes (cannot port): - CodeGenTryFinally: ThreadAbort not supported on .NET Core - BreakingChanges: WindowsDesktopOnly, fails on .NET Core - CodeGenLocalFunctionTests: fails on .NET Core - CodeGenDeconstructTests: fails on .NET Core Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 12 tests across 7 files: - CodeGenExprLambdaTests: 2 ported (AnonymousCreation, AnonTypes2) - CodeGenTests: 2 ported (TestBug15818, InitFromBlob) - CodeGenOperators: 3 ported (negative zero tests) - UnsafeTests: 2 ported (PointerArrayConversion, PointerArrayEnumerableConversion) - CodeGenExplicitImplementationTests: 1 ported - PatternTests: 1 ported (SwitchExpressionSequencePoints) - OptionalArgumentsTests: 1 ported Skipped: expression tree tests (#30160), varargs, runtime-dependent, CRLF-dependent hashes, #if NET472 blocks, RestrictedTypes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 4 tests from WindowsOnly to Fact: - CommandLineTests: CompilationWithWarnAsError_01, CompilationWithWarnAsError_02, PdbPathNotEmittedWithoutPdb - SarifV2ErrorLoggerTests: AnalyzerDisabledWithCommandLineOptions Remaining 103 methods skipped - genuinely Windows-specific: - Hardcoded Windows paths (C:\, backslash normalization) - Uses cmd.exe for process execution - SARIF URI formatting differences on Linux - Native PDB, NoPIA, SxS loading, locale requirements Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 11 additional tests by refactoring hardcoded Windows paths: - NullBaseDirectory* (3): use platform-conditional source file path - AppConfigParse: platform-conditional baseDirectory + Path.Combine - AppConfigBasicFail: Path.Combine for config file path - ParseDocAndOut/ParseErrorLogAndOut: platform-conditional baseDirectory + Path.DirectorySeparatorChar for sub-paths - SdkPathAndLibEnvVariable: already cross-platform - CompilationWithNonExistingOutPath: Path.DirectorySeparatorChar + Path.Combine - ResponseFilesWithNoconfig_02/_04: removed \r\n dependency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 9 tests across Syntax and Emit3 projects: - MemberDeclarationParsingTests: ParseOverflow, ParseOverflow2 - SyntaxNormalizerTests: 2 raw string multiline tests - OutVarTests: Scope_Query_01 - AttributeTests_Assembly: Bug16465 - AttributeTests_WellKnownAttributes: TestPseudoAttributes1 - AttributeTests_CallerInfoAttributes: TestCallerMemberName_ConstructorDestructor - AttributeTests: TestWellKnownAttributeOnProperty_DynamicAttribute Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 8 tests across 3 files in the Semantic project: - LocalFunctionTests: LocalFunctionResetsLockScopeFlag, LocalFunctionResetsTryCatchFinallyScopeFlags, LocalFunctionDoesNotOverwriteInnerLockScopeFlag, LocalFunctionDoesNotOverwriteInnerTryCatchFinallyScopeFlags, RethrowingExceptionsInCatchInsideLocalFuncIsAllowed, RethrowingExceptionsInLocalFuncInsideCatchIsNotAllowed - OperatorTests: DynamicAmbiguousOrConversion - QueryTests: StaticTypeInFromClause Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 37 tests across 7 files in the Symbol project: - CustomModifiersTests: 30 tests (DesktopOnly → Fact or ClrOnly) - IndexedPropertyTests: 2 tests (ClrOnly+DesktopOnly → ClrOnly) - OverriddenOrHiddenMembersTests: 1 test (DesktopOnly+ClrOnly → ClrOnly) - GenericConstraintTests: 1 test (ClrOnly+DesktopOnly → ClrOnly) - DynamicTransformsTests: 1 test (DesktopOnly+ClrOnly → ClrOnly) - PropertyTests: 1 test (DesktopOnly → Fact) - CustomModifierCopyTests: 1 test (ClrOnly+DesktopOnly → ClrOnly) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All 6 remaining projects (Emit3, Semantic, Symbol, Syntax, WinRT, IOperation) have been analyzed and attempted. Updated list.md and actions.md with results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| @@ -0,0 +1,586 @@ | |||
| # Porting Actions Log | |||
There was a problem hiding this comment.
Note: all files in the copilot directory will be removed before merge. I included them to give some context about how I went about this change.
| { | ||
| #if NET | ||
| Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); | ||
| #endif |
There was a problem hiding this comment.
Considered a module initializer to just ensure this happens for all of our unit tests. This is technically impacting the process execution since it's a shared component. Happy to hear thoughts on this.
There was a problem hiding this comment.
I can't say I even understand what this is doing. It should definitely be documented here, at the very least.
|
@roslyn-compiler PTAL |
| public void NullBaseDirectoryNotAddedToKeyFileSearchPaths() | ||
| { | ||
| var parser = CSharpCommandLineParser.Default.Parse(new[] { "c:/test.cs" }, baseDirectory: null, SdkDirectory); | ||
| var sourceFile = ExecutionConditionUtil.IsWindows ? "c:/test.cs" : Path.Combine(Path.GetTempPath(), "test.cs"); |
There was a problem hiding this comment.
Can't say I like the use of Path.GetTempPath() in these. Can we just have it do /test.cs, for this and other added uses?
There was a problem hiding this comment.
We should be able to do that.
| var lib0Ref = lib0.ToMetadataReference(); | ||
| var compilation0 = CreateCompilation(source, new[] { lib0Ref }, options: TestOptions.DebugDll); | ||
| var compilation1 = compilation0.WithSource(source).WithReferences(compilation0.References.Where(r => r != lib0Ref).Append(lib1.ToMetadataReference())); |
There was a problem hiding this comment.
I'm not sure I see why this is needed at all, tbh. Seems like the old code should run just fine.
| { | ||
| #if NET | ||
| Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); | ||
| #endif |
There was a problem hiding this comment.
I can't say I even understand what this is doing. It should definitely be documented here, at the very least.
Ported a number of the CSharp tests to run on .NET Core + Linux. This will increase our cross platform test coverage which will help with agent validation on Linux.
Note: used a ralph loop for this and it worked surprisingly well. The details of the loop are in the PR (will be removed before merging).