Test Function List Sample

From STRIDE Wiki
Revision as of 15:08, 3 June 2009 by Mikee (talk | contribs)
Jump to: navigation, search

Introduction

Function Lists are abbreviated as 'FList' in both pragmas (as in scl_test_flist) and documentation. The Test FList Samples pertain to test units that contain lists of functions to be executed. The Test FList functionality is designed to be used for the C language (although it is not restricted from compilation in a C++ environment as well).

Tests Description

Basic

These examples cover the simplest, easiest way to code STRIDE scl_test_flist functionality. These examples use simple POD return types to indicate status and do not annotate the tests with any rich information (such as comments).

Simple

This example demonstrates passing and failing tests using the primary POD types that infer status from (int, bool, short, and char). The bool type is only accepted in C++ mode.

Fixtures

This example shows how to use setup and teardown fixtures. The setup and teardown methods are called immediately before and after the execution of each test method, respectively.

Runtime Services

These examples cover basic usage of our Runtime Test Services API (as declared in srtest.h).

Simple

This example shows how to use srTestCaseSetStatus to set status, srTestCaseAddComment to add a comment, and srTEST_ADD_COMMENT_WITH_LOCATION to add a comment that automatically includes line and file information.

Dynamic

This example shows how to use srTestSuiteAddSuite, srTestSuiteAddCase, srTestSuiteAddAnnotation, and srTestAnnotationAddComment for dynamic suite, test, and annotation creation in the context of a single test method.

Override

This example shows how to use srTestCaseSetStatus to override the status that would otherwise be inferred from the return value.

VarComment

This example demonstrates the use of printf style format strings with srTestCaseAddComment.