diff --git a/Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs b/Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs index 3f834033ce..8ae031c094 100644 --- a/Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs +++ b/Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs @@ -21,8 +21,8 @@ public virtual IEnumerable RunTargets } } - public virtual bool RunWithGDB => false; - public virtual bool StartBochsDebugGUI => false; + public virtual bool RunWithGDB => true; + public virtual bool StartBochsDebugGUI => true; public virtual bool DebugIL2CPU => false; public virtual string KernelPkg => String.Empty; diff --git a/Tests/Cosmos.TestRunner.Full/TestKernelSets.cs b/Tests/Cosmos.TestRunner.Full/TestKernelSets.cs index 6e2f0e1c35..f5c87935f6 100644 --- a/Tests/Cosmos.TestRunner.Full/TestKernelSets.cs +++ b/Tests/Cosmos.TestRunner.Full/TestKernelSets.cs @@ -15,29 +15,29 @@ public static IEnumerable GetKernelTypesToRun() // Stable kernel types: the ones that are stable and will run in AppVeyor public static IEnumerable GetStableKernelTypes() { - yield return typeof(BoxingTests.Kernel); + //yield return typeof(BoxingTests.Kernel); yield return typeof(Compiler.Tests.TypeSystem.Kernel); - yield return typeof(Compiler.Tests.Bcl.Kernel); - yield return typeof(Compiler.Tests.Bcl.System.Kernel); - //yield return typeof(Cosmos.Compiler.Tests.Encryption.Kernel); - yield return typeof(Compiler.Tests.Exceptions.Kernel); - yield return typeof(Compiler.Tests.MethodTests.Kernel); - yield return typeof(Compiler.Tests.SingleEchoTest.Kernel); - yield return typeof(Kernel.Tests.Fat.Kernel); - yield return typeof(Kernel.Tests.IO.Kernel); - yield return typeof(SimpleStructsAndArraysTest.Kernel); - yield return typeof(Kernel.Tests.DiskManager.Kernel); + //yield return typeof(Compiler.Tests.Bcl.Kernel); + //yield return typeof(Compiler.Tests.Bcl.System.Kernel); + ////yield return typeof(Cosmos.Compiler.Tests.Encryption.Kernel); + //yield return typeof(Compiler.Tests.Exceptions.Kernel); + //yield return typeof(Compiler.Tests.MethodTests.Kernel); + //yield return typeof(Compiler.Tests.SingleEchoTest.Kernel); + //yield return typeof(Kernel.Tests.Fat.Kernel); + //yield return typeof(Kernel.Tests.IO.Kernel); + //yield return typeof(SimpleStructsAndArraysTest.Kernel); + //yield return typeof(Kernel.Tests.DiskManager.Kernel); - //yield return typeof(KernelGen3.Boot); - yield return typeof(GraphicTest.Kernel); + ////yield return typeof(KernelGen3.Boot); + //yield return typeof(GraphicTest.Kernel); - // Disable network tests due to our self hosted CI/CD limitations (VPS currently doesn't support VMWare with its CPU) - //yield return typeof(NetworkTest.Kernel); - yield return typeof(AudioTests.Kernel); - // Please see the notes on the kernel itself before enabling it - //yield return typeof(ConsoleTest.Kernel); - yield return typeof(MemoryOperationsTest.Kernel); - yield return typeof(ProcessorTests.Kernel); + //// Disable network tests due to our self hosted CI/CD limitations (VPS currently doesn't support VMWare with its CPU) + ////yield return typeof(NetworkTest.Kernel); + //yield return typeof(AudioTests.Kernel); + //// Please see the notes on the kernel itself before enabling it + ////yield return typeof(ConsoleTest.Kernel); + //yield return typeof(MemoryOperationsTest.Kernel); + //yield return typeof(ProcessorTests.Kernel); } } } diff --git a/Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs b/Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs index a99eb734bd..89a5b82c30 100644 --- a/Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs +++ b/Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs @@ -6,6 +6,7 @@ using IL2CPU.API.Attribs; using System; using System.Collections.Generic; +using System.Runtime.InteropServices; using Sys = Cosmos.System; namespace Cosmos.Compiler.Tests.TypeSystem @@ -305,6 +306,7 @@ protected override void Run() Assert.IsTrue(c != null, "Anonymous types are created correctly"); Assert.IsTrue(c.i == 1 && c.n == "Test", "Anonymous types have correct values"); + TestPackedStruct(); TestVTablesImpl(); TestGarbageCollectorMethods(); TestGarbageCollector(); @@ -339,5 +341,48 @@ private static void TestReflection() Assert.AreEqual("Int32", Type.GetType("System.Int32, System.Private.CoreLib").Name, "GetType works on Int32 with shortened assembly qualified name"); Assert.AreEqual("Int32", Type.GetType("System.Int32").Name, "GetType works on Int32 with shortened assembly qualified name"); } + + PackedStruct GetPackedStruct() + { + return new PackedStruct() + { + a = 1, + b = 2, + c = 3, + d = 4, + e = 5, + f = 6 + }; + } + + PackedStruct Re { get; set; } + private void TestPackedStruct() + { + Re = GetPackedStruct(); + + Assert.AreEqual(1, Re.a, "Correctly returned first field of struct"); + Assert.AreEqual("1", Re.a.ToString(), "Correctly returned first field of struct as string"); + Assert.AreEqual(2, Re.b, "Correctly returned second field of struct"); + Assert.AreEqual("2", Re.b.ToString(), "Correctly returned second field of struct as string"); + Assert.AreEqual(3, Re.c, "Correctly returned third field of struct"); + Assert.AreEqual("3", Re.c.ToString(), "Correctly returned third field of struct as string"); + Assert.AreEqual(4, Re.d, "Correctly returned fourth field of struct"); + Assert.AreEqual("4", Re.d.ToString(), "Correctly returned fourth field of struct as string"); + Assert.AreEqual(5, Re.e, "Correctly returned fifth field of struct"); + Assert.AreEqual("5", Re.e.ToString(), "Correctly returned fifth field of struct as string"); + Assert.AreEqual(6, Re.f, "Correctly returned sixth field of struct"); + Assert.AreEqual("6", Re.f.ToString(), "Correctly returned sixth field of struct as string"); + } + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct PackedStruct + { + public ushort a; + public uint b; + public ulong c; + public ushort d; + public ushort e; + public ulong f; } }