536 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ...' $1 1>&2 |
537 |
# make output.txt |
# make output.txt |
538 |
echo |
echo |
|
rm -f run.log |
|
539 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
540 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00 |
541 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
|
else |
|
|
touch run.log |
|
542 |
fi |
fi |
543 |
if test ! -x $EXECUTABLE ; then |
if test ! -x $EXECUTABLE ; then |
544 |
|
rm -f run.log ; touch run.log |
545 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
546 |
echo " no executable:" $EXECUTABLE >> run.log |
echo " no executable:" $EXECUTABLE >> run.log |
547 |
RETVAL=8 |
RETVAL=8 |
548 |
|
ENDVAL=-1 |
549 |
else |
else |
550 |
if test $OUTPUTFILE -ot $EXECUTABLE ; then |
if test $OUTPUTFILE -ot $EXECUTABLE ; then |
551 |
|
rm -f run.log ; touch run.log |
552 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
553 |
( eval $COMMAND ) >> run.log 2>&1 |
( eval $COMMAND ) >> run.log 2>&1 |
554 |
RETVAL=$? |
RETVAL=$? |
555 |
else |
else |
|
echo " $OUTPUTFILE is up to date " >> run.log 2>&1 |
|
556 |
RETVAL=0 |
RETVAL=0 |
557 |
|
if test -f run.log ; then |
558 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
559 |
|
echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1 |
560 |
|
else |
561 |
|
touch run.log |
562 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
563 |
|
echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1 |
564 |
|
echo " no previous run.log: assume NORMAL END" >> run.log 2>&1 |
565 |
|
fi |
566 |
fi |
fi |
567 |
|
ENDVAL=`cat run.log | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
568 |
fi |
fi |
569 |
# echo "COMMAND='$COMMAND'" |
rm -f run.log_00 |
570 |
# echo "pwd='"`pwd`"'" |
#if test "x$RETVAL" = x0 ; then |
571 |
if test "x$RETVAL" = x0 ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
572 |
tail run.log |
tail run.log |
573 |
echo successful 1>&2 |
echo successful 1>&2 |
574 |
# === Reduce the size of the testing emails! |
# === Reduce the size of the testing emails! |
577 |
return 0 |
return 0 |
578 |
else |
else |
579 |
tail run.log |
tail run.log |
580 |
echo failed 1>&2 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
581 |
cp run.log $CDIR"/run.log" |
cp run.log $CDIR"/run.log" |
582 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
583 |
return 1 |
return 1 |