Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NativeAOT/iOS] Fix System.Private.Xml tests #76071

Closed
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,18 @@ public ExceptionVerifier(string assemblyName, ExceptionVerificationFlags flags,
{
_output.WriteLine(e2.ToString());
}
catch (PlatformNotSupportedException e3)
{
// NativeAOT doesn't support assembly loading
_output.WriteLine(e3.ToString());
}
}
}
catch (Exception e)
{
_output.WriteLine("Exception: " + e.Message);
_output.WriteLine("Stack: " + e.StackTrace);
throw new VerifyException("Error while loading assembly");
throw new VerifyException("Error while loading assembly", e);
}

string[] resArray;
Expand Down Expand Up @@ -395,5 +400,9 @@ public class VerifyException : Exception
public VerifyException(string msg)
: base(msg)
{ }

public VerifyException(string msg, Exception innerException)
: base(msg, innerException)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== Initialize =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCInitialize : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -498,7 +498,7 @@ public void SetPartiaValidationAndCallValidate_Text_WhiteSpace_Valid(string type
}

// ===================== EndValidation =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCEndValidation : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== XmlResolver =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCXmlResolver : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== ValidateAttribute =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateAttribute : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -198,7 +198,7 @@ public void ValidateSameAttributeTwice()
}

// ===================== GetUnspecifiedDefaultAttributes =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCGetUnspecifiedDefaultAttributes : CXmlSchemaValidatorTestCase
{
public TCGetUnspecifiedDefaultAttributes(ITestOutputHelper output) : base(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== ValidateAttribute =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateAttribute_String : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== ValidateElement =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateElement : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== ValidateText =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateText : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -170,7 +170,7 @@ public void EmptyContent()
}

// ===================== ValidateWhitespace =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateWhitespace : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -295,7 +295,7 @@ public void PassNonWhitespaceContent()
}

// ===================== ValidateEndElement =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateEndElement : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -729,7 +729,7 @@ public void CallValidateEndElementWithTypedValueForComplexContent()
}

