- Added exit codes and use these in testl script.

This commit is contained in:
ccremers 2004-05-26 19:40:40 +00:00
parent ca01a09377
commit d14d5ce06b
2 changed files with 33 additions and 14 deletions

View File

@ -16,7 +16,14 @@
* *
* How to install Scyther. * How to install Scyther.
* *
* \section coding Coding convertions * \section exit Exit codes
*
* 0 Okay No attack found, claims encountered
* 1 Error Something went wrong (error)
* 2 Okay No attack found (because) no claims encountered
* 3 Okay Attack found
*
* \section coding Coding conventions
* *
* Usually, each source file except main.c has an myfileInit() and myfileDone() function * Usually, each source file except main.c has an myfileInit() and myfileDone() function
* available. These allow any initialisation and destruction of required structures. * available. These allow any initialisation and destruction of required structures.
@ -368,6 +375,17 @@ main (int argc, char **argv)
if (sys->attack != NULL && sys->attack->length != 0) if (sys->attack != NULL && sys->attack->length != 0)
{ {
attackDisplay(sys); attackDisplay(sys);
/* mark exit code */
exitcode = 3;
}
else
{
/* check for no claims */
if (sys->failed == 0)
{
/* mark exit code */
exitcode = 2;
}
} }
/* latex closeup */ /* latex closeup */

View File

@ -13,8 +13,9 @@ template=../src/attacktemplate
if [ -f $file ] if [ -f $file ]
then then
../src/scyther --latex $file -o attack.tex ../src/scyther --latex $file -o attack.tex
if [ "$?" -eq "3" ]
then
latex $template.tex latex $template.tex
mv $template.dvi attack.dvi mv $template.dvi attack.dvi
@ -26,7 +27,7 @@ then
xdvi attack.dvi # for Xdvi xdvi attack.dvi # for Xdvi
# kdvi attack.dvi # for KDE environment # kdvi attack.dvi # for KDE environment
# kghostview attack.ps # postscript in KDE # kghostview attack.ps # postscript in KDE
fi
else else
echo "No file $file found." echo "No file $file found."