#! /bin/sh
# Make an interactive test for Zile
#
# Copyright (c) 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Zile.
#
# GNU Zile is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Zile 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 General Public License
# along with GNU Zile; see the file COPYING.  If not, write to the
# Free Software Foundation, Fifth Floor, 51 Franklin Street, Boston,
# MA 02111-1301, USA.

# Usage: make_interactive_test TEST-NAME

# Zile is run on zile_test_input copied to TEST-NAME.output, and the
# script is written to TEST-NAME.script

cp zile_test.input $1.input
autoexpect -f log.exp ../../zile -q $1.input
( echo -n "interactive_test $1 \"";
grep --text ^send log.exp | sed -e 's/^send \-\- "//' | sed -e 's/"$//' | tr -d "\n";
echo -n "\"" ) > $1.exp
rm log.exp $1.input~
mv $1.input $1.output
