tests: add `tests/utils/python/mctf.py`, a text to CTF trace generator
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 16 Oct 2023 18:07:03 +0000 (14:07 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 20 Oct 2023 23:29:14 +0000 (19:29 -0400)
commit89ec984ed8142a2cd79603e8d7b26544fc17d2a7
tree0346a86665f3e2d0d6639d094bb683d2da8775ff
parenteda81eee9ee730911b3779cc367c51a7123fded8
tests: add `tests/utils/python/mctf.py`, a text to CTF trace generator

Add `mctf.py`, a utility to generate a test trace from a moultipart file
(see `moultipart.py`).

Any part having the header info `metadata` is written as-is in a file
named `metadata`.  Other parts are considered Normand inputs, and the
output is written to a file of which the name is the exact header info
of the part.  For example:

    --- metadata
    /* CTF 1.8 */
    [...]

    --- stream0
    "Normand input here"

    --- .index/stream0
    "Normand input here too"

Variables and labels are carried from one normand.parse()
call to the other, allowing parts to refer to variables/labels from
previous parts.

All files are written relative to the value of the `--base-dir` option,
or relative to the current working directory if omitted.  Any
nonexistent parent directory is created if needed (like `make -p`).

Add a function in `utils.sh  that runs `mctf.py`.

Change-Id: I345b77ac382f268e8becd553e2e301982d80ced3
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11056
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
tests/utils/python/mctf.py [new file with mode: 0644]
tests/utils/utils.sh
This page took 0.024893 seconds and 4 git commands to generate.