File: README.md

package info (click to toggle)
protozero 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,548 kB
  • sloc: cpp: 20,364; sh: 18; makefile: 14
file content (52 lines) | stat: -rw-r--r-- 1,758 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

# Tests

Tests are using the [Catch Unit Test Framework](https://github.com/catchorg/Catch2).

## Organization of the unit tests

Unit tests test low-level functions of the library. They are in the `unit`
directory.


## Organization of the reader/writer test cases

The hart of the tests are the reader/writer tests checking all aspects of
decoding and encoding protobuf files.

Each test case is in its own directory under the `t` directory. Each directory
contains (some of) the following files:

* `reader_test_cases.cpp`: The C++ source code that runs the reader tests.
* `writer_test_cases.cpp`: The C++ source code that runs the writer tests.
* `data-*.pbf`: PBF data files used by the tests.
* `testcase.proto`: Protobuf file describing the format of the data files.
* `testcase.cpp`: C++ file for creating the data files.

### Reader tests

The CMake config finds all the `reader_test_cases.cpp` files and compiles them.
Together with the `reader_tests.cpp` file they make up the `reader_tests`
executable which can be called to execute all the reader tests.

### Extra writer tests

The CMake config finds all the `writer_test_cases.cpp` files and compiles them.
Together with the `writer_tests.cpp` file they make up the `writer_tests`
executable which can be called to execute all the writer tests.

The writer tests need the Google protobuf library to work.


## Creating test data from scratch

Most tests use test data stored in PBF format in their directory. The files
have the suffix `.pbf`. Most of those files have been generated from the
provided `testcase.proto` and `testcase.cpp` files.

Usually you do not have to do this, but if you want to re-generate the PBF
data files, you can do so:

    cd test
    ./create_pbf_test_data.sh