In this case study, we consider test development for several functions from GLib Library dealing with arrays that grow automatically as elements are added.
For the sake of simplicity, the test execution framework provided with T2C will be used here along with the facilities to generate rather “minimal” source files (for debugging).
If you would like to use TETWare Lite or GLib Testing Framework in this example instead of the simple testing framework provided with T2C, please use c_tet or c_gtest_nested targets, respectively, in place of c_standalone when T2C tools are called.
Sample top-level scripts and other files for the test package generated using these T2C targets can be found in the package with T2C: in other/c_tet/
and other/c_gtest_nested/
directories. These files are not installed with T2C but are provided with it in the package.
For c_tet target, these files should be placed to the same directory where the top-level directory of the suite is located, i.e. to tut-examples/example01/
in this case.
For c_gtest_nested target, the only top-level file that is not generated by T2C (other/c_gtest_nested/gen_files.sh
) should be placed to tut-examples/example01/example01-t2c
directory.
The sources of API libraries for these T2C targets can be found in the respective subdirectories of `t2c --print-data-dir`/api
directory. gen_files.sh
script will copy them to an appropriate subdirectory in the test suite.
There is no external T2C API library for c_minimal target. The .c file and the Makefile generated from the .t2c file using this target should be self-contained (all necessary API definitions are placed within the .c file).
The documentation, sources and other files for the example considered in this case study can be found in tut-examples/example01
directory. Unless otherwise stated, the paths mentioned below are relative to this directory.