Scl test class

From STRIDE Wiki
Revision as of 23:00, 11 July 2008 by Stevel (talk | contribs) (New page: = The scl_test_class pragma = The scl_test_class pragma declares a test class as captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the c...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The scl_test_class pragma

The scl_test_class pragma declares a test class as captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the class.

Syntax

#pragma scl_test_class(class-name)
Parameters Type Description
class-name String The name of the test class to be captured. Once captured, STRIDE will generate the appropriate code for executing the test methods in the class.

Notes

  • This pragma can only work in STRIDE version 2.1 or later.
  • The host PC must also have a recent distribution of ActiveState Perl installed.
  • Refer to the Test_Units page for more information on capturing and qualifying test classes.

Examples

   /*
   * test class using runtime test services for 
   * dynamic suite/test creation
   * 
   * @description
   * this test class uses the runtime C API directly to create dynamic test suites 
   * and test cases.
   * 
   */
   #include <srtest.h>
   class RuntimeServices_dynamic {
   public:
       void dynamic(void);
    
   // Declaring a constructor for an scl_test_class is optional, but
   // if a constructor is declared all parameters must be of plain old data (POD) type.
   // An scl_test_class-specified class may only have one explicit public constructor.
   // Declaration of this constructor results in IM synthesization of a function
   // that initializes the test unit. The constructor parameters become parameters of 
   // the synthesized test unit.
       RuntimeServices_dynamic(int i, int j, int k);
   };
   
   #ifdef _SCL
   #pragma scl_test_class(RuntimeServices_dynamic)
   #endif