tweak

David Anderson 2024-09-09 16:38:48 -07:00
parent 6f5144e3ed
commit 969543ec19
1 changed files with 19 additions and 16 deletions

@ -4,10 +4,12 @@ in your language of choice (Python, PHP, Perl, Java, bash).
```
--init_script "scriptname arg1 ... argn"
--compare_script "scriptname arg1 ... argn"
```
This specifies a script to check the validity of a result.
The script is passed parameters (see below) that identify the result.
```--init_script```
specifies a script to check the validity of a result.
The script is passed parameters (see below) that identify the result.
The script's exit code is:
* zero if the result is valid
@ -18,10 +20,7 @@ In this case the validation will tried again in a few hours.
* Any other nonzero value indicates an error,
and the result is marked as invalid.
```
--compare_script "filename arg1 ... argn"
```
This specifies a script to compare two results.
```--compare_script``` specifies a script to compare two results.
The script's exit code is
* zero if the results match
@ -29,10 +28,17 @@ The script's exit code is
if a transient error occurred.
* Any other nonzero value if the results don't match.
The scripts must be put in your project's bin/ directory.
For applications that don't use replication,
the compare script need not be given.
For applications that don't need output file syntax checking,
the init script need not be given.
## Arguments passed to the scripts
```arg1 ... argn``` represent cmdline args to be passed to the scripts.
The options for init_script are:
The options for the init script are:
```files```:
list of paths of output files of the result
@ -50,18 +56,14 @@ list of paths of output files of the 2nd result.
```runtime2```: runtime of the 2nd result, in seconds.
For both scripts,
```arg1 ... argn``` can be omitted,
in which case only the output file paths are passed to the scripts.
in which case only the output file paths are passed to the script.
The scripts must be put in your project's bin/ directory.
For applications that don't use replication,
the compare script need not be given.
For applications that don't need output file syntax checking,
the init script need not be given.
## Example
As an example, the following PHP script, used as a compare script,
would require that results match exactly:
requires that results match exactly:
```php
#/usr/bin/env
<?php
@ -79,6 +81,7 @@ if (md5_file($f1) != md5_file($f2)) {
The corresponding entry in config.xml would look like
```xml
<daemon>
<cmd>script_validator --app uppercase -d 3 --compare_script compare.php</cmd>
<cmd>script_validator --app uppercase --compare_script compare.php</cmd>
...
</daemon>
```