Refactor framework -- point to a tests/* directory for the user supplied tests

This commit is contained in:
Pim van Pelt
2019-01-03 20:12:04 +01:00
parent 449d51aae8
commit 1db8c1a0bf
18 changed files with 222 additions and 1776 deletions

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# 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;
```
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.