Unit Test Runner
예제 #1
0
        public static void ProcessQueue()
        {
            if (queueNext == queueCurrent)
            {
                return;
            }

            if (!UnitTestRunner.IsReady())
            {
                return;
            }

            uint marker = Native.Get32(queueCurrent);

            if (marker == uint.MaxValue)
            {
                queueCurrent = Address.UnitTestQueue;
            }

            uint len      = Native.Get32(queueCurrent);
            uint id       = Native.Get32(queueCurrent + 4);
            uint address  = Native.Get32(queueCurrent + 8);
            uint type     = Native.Get32(queueCurrent + 12);
            uint paramcnt = Native.Get32(queueCurrent + 16);

            UnitTestRunner.SetUnitTestMethodAddress(address);
            UnitTestRunner.SetUnitTestResultType(type);
            UnitTestRunner.SetUnitTestMethodParameterCount(paramcnt);

            for (uint index = 0; index < paramcnt; index++)
            {
                uint value = Native.Get32(queueCurrent + 20 + (index * 4));
                UnitTestRunner.SetUnitTestMethodParameter(index, value);
            }

            queueCurrent = queueCurrent + len + 4;
            --count;

            Screen.Goto(17, 0);
            Screen.ClearRow();
            Screen.Write("[Unit Test]");
            Screen.NextLine();
            Screen.ClearRow();
            Screen.Write("ID: ");
            Screen.Write(id, 10, 5);
            Screen.Write(" Address: ");
            Screen.Write(address, 16, 8);
            Screen.Write(" Param: ");
            Screen.Write(paramcnt, 10, 2);
            Screen.Write(" Len: ");
            Screen.Write(len, 10, 4);
            Screen.Write(" - Cnt: ");
            Screen.Write(count, 10, 4);

            UnitTestRunner.StartTest(id);
        }
예제 #2
0
        private static void SendTestUnitResponse()
        {
            ulong result;
            uint  id;

            if (UnitTestRunner.GetResult(out result, out id))
            {
                SendResponse(id, DebugCode.ExecuteUnitTest, result);
            }
        }