Test Development with T2C

Eugene Shatokhin

T2C 2.0 Arnor Reference Manual (January 17, 2010)


Table of Contents

1. Introduction
2. Overview of T2C
3. Test Development with T2C and ReqMarkup - a Typical Workflow
1. Analysis of documentation
2. Markup of requirements (assertions)
3. Creating catalogue of requirements
4. Generating template of .t2c file
5. Populating the template: development of parameterized tests
6. Using T2C to generate the sources of the tests and other files
7. Building, executing and debugging the tests, analysing the results
4. Case Study - Glib Arrays
1. Prerequisites
2. Analysis of documentation
3. Markup of requirements (assertions)
3.1. g_array_new()
3.2. Using ReqTools in a web browser
3.3. g_array_sized_new()
3.4. g_array_append_vals(), g_array_prepend_vals(), etc.
3.5. g_array_sort() and g_array_sort_with_data()
3.6. g_array_set_size()
3.7. g_array_free()
3.8. Implicit requirements in the description of GArray data fields
4. Creating catalogue of requirements
5. Generating template of .t2c file
6. Populating the template: development of parameterized tests
6.1. T2C-style comments
6.2. Header
6.3. <GLOBAL> section
6.4. <STARTUP> and <CLEANUP> sections
6.5. Planning the test cases
6.6. Parameters of the tests
6.6.1. Choosing the parameters
6.6.2. Choosing the values of the parameters
6.7. Typical structure of a test scenario
6.7.1. Declarations and definitions used by the tests
6.7.2. Setup of the test situation
6.7.3. Call of the function under test
6.7.4. Analysis of the results
6.7.5. Cleanup
6.8. Test scenario #1 - check appending to an empty array
6.9. Test scenario #2 - check appending to a non-empty array
7. Using T2C to generate the sources of the tests and other files
8. Building, executing and debugging the tests, analysing the results
8.1. Building and installing the tests
8.2. Creating a test package
8.3. Executing and debugging the tests
5. T2C Reference
1. Installing the Tools
1.1. Installing T2C
1.2. Installing KompoZer
1.3. Installing ReqMarkup
2. Format of .t2c Files
2.1. Layout of a .t2c file
2.2. T2C-style comments
2.3. Header
2.4. <GLOBAL>
2.5. <STARTUP>
2.6. <CLEANUP>
2.7. <BLOCK>
2.7.1. General
2.7.2. <TARGETS>
2.7.3. <DEFINE>
2.7.4. <CODE> and <FINALLY>
2.7.5. <VALUES> (<PURPOSE>)
2.7.6. Attributes of <BLOCK> sections
2.7.7. Specifying sets of values for test parameters (SET and RES constructs)
3. T2C Command Line Tool
4. T2C File Generation Targets
4.1. C API provided by T2C targets
4.1.1. General
4.1.2. TRUE and FALSE
4.1.3. INIT_FAILED( )
4.1.4. TRACE( ) and TRACE0( )
4.1.5. REQ( ) and REQva( )
4.1.6. RETURN
4.1.7. ABORT_TEST( )
4.1.8. ABORT_UNSUPPORTED( )
4.1.9. ABORT_UNTESTED( )
4.1.10. ABORT_FIP( )
4.1.11. TEST_FAILED( )
4.1.12. T2C_GET_DATA_PATH( )
4.1.13. T2C_GET_TEST_PATH( )
4.2. Building and installing the tests
4.2.1. c_tet and c_standalone
4.2.2. c_gtest_nested
4.2.3. c_minimal
4.3. Executing the tests
4.3.1. c_tet
4.3.2. c_standalone
4.3.3. c_minimal
4.3.4. c_gtest_nested
4.4. Notes on using specific targets
4.4.1. Specifying copyright information
4.4.2. Configuration parameters of the tests
4.5. Creating new T2C targets
5. Templates, Template Groups and File Generation with T2C
5.1. Templates for output files
5.1.1. Basic structure
5.1.2. Multi-valued parameters and templates
5.1.3. Joining values
5.1.4. Conditionals
5.2. Template groups and subtemplates
5.2.1. Files and directories
5.2.2. References in the templates
5.2.3. Naming rules
5.2.4. Evaluation of a template group
5.3. Parameters and configuration files
5.4. Global, suite-specific and test-specific parameters
5.5. Default, suite-specific and test-specific templates
5.6. Directory structure of the templates for a T2C target
5.7. Generating output files for the test suites
5.7.1. Generating test source files
5.7.2. Special parameters defined by the file generator
6. Notes, Tips and Tricks
6.1. Substitutions in the IDs (define-blocks for long lists of IDs)
6.2. IDs of requirements for GObject-style properties and signals
6.3. Typical directory structure of a test suite (c_standalone target)
6.4. Common parameters of the tests
6.5. Access to test data directories from the code
6.6. Common directory for header files
6.7. T2C 2.x and 1.x - compatibility and differences
6.7.1. General
6.7.2. Format of .t2c files
6.7.3. T2C API
6.7.4. Parameters and configuration files