#!/bin/bash -f
# -*- shell-script -*-
#$Id: test-misc,v 1.3 2008/08/23 17:09:36 rockyb Exp $

[ -z "$srcdir" ] && export srcdir=$PWD
[ -z "$builddir" ] && export builddir=$PWD
[ -z "$top_builddir" ] && export top_builddir=$builddir/../..

TEST_NAME='misc'

. ${top_builddir}/test/integration/check-common.sh

debugged_script="$top_builddir/test/example/dbg-test2.sh"

(cd $srcdir && run_debugger $debugged_script 2>&1 >$TEST_FILE </dev/null)

# Different OS's handle ARGV differently, and "info args" may come out
# differently depending on that.
cat ${TEST_FILE} | sed -e "s:1 = .*/dbg-test2.sh:1 = ./example/dbg-test2.sh:" \
| sed -e 's:record the command history is .*:record the command history is: ' \
> ${TEST_FILTERED_FILE}

check_output $TEST_FILTERED_FILE $RIGHT_FILE
rc=$?

((0 != rc)) && exit $rc
rm -f $TEST_FILE

# Return code tells testing mechanism whether passed or not.
exit 0
