- Added exit codes and use these in testl script.
This commit is contained in:
parent
ca01a09377
commit
d14d5ce06b
20
src/main.c
20
src/main.c
@ -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 */
|
||||||
|
21
src/testl
21
src/testl
@ -13,20 +13,21 @@ 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
|
||||||
latex $template.tex
|
if [ "$?" -eq "3" ]
|
||||||
|
then
|
||||||
|
latex $template.tex
|
||||||
|
|
||||||
mv $template.dvi attack.dvi
|
mv $template.dvi attack.dvi
|
||||||
dvips attack.dvi -o attack.ps
|
dvips attack.dvi -o attack.ps
|
||||||
|
|
||||||
# also eps output now
|
# also eps output now
|
||||||
ps2eps -f attack.ps
|
ps2eps -f attack.ps
|
||||||
|
|
||||||
xdvi attack.dvi # for Xdvi
|
|
||||||
# kdvi attack.dvi # for KDE environment
|
|
||||||
# kghostview attack.ps # postscript in KDE
|
|
||||||
|
|
||||||
|
xdvi attack.dvi # for Xdvi
|
||||||
|
# kdvi attack.dvi # for KDE environment
|
||||||
|
# kghostview attack.ps # postscript in KDE
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
|
|
||||||
echo "No file $file found."
|
echo "No file $file found."
|
||||||
|
Loading…
Reference in New Issue
Block a user