DLTK Validators Framework provides tools to run custom scripts on your source files and integrate these scripts into your workbench. Such scripts are commonly targeted to find and report problems in source files - so they are called "validators" or "checkers". DLTK Validators framework provides flexible yet simple way to manage checkers.

DLTK Validators Framework provides tools to run custom scripts on your source files and integrate these scripts into your workbench. Such scripts are commonly targeted to find and report problems in source files - so they are called "validators" or "checkers". DLTK Validators framework provides flexible yet simple way to manage checkers.

You need to have DLTK Project created in your workspace. If you want to integrate any number of custom checkers into your project, follow these steps:

You need to have DLTK Project created in your workspace. If you want to integrate any number of custom checkers into your project, follow these steps:

Line 26:

Line 22:

[[Image:Tutorial3.JPG]]

[[Image:Tutorial3.JPG]]

−

4. Type name of the validator into '''Validator name''' text field. The name may be completely arbitrary - you will use names to distinguish between validators on your list.

+

+

4.Type name of the validator into '''Validator name''' text field. The name may be completely arbitrary - you will use names to distinguish between validators on your list.

[[Image:VTutorial4.JPG‎ ]]

[[Image:VTutorial4.JPG‎ ]]

+

5. Provide a path to your script in the '''Command to run checker field'''.

5. Provide a path to your script in the '''Command to run checker field'''.

Line 43:

Line 41:

[[Image:VTutorial6.JPG‎ ]]

[[Image:VTutorial6.JPG‎ ]]

+

7. Into '''Filename extensions''' text field type extensions of files on which the script must be performed. Separate extensions by commas. Use * if you want to run script on all the files.

7. Into '''Filename extensions''' text field type extensions of files on which the script must be performed. Separate extensions by commas. Use * if you want to run script on all the files.

[[Image:Tutorial7.JPG‎ ]]

[[Image:Tutorial7.JPG‎ ]]

+

8. We have configured the input for DLTK Validators.

8. We have configured the input for DLTK Validators.

Now let's configure the output. Validator is supposed generate error and/or warning reports. However to integrate these reports into workbench infrastructure DLTK validators Framework must be familiar with the format of such reports. So we provide interface for errors and warnings reports specification. Consider the following example of error report:

Now let's configure the output. Validator is supposed generate error and/or warning reports. However to integrate these reports into workbench infrastructure DLTK validators Framework must be familiar with the format of such reports. So we provide interface for errors and warnings reports specification. Consider the following example of error report:

+

''Error: myfile.tcl: line 16 Something wrong here''

''Error: myfile.tcl: line 16 Something wrong here''

−

In this line we have the following tokens:

−

''myfile.tcl'' name of file where error has been found

+

In this line we have the following tokens:

−

+

−

''16'' number of line where error is located

+

−

''Something wrong here'' message describing the error

+

<table>

−

+

<tr>

+

<td> ''myfile.tcl'' </td>

+

<td>-name of file where error has been found </td>

+

</tr>

+

<tr>

+

<td>''16''</td>

+

<td>-number of line where error is located </td>

+

</tr>

+

<tr>

+

<td>''Something wrong here''</td>

+

<td>-message describing the error</td>

+

</tr>

+

</table>

We assume that above mentioned tokens: file name, line number and problem message are common for problem reports. So we provide set of predefined wildcards which you can use to define set of output rules.

We assume that above mentioned tokens: file name, line number and problem message are common for problem reports. So we provide set of predefined wildcards which you can use to define set of output rules.

−

+

<table>

−

%f

+

<tr>

−

file name

+

<td> ''%f'' </td>

−

%n

+

<td>-file name</td>

−

line number

+

</tr>

−

%m

+

<tr>

−

problem message

+

<td>''16''</td>

+

<td>-number of line where error is located </td>

+

</tr>

+

<tr>

+

<td> ''%m''</td>

+

<td>-problem message</td>

+

</tr>

+

</table>

So let's write a rule that assigns "error" to the pattern in our example: Error: %f line %n %m

So let's write a rule that assigns "error" to the pattern in our example: Error: %f line %n %m

3. From the Validators table select the validator and push Edit button

+

3. From the '''Validators''' table select the validator and push '''Edit''' button

4. Provide options for validator

4. Provide options for validator

−

5. Click Ok

+

5. Push '''Ok'''

Latest revision as of 08:28, 6 May 2008

DLTK Validators Framework provides tools to run custom scripts on your source files and integrate these scripts into your workbench. Such scripts are commonly targeted to find and report problems in source files - so they are called "validators" or "checkers". DLTK Validators framework provides flexible yet simple way to manage checkers.

4.Type name of the validator into Validator name text field. The name may be completely arbitrary - you will use names to distinguish between validators on your list.

5. Provide a path to your script in the Command to run checker field.

On Unix/Linux: Provide a path to any file that is marked as executable.
on Windows: Provide a path to .bat file or .exe file.

You can use Browse... button to locate file on your hard drive.

6. Type arguments of your validation script into Checker arguments text field. You can use %f wildcard as a substitute for input file name.

7. Into Filename extensions text field type extensions of files on which the script must be performed. Separate extensions by commas. Use * if you want to run script on all the files.

8. We have configured the input for DLTK Validators.

Now let's configure the output. Validator is supposed generate error and/or warning reports. However to integrate these reports into workbench infrastructure DLTK validators Framework must be familiar with the format of such reports. So we provide interface for errors and warnings reports specification. Consider the following example of error report:

Error: myfile.tcl: line 16 Something wrong here

In this line we have the following tokens:

myfile.tcl

-name of file where error has been found

16

-number of line where error is located

Something wrong here

-message describing the error

We assume that above mentioned tokens: file name, line number and problem message are common for problem reports. So we provide set of predefined wildcards which you can use to define set of output rules.

%f

-file name

16

-number of line where error is located

%m

-problem message

So let's write a rule that assigns "error" to the pattern in our example: Error: %f line %n %m