3 Commits

Author SHA1 Message Date
Akos Kiss
cc473425d3 Fix cmakelists of doctests to run generation only once (#2347)
Custom commands with outputs used in multiple targets are prone to
being executed multiple times in parallel builds (and the repeated
overwrites of the outputs may lead to various hard-to-debug
errors). The fix is to add a custom target that depends on the
custom command and make the existing targets using the outputs
depend on the new custom target.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-22 09:14:18 +02:00
Akos Kiss
299643400d Don't let doctests pollute the source tree (#2346)
The patch changes the cmakelists of the doctests to extract the
test sources from the markdown docs into the binary tree.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-20 14:37:38 +09:00
Akos Kiss
00f93bc287 Add support for doctests (#1909)
Markdown files in the docs/ directory can now be annotated to turn
fenced C code blocks into unit tests. The recognized syntax is:

    [doctest]: # (name="test.c", test="run")

    ```c
    // unit test code
    ```

The commit also fixes the issues revealed during the initial
annotation.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-07-14 16:18:20 +02:00