CodeSnip can be configured to test compile snippets with any supported compiler that is installed on the local computer. Note that freeform snippets cannot be test compiled.
The supported compilers are the Win32 Delphi compilers from Delphi 2 to Delphi XE and Free Pascal.
Before CodeSnip can use the compilers it needs to be told about them. This is done using the Configure Compilers dialog box that is accessed from the Tools menu or from a link in the Detail Pane's Compiler Checks tab.
You can also customise the command line switches passed to the compilers to replicate your usual compilation defaults. This is also done in the Configure Compilers dialog box.
Compiler configuration is stored on a per user basis, i.e. each user account maintains separate compiler configuration information. Therefore each user must configure compilers separately. The reason for this is that each user may wish to use a different set of available compilers and / or may wish to use different compiler switches.
Select the required routine in the
Overview Pane. Switch to the
Compiler Checks tab and click the
Test Compile Snippet link. This will generate a test unit for
the snippet and try to compile it with all the configured compilers. The
Compiler Check tab display will update to show the results.
The test unit can be displayed in a dialog box by clicking the
Display Test Unit link.
You can also initiate tests from the Database | Test Compile menu
option or the
Test Compile toolbar button.
If any of the Delphi compilers from Delphi 6 onwards show one or more warnings following a test compile you may be able to inhibit them by enabling CodeSnip's code generator to emit suitable compiler directives. This is done using the Code Generation tab of the Preferences dialog box. Display the dialog box using the Tools | Preferences menu option.