Files
mgos_i2c_mock/README.md
2019-01-03 21:37:58 +01:00

697 B

A Mongoose OS I2C Mock

Files in this repository are a Linux I2C implementation of the Mongoose OS I2C interface.

Howto

Register tests in tests/*.[ch] and they will be compiled in. Each test must have functions uniquely named:

bool test_*_create();
bool test_*_run();
bool test_*_destroy();

And static variables named:

uint32_t test_*_period_ms = 1000;
bool test_*_enabled = true;

Running make will then generate the test skeleton, recursively compile all sources found in src/, tests/, and libs/, and for each, call the create() function, then the run() function each period_ms milliseconds, and upon exiting, call each destroy() function and clean up.