Add static array tracing tests
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 9 Sep 2020 23:35:11 +0000 (19:35 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 10 Sep 2020 01:30:23 +0000 (21:30 -0400)
commit8800477645df39645e07ae0db9e628f38e6a50f5
tree6803f681ce29a71154a152ea75fdbfa094411818
parentf18d46aaaaa8636270a53311acbf6c9e1e482106
Add static array tracing tests

This patch adds static array tracing tests, also adding the testing
infrastructure for other such tests.

In `tests/tracing`, the test functions of `test_succeed_static_array.py`
use the tracing_succeed_test() fixture as found in
`tests/tracing/conftest.py`.

tracing_succeed_test() does the following:

 1. Creates a temporary directory with the tmpdir() fixture.

 2. Automatically finds the paths, based on the test's module and
    function names, of:

    * A YAML configuration file.

    * A test-specific C source file.

    * Two expectation files (one for the metadata stream and one for the
      data stream).

 3. Creates a barectf configuration from the YAML file found in 2.

 4. Generates the C code files using the barectf configuration of 3.,
    writing the files to the temporary directory of 1.

 5. Generates the metadata stream using the barectf configuration of 3.,
    stripping some variable version and generation date lines.

    This step does not write any file to the file system.

 6. Copies the files in the `tests/tracing/support` directory to the
    temporary directory of 1.

    `test-platform.c` and `test-platform.h` form the barectf platform
    for all the tracing tests.

 7. Copies the test-specific C source file found in 2. as `test.c` to
    the temporary directory of 1.

 8. Executes `make` in the temporary directory of 1.

 9. Executes `./test` in the temporary directory of 1.

10. Reads the produced data stream file (`stream` in the temporary
    directory of 1.) and compares it with the data stream expectation
    file found in 2.

11. Compares the metadata stream contents of 5. with the metadata stream
    expectation file found in 2.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
45 files changed:
tests/tracing/configs/succeed/static-array/nested-5-uint8.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-double.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-static-array-of-double.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-static-array-of-str.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-static-array-of-uint8.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-str.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-uint3-middle.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-uint3.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/of-uint8.yaml [new file with mode: 0644]
tests/tracing/configs/succeed/static-array/zero-len.yaml [new file with mode: 0644]
tests/tracing/conftest.py [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/nested-5-uint8.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/nested-5-uint8.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-double.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-double.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-static-array-of-double.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-static-array-of-double.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-static-array-of-str.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-static-array-of-str.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-static-array-of-uint8.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-static-array-of-uint8.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-str.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-str.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-uint3-middle.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-uint3-middle.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-uint3.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-uint3.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-uint8.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/of-uint8.metadata.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/zero-len.data.expect [new file with mode: 0644]
tests/tracing/expect/succeed/static-array/zero-len.metadata.expect [new file with mode: 0644]
tests/tracing/src/succeed/static-array/nested-5-uint8.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-double.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-static-array-of-double.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-static-array-of-str.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-static-array-of-uint8.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-str.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-uint3-middle.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-uint3.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/of-uint8.c [new file with mode: 0644]
tests/tracing/src/succeed/static-array/zero-len.c [new file with mode: 0644]
tests/tracing/support/Makefile [new file with mode: 0644]
tests/tracing/support/test-platform.c [new file with mode: 0644]
tests/tracing/support/test-platform.h [new file with mode: 0644]
tests/tracing/test_succeed_static_array.py [new file with mode: 0644]
This page took 0.026707 seconds and 4 git commands to generate.