- 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 */
|
||||||
|
27
src/testl
27
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
|
||||||
mv $template.dvi attack.dvi
|
latex $template.tex
|
||||||
dvips attack.dvi -o attack.ps
|
|
||||||
|
mv $template.dvi attack.dvi
|
||||||
# also eps output now
|
dvips attack.dvi -o attack.ps
|
||||||
ps2eps -f attack.ps
|
|
||||||
|
# also eps output now
|
||||||
xdvi attack.dvi # for Xdvi
|
ps2eps -f attack.ps
|
||||||
# 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