How to Write and Run Automated Tests

Author test definitions in the Tests CSV format, executed directly in the CoreEngine runtime loop.

This guide shows how to write a Tests CSV file that defines automated validation and simulation steps, injected and checked directly by the Core-Engine App at runtime.

1. Understand what the Tests CSV does

The Tests CSV file defines automated validation and simulation steps used during system verification. Each test describes which elements are injected or monitored, expected results, and how to compare outcomes. This is unrelated to DBSimGenerator, which is an offline ICD/code generator - the injection and result checks run directly in the Core-Engine App's runtime loop, which is why these tests are high-performance and accurate.

2. Learn the column layout

Column Description Example
Test Name Test identifier. The same name in consecutive rows means a multi-step test. Test1
Element Data path (LRU.Block.Element) referencing an ICD element. LRU_FC.Control.State
Injection Raw Optional raw data value (before scaling). 0x04
Injection Eng Optional engineering-unit value to inject. 4
Result Expected result value or range (e.g. 2:8). 5
Compare Operator Comparison type between expected and actual results. ==, <=, >
Timeout Maximum wait time (ms) before declaring failure. Empty = wait forever. 1000

3. Write a single-step test

  1. Give the test a unique Test Name.
  2. Set Element to the ICD path (LRU.Block.Element) you want to inject into or monitor.
  3. Fill in Injection Raw or Injection Eng to drive a value into the element (leave blank if you only want to read/compare).
  4. Fill in Result and a Compare Operator to check the expected outcome.
  5. Optionally set a Timeout in milliseconds; leave empty to wait indefinitely.

4. Write a multi-step test

To chain several rows into one test, leave Test Name empty on every row after the first — an empty Test Name means "continue the previous test."

Test Name,Element,Injection Raw,Injection Eng,Result,Compare Operator,Timeout
Test1,LRU_FC.Control.State,,4,,
,LRU_FC.Control.Control,,,5,<=
Test2 in range,LRU_FC.Control.State,,2,,
,LRU_FC.Control.Control,,,2:8,,

In this example, Test1 injects 4 into State, then checks that Control is <= 5. Test2 in range injects 2 into State, then checks that Control falls within the range 2:8.

5. Use the supported compare operators

Available Compare Operators: ==, <, >, <=, >=, !=.

6. Set timeouts correctly

Timeout is specified in milliseconds. Leaving it empty means the test waits indefinitely for the expected result — use this deliberately, since a runaway test will not fail on its own until the result condition is met.