#! /bin/sh # # $Header: /home/gene/library/website/docsrc/jmt/RCS/testseed.sh,v 395.1 2008/04/20 17:25:47 gene Exp $ # # Copyright (c) 2004 Gene Michael Stover. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA TMP_C=/tmp/testseed-$$.c.txt TMP_LISP=/tmp/testseed-$$.lisp.txt cat < Seed Test

The reference program is the C program, ./testseed-c. Output from it goes to $TMP_C.

The program being tested is the Common Lisp program. Output it goes to $TMP_LISP.

I will run both programs, & save their outputs to separate files. Then I will compare them with diff. Any difference probably indicates an error. If it works, you'll see three lines which look like commands you would type on the Bourne shell command line. If you see anything else, especially differences after the diff command, or if you see less than the three commands, it indicates an error. You probably can't debug the error from this web page.

EOF

echo \$ ./testseed-c \>$TMP_C
if ./testseed-c >$TMP_C; then
    echo \$ ./testseed-lisp \>$TMP_LISP

    # Now we run the Lisp program.  I'd like to check its exit value,
    # but that's not portable.  Bummer.  Anyway, if it bails, we'll
    # have an empty output file, so 'diff' will catch that for us.
    ./testseed-lisp >$TMP_LISP
    echo \$ diff $TMP_C $TMP_LISP
    if diff $TMP_C $TMP_LISP; then
        : # good
    else
        echo there were differences or some other error
    fi
else
    echo error
fi

cat <

End.

EOF # rm $TMP_C $TMP_LISP # --- end of file ---