google / cmockery

A lightweight library to simplify and generalize the process of writing unit tests for C applications.
Apache License 2.0
1.05k stars 371 forks source link

Source in sample code into Markdown docs automatically #54

Open mbrukman opened 5 years ago

mbrukman commented 5 years ago

Right now, README.md includes copy-pasted code from sample code in src/example/ tree, but they're not kept in-sync automatically.

Ideally, we would have a process for automatically including code samples, e.g., via some preprocessing since it's probably not possible to do it dynamically, so that we can avoid having to see them diverge, e.g., as can be seen in issue #28 and possibly others.

It will also ensure that the code remains valid, as it will be compiled when it's in the src/example directory, but we cannot compile or test code while it's in the README.md file.