// ===================== SkipToEndElement =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCSkipToEndElement : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== ValidateText =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateText_String : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace System.Xml.XmlSchemaValidatorApiTests
{
// ===================== ValidateWhitespace =====================

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TCValidateWhitespace_String : CXmlSchemaValidatorTestCase
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using SerializationTypes;
using Xunit;

[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public static partial class XmlSerializerTests
{
#if ReflectionOnly|| XMLSERIALIZERGENERATORTESTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace System.Xml.XslCompiledTransformApiTests
{
//[TestCase(Name = "Xml 4th Errata tests for XslCompiledTransform", Params = new object[] { 300 })]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class Errata4 : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace System.Xml.XslCompiledTransformApiTests
{
//[TestCase(Name = "OutputSettings", Desc = "This testcase tests the OutputSettings on XslCompiledTransform", Param = "Debug")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class COutputSettings : XsltApiTestCaseBase2
{
private XslCompiledTransform _xsl = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace System.Xml.XslCompiledTransformApiTests
{
//[TestCase(Name = "TemporaryFiles", Desc = "This testcase tests the Temporary Files property on XslCompiledTransform")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class TempFiles : XsltApiTestCaseBase2
{
private XslCompiledTransform _xsl = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ protected void WLoad(XslCompiledTransform instance, MethodInfo meth, byte[] byte
}

//[TestCase(Name = "Load(MethodInfo, ByteArray, TypeArray) tests", Desc = "This testcase tests private Load method via Reflection. This method is used by sharepoint")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadMethInfoTest : ReflectionTestCaseBase
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -476,6 +477,7 @@ public void Var14()
//[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, Stream", Desc = "NAVIGATOR,STREAM")]
//[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, Writer", Desc = "NAVIGATOR,WRITER")]
//[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CXmlResolverTest : XsltApiTestCaseBase2, IDisposable
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -666,6 +668,7 @@ public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, Outpu
//[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, Stream", Desc = "NAVIGATOR,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, Writer", Desc = "NAVIGATOR,WRITER")]
//[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -1004,6 +1007,7 @@ public void LoadGeneric12(XslInputType xslInputType, ReaderType readerType)
//[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, Stream", Desc = "URI,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, Writer", Desc = "URI,WRITER")]
//[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, TextWriter", Desc = "URI,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadXmlResolverTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -1435,6 +1439,7 @@ public void LoadGeneric11(XslInputType xslInputType, ReaderType readerType)
//[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, Stream", Desc = "URI,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, Writer", Desc = "URI,WRITER")]
//[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, TextWriter", Desc = "URI,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadUrlResolverTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -1534,6 +1539,7 @@ private sealed class XmlAuditingUrlResolver : XmlUrlResolver
/***********************************************************/

//[TestCase(Name = "XslCompiledTransform.Load(Url) Integrity : URI, Stream", Desc = "URI,STREAM")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadStringTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -1652,6 +1658,7 @@ public void LoadUrl5(ReaderType readerType)
/***********************************************************/

//[TestCase(Name = "XslCompiledTransform .Load(IXPathNavigable) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadXPathNavigableTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -1760,6 +1767,7 @@ public void LoadNavigator4()
/***********************************************************/

//[TestCase(Name = "XslCompiledTransform.Load(Reader) : Reader, Stream", Desc = "READER,STREAM")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CLoadReaderTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -2149,6 +2157,7 @@ public override string Value
//[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, Stream", Desc = "NAVIGATOR,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, Writer", Desc = "NAVIGATOR,WRITER")]
//[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CTransformTestGeneric : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -2404,6 +2413,7 @@ public void TransformGeneric11(XslInputType xslInputType, ReaderType readerType,
//[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, Stream", Desc = "NAVIGATOR,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, Writer", Desc = "NAVIGATOR,WRITER")]
//[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CTransformResolverTest : XsltApiTestCaseBase2, IDisposable
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -2615,6 +2625,7 @@ public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, Outpu
//[TestCase(Name = "XslCompiledTransform.Transform(String, String) : Reader , String", Desc = "READER,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Transform(String, String) : URI, String", Desc = "URI,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Transform(String, String) : Navigator, String", Desc = "NAVIGATOR,STREAM")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CTransformStrStrTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -2987,6 +2998,7 @@ public void TransformStrStr13(XslInputType xslInputType, ReaderType readerType)
//[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : Reader , String", Desc = "READER,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : URI, String", Desc = "URI,STREAM")]
//[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : Navigator, String", Desc = "NAVIGATOR,STREAM")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CTransformStrStrResolverTest : XsltApiTestCaseBase2, IDisposable
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -3091,6 +3103,7 @@ public void TransformStrStrResolver3(object param, XslInputType xslInputType, Re

//[TestCase(Name = "XslCompiledTransform.Transform(IXPathNavigable, XsltArgumentList, XmlWriter, XmlResolver)", Desc = "Constructor Tests", Param = "IXPathNavigable")]
//[TestCase(Name = "XslCompiledTransform.Transform(XmlReader, XsltArgumentList, XmlWriter, XmlResolver)", Desc = "Constructor Tests", Param = "XmlReader")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CTransformConstructorWithFourParametersTest : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -3295,6 +3308,7 @@ public void InValidCases(object param0, object param1, object param2)
// This testcase is for bugs 109429, 111075 and 109644 fixed in Everett SP1
//[TestCase(Name = "NDP1_1SP1 Bugs (URI,STREAM)", Desc = "URI,STREAM")]
//[TestCase(Name = "NDP1_1SP1 Bugs (NAVIGATOR,TEXTWRITER)", Desc = "NAVIGATOR,TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CNDP1_1SP1Test : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -3386,6 +3400,7 @@ public void var4(XslInputType xslInputType, ReaderType readerType, OutputType ou
}

//[TestCase(Name = "XslCompiledTransform Regression Tests for API", Desc = "XslCompiledTransform Regression Tests")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CTransformRegressionTest : XsltApiTestCaseBase2, IDisposable
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace System.Xml.XslCompiledTransformApiTests
{
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class XslCompilerTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public SameInstanceXslTransformTestCase(ITestOutputHelper output) : base(output)
}

//[TestCase(Name = "Same instance testing: Transform() - READER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class SameInstanceXslTransformReader : SameInstanceXslTransformTestCase
{
private XPathDocument _xd; // Loads XML file
Expand Down Expand Up @@ -318,6 +319,7 @@ public void proc12()
}

//[TestCase(Name = "Same instance testing: Transform() - TEXTWRITER")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class SameInstanceXslTransformWriter : SameInstanceXslTransformTestCase
{
private XPathDocument _xd; // Loads XML file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum NavType
// Base class for test cases
//
////////////////////////////////////////////////////////////////
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class XsltApiTestCaseBase2
{
// Generic data for all derived test cases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace System.Xml.XslCompiledTransformApiTests
/***********************************************************/

//[TestCase(Name = "XsltArgumentList - GetParam", Desc = "Get Param Test Cases")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CArgIntegrity : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public CSameInstanceXsltArgTestCase2(ITestOutputHelper output) : base(output)
}

//[TestCase(Name = "Same instance testing: XsltArgList - GetParam", Desc = "GetParam test cases")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CSameInstanceXsltArgumentListGetParam : CSameInstanceXsltArgTestCase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -140,6 +141,7 @@ public void proc2()
}

//[TestCase(Name = "Same instance testing: XsltArgList - GetExtensionObject", Desc = "GetExtensionObject test cases")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CSameInstanceXsltArgumentListGetExtnObject : CSameInstanceXsltArgTestCase2
{
private ITestOutputHelper _output;
Expand Down Expand Up @@ -224,6 +226,7 @@ public void proc2()
}

//[TestCase(Name = "Same instance testing: XsltArgList - Transform", Desc = "Multiple transforms")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CSameInstanceXsltArgumentListTransform : CSameInstanceXsltArgTestCase2
{
private ITestOutputHelper _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace System.Xml.XslCompiledTransformApiTests
{
//[TestCase(Name = "XsltSettings-Retail", Desc = "This testcase tests the different settings on XsltSettings and the corresponding behavior in retail mode", Param = "Retail")]
//[TestCase(Name = "XsltSettings-Debug", Desc = "This testcase tests the different settings on XsltSettings and the corresponding behavior in debug mode", Param = "Debug")]
[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))]
public class CXsltSettings : XsltApiTestCaseBase2
{
private ITestOutputHelper _output;
Expand Down
Loading