pas2ut(1) Free Pascal unit test creation tool pas2ut(1)

pas2ut - The Free Pascal unit to unit test case conversion tool.

pas2ut [options] inputfile [outputfile]

pas2ut Scans the input file for classes and routines, and creates a testcase for all classes and routines found in the interface section of the file. It can generate a unit or an include file. All tests are created with a standard fail message. By default, only tests for public, published and default visibility members of classes are generated.

pas2ut takes the following options at this time:

Specify a comma-separated list of default tests for each class. The elements in the list must be valid pascal identifiers.
Set the message for the Fail() statement inside each test method.
Specify a comma-separated list of global identifiers for which to generate tests. By default, tests are generated for all global identifiers in the interface section of a unit.
Set the prefix for the test names (default is Test ). A test is named after the identifier it tests, with this prefix.
Use a single test class for each class found. The default is to create a testcase class per class in the input unit.
Do not generate test code for classes, only for functions and procedures.
Do not generate declarations for the tests, only implementations.
skip tests for default visibility members. By default, they are generated, together with Public or published members.
Do not create fail() statements in test routine implementations.
Do not generate testcases for fields of classes (only for methods and properties).
Do not generate tests for functions/procedures, only for classes.
Do not generate (empty) implementation for the tests, only a class declaration is generated. (it can be completed in an IDE such as Lazarus or MSIDE)
Do not generate tests for methods of classes, only for fields and properties.
Do not generate tests for properties of classes, only for fields and methods.
Do not generate a default test for each property.
Skip tests for public members, only protected members will be tested if --test-protected is in effect.
Do not generate tests for published members, only public and default members will be tested.
Do not generate RegisterTests statement.
Do not override the TTestCase.Setup() method in the generated class.
Do not override the TTestCase.TearDown() method in the generated class.
Do not generate a unit, just an include file.
Set the name of the parent class for generated test classes. The default is TTestCase this can be used to set another class name.
Generate a GetBounds test for each property.
Generate a MaxLen test for each property.
Generate a Notify test for each property.
Generate a Required test for each property.
Also generate tests for protected class members. By default, tests are only generated for public, published and default visibility members.
Set the name of the generated unit (default is taken from output file name)
Create tiopf tests (this is the same as specifying --default,--bounds,--required,--notify and --maxlen tests.)
Set the global unit test class name. To be used with --singletestclass. The --limit and --defaultclasstest may be specified multiple times.

fpc(1)
5 sep 2015 Free Pascal