---
# System prepended metadata

title: HIL TEST CASE FORMAT

---

# HIL TEST CASE FORMAT

- Text file
- Name: <test-id>.case
- One case in each file
- Uses TOML format:
```
# This is a TOML document.

title = "TOML Example"

[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates
```

- Proposed form:
```
[HIL-<test-id>] # should match the one sent by MCU
protocol = [I2C, SPI, CAN, <whatever>]
byte-mode = false # send input byte - check response byte or send whole array at once (idea: may be set automatically)
port = [0..x] # is this I2C1, SPI2, whatever (optional)
input = [0x42, 0x55, 0x2F, 0x04, ...]
output = [0x22, 0x0B] # expected output
```

# Proposal #2

```c++
TEST_CASE("something") {
    int variable = 5;
    
    I2C_Sensor_SetAccuracy(Sensor_VeryAccurate);
    CATCH_MACRO_I2C_ACK();
    
    float temperature = I2C_Sensor_ReadTemperature();
    CATCH_MACRO_I2C_RESPONSE([0x24, 0x56]);
    
    CATCH_ASSERT(temperature == 30);
}
```