Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Test Result Buffer

Unknown edited this page Jul 1, 2020 · 1 revision

Test Result Buffer

Goals:

Minimal storage usage to reduce the host target communication

4 different level of information depth

    Just success
    this mode intends to enable a fast execution time by minimising buffer reads. 

In this mode just the binary information about the test result gets stored. In this mode it is not possible to print messages over gdb because string to have significant influence to test execution time

    Test names

This mode enables to print messages over gdb.

Additional to “Just success” the test and class names

    Test results
    Additional to “Test names” add the “is” and “shall” values of failed tests

    Line of failure
    Additional to “Test results” add the file name and line of the failed assert

Buffer Overview

ID

Not defined 0b00 If one byte start with this ID the end of the buffer has been reached Test succeed 0b01 This test is successful, it is allowed to store up to 4 “Test success” IDs in one Byte (bitshift by two) Test failed 0b10 This test is failed. Depending on the Test level see Just Success testLevel:: justSuccess TestNames testLevel::TestNames TestResult testLevel::TestResult LineNumber testLevel::LineNumber String 0b11 Store a string in the buffer. See ID::String

It is possible to store up to 4 ID’s in one byte of the content has no further data (test success or testfailed & testlevel < testResult). If the content has further data the data starts at the beginning of the next byte testLevel:: Test Succeed

In this mode just the binary information about the test gets stored. In this mode it is possible to store up to four test result in one byte.

This first Assert gets stored on the MSB.

testLevel :: Test Names

In this mode test names, Class names and “printOverGdb” messages gets added to the “test result buffer”

Test result gets stored like in “testLevel:: Test Succeed”. Additional it is possible to add string content (see “Contend::String“) testLevel::Test Result

In this mode the “is” value and the “shall” value of failed test gets added to the buffer.

Buffer overview:

ID(can be stored with bitshift) | Test Failed::test Flags(next byte) | Test Failed::content

Test Failed::test Flags

typeNotDef = 0,

typeCompInt8 = 1,

typeCompInt16 = 2,

typeCompInt32 = 3,

typeCompChar = 4,

typeCompByte = 5, //1<<3

typeCompEqual = 1 << 5,

typeCompUnsigned = 1 << 6,

typeCompArray = 1 << 7

testLevel::Line Number

Buffer overview:

ID(can be stored with bitshift) |Line (4Byte)| Test Failed::test Flags(next byte) | Test Failed::content

Test Failed::Content

If the test was successful the information’s gets stored like in “justSuccess”

Content of failed test

Is the “testFlag” is typeCompInt32 || typeCompInt8 ||typeCompInt16:

sizeIs(4Byte)| isVlue | sizeShould | shouldValue

Is this flag set the type of content is unknown and is necessary to add the size of the is and shall value

Is the “testFlag” Is NOT typeCompInt32 || typeCompInt8 ||typeCompInt16:

isVlaue| shouldValue

ID::String

Add the current test name to the buffer

Test filename

Add the current test file name to the buffer

Test Classes

Add the current test class name to the buffer

Message over gdb

Add a message to the buffer that gets printed on the host cli

String only gets added into the buffer if the testlevel >= “Test Names”

ID|typeOf string| size | string