1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#!/usr/bin/env bash
# -*- 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}
if (( BASH_VERSINFO[0] > 4 || \
(BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 1) )) ; then
RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}-output-41.right"
fi
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
|