You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building and running Microsoft.XmlSerializer.Generator.Tests with TestReadyToRun=true, the test run will fail with an assertion failure, indicating that the return value was different from the expected one.
Reproduction Steps
Clone the repo and build the clr and libs subsets. Make sure you specify TestReadyToRun, so that some necessary pretest components get built.
[Fact]// Comment this one out --> [ActiveIssue("https://github.com/dotnet/runtime/issues/96796", typeof(PlatformDetection), nameof(PlatformDetection.IsReadyToRunCompiled))]publicstaticvoidSgenCommandTest(){conststringCodeFile="SerializableAssembly.XmlSerializers.cs";conststringLKGCodeFile="Expected.SerializableAssembly.XmlSerializers.cs";vartype=Type.GetType("Microsoft.XmlSerializer.Generator.Sgen, dotnet-Microsoft.XmlSerializer.Generator");MethodInfomd=type.GetMethod("Main",BindingFlags.Static|BindingFlags.Public);string[]args=newstring[]{"SerializableAssembly.dll","--force","--quiet"};intn=(int)md.Invoke(null,newobject[]{args});Assert.Equal(0,n);Assert.True(File.Exists(CodeFile),string.Format("Fail to generate {0}.",CodeFile));// Compare the generated CodeFiles from the LKG with the live built shared framework one.// Not comparing byte per byte as the generated output isn't deterministic.Assert.Equal(LineEndingsHelper.Normalize(File.ReadAllText(LKGCodeFile)).Length,File.ReadAllText(CodeFile).Length);}
Build and run the test
cd Microsoft.XmlSerializer.Generator/tests
# We have to specify the project file this time because this folder has two csproj files.
/path/to/runtime/dotnet.sh build Microsoft.XmlSerializer.Generator.Tests.csproj -c Release -t:Test -p:TestReadyToRun=true
Expected behavior
All tests pass, except the skipped ones.
Actual behavior
Test fails with the following error, making the whole run fail:
Description
When building and running
Microsoft.XmlSerializer.Generator.TestswithTestReadyToRun=true, the test run will fail with an assertion failure, indicating that the return value was different from the expected one.Reproduction Steps
clrandlibssubsets. Make sure you specifyTestReadyToRun, so that some necessary pretest components get built.git clone https://github.com/dotnet/runtime cd runtime ./build.sh --subset clr+libs --configuration Release -p:TestReadyToRun=trueActiveIssueannotation insrc/libraries/Microsoft.XmlSerializer.Generator/tests/SGenTests.cs:Expected behavior
All tests pass, except the skipped ones.
Actual behavior
Test fails with the following error, making the whole run fail:
Regression?
No
Known Workarounds
Keep the test disabled so that the other tests in the run can be executed unaffected.