The OpenCTF component test framework helps to build automatic tests for all (visual and non-visual) VCL components in a Delphi application. It is based on the DUnit framework.
How does it work?
- OpenCTF iterates over the Forms and DataModules and dynamically creates test cases for the components
- Customized test classes detect which components have to be tested, and configure the test steps

How can it help me?
OpenCTF provides an easy way to build automatic quality checks for large projects where many components have to pass repeated tests.
Here are some examples:
- detect missing or wrong property values – e.g. Buttons without assigned Actions, DataSources without associated DataSet
- detect unassigned event handlers – e.g. missing OnExecute event
- check that all DataSets can be opened
- check the tab order
- find invisible components (e.g. invisible TabSheets which better should be hidden at runtime)
Is it easy to use?
Creating and customizing tests for your specific needs is very easy:
- Adding OpenCTF tests to a DUnit test suite requires only one or two lines of code
- Writing your own custom component tests is simple, many examples are included in the source distribution
Hosted on Sourceforge
- OpenCTF is hosted on Sourceforge: http://sourceforge.net/projects/openctf/
- API documentation is available online at http://openctf.sourceforge.net/
Source example
program OneFormTest;
{$APPTYPE CONSOLE}
uses
OpenCTF,
OpenCTFRunner,
ctfTestActnList,
ctfTestControls,
ctfTestMenus,
TestForm in 'TestForm.pas' {Form1};
begin
// Register Form classes
OpenCTF.RegisterFormClasses([TForm1]);
// run the tests
OpenCTFRunner.Run;
end.