| 1 | #! /bin/sh |
| 2 | progname=`basename $0` |
| 3 | |
| 4 | if [ -f ns ] ; then |
| 5 | PROG=./ns |
| 6 | elif [ -f ns.dyn ] ; then |
| 7 | PROG=./ns.dyn |
| 8 | fi |
| 9 | |
| 10 | rm -f out.tr all.tr core |
| 11 | echo $PROG tcl/test/test-suite-$1.tcl $2 $3 |
| 12 | if $PROG tcl/test/test-suite-$1.tcl $2 $3 ; then |
| 13 | if [ ! -f out.tr ] ; then |
| 14 | echo "$progname: no output?" 1>&2 |
| 15 | else |
| 16 | if [ -n "$DISPLAY" ] ; then |
| 17 | raw2xg -m 90 -s 0.01 out.tr | xgraph |
| 18 | else |
| 19 | file=`perl -ane '$F[2] =~ s/test_// ; $F[2] =~ s/_/-/g; print $F[2]; exit' out.tr` |
| 20 | raw2gp -a out.tr | gnuplot |
| 21 | echo "$progname: postscript of graph is in $file.ps" |
| 22 | fi |
| 23 | fi |
| 24 | elif [ -f core ] ; then |
| 25 | echo "$progname: core dump" 1>&2 |
| 26 | fi |