"Fossies" - the Fresh Open Source Software Archive

Member "bashdb-5.0-1.1.0/test/integration/test-sig" (5 Sep 2019, 2354 Bytes) of package /linux/privat/bashdb-5.0-1.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test-sig": 4.4-1.0.1_vs_5.0-1.1.0.

    1 #!/usr/local/bin/bash
    2 # -*- shell-script -*-
    3 t=${0##*/}; TEST_NAME=${t:5}   # basename $0 with 'test-' stripped off
    4 SH=/usr/local/bin/bash
    5 
    6 # Put this trap into a known state to make the test more reproducible.
    7 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801372
    8 trap '' SIGXFSZ
    9 
   10 [ -z "$builddir" ] && export builddir=$PWD
   11 
   12 . ${builddir}/check-common.sh
   13 debugged_script="$top_srcdir/test/example/sig.sh"
   14 
   15 typeset short_test_name='sig'
   16 if (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} == 1 )) ; then
   17     RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}-41.right"
   18 elif (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} == 3 )) ; then
   19     short_test_name='sig-43'
   20     RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}-43.right"
   21 elif (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} >= 4 )) ; then
   22     RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}-44.right"
   23 elif (( ${BASH_VERSINFO[0]} == 5 && ${BASH_VERSINFO[0]} >= 0 )) ; then
   24     RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}-50.right"
   25 fi
   26 
   27 case $host_os in
   28     freebsd* | netbsd* )
   29     exit 77 ;;
   30     darwin* )
   31     RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}-Darwin.right"
   32     ;;
   33     * )
   34 esac
   35 
   36 # This test has been too much of a pain
   37 exit 77
   38 
   39 FILTERED_TEST_FILE="/tmp/${TEST_NAME}-filtered.check"
   40 FILTERED_RIGHT_FILE="/tmp/${TEST_NAME}-filtered.right"
   41 
   42 typeset dbg_opts="-L ${top_srcdir} $run_debugger_opts"
   43 typeset cmdfile="${top_srcdir}/test/data/${short_test_name}.cmd"
   44 
   45 (cd $srcdir && run_debugger "$debugged_script" "$dbg_opts" "$cmdfile" 2>&1 >$TEST_FILE </dev/null)
   46 
   47 /bin/grep -v '^sig.tests: line 12' $RIGHT_FILE>${FILTERED_RIGHT_FILE}
   48 /bin/grep -v '^sig.tests: line 12' $TEST_FILE \
   49   | /bin/sed -e "s:in file \`sig.sh' at line [0-9][0-9]*:in file \`sig.sh' at line 55:" \
   50   | /bin/sed -e "s:in file \`eval.sh' at line [0-9][0-9]*:in file \`eval.sh' at line 55:" \
   51   | /bin/sed -e "s:bashdb_eval_[0-9][0-9]*:bashdb_eval_5040:" \
   52   | /bin/sed -e "s:main(.*) called from file \`bashdb' at line 0:main() called from file \`bashdb' at line 0:" \
   53   | /bin/grep -v '^sig.tests: line 10:' | \
   54 /bin/grep -v '^SIGPIPE' | \
   55 /bin/grep -v '^SIGSYS' | \
   56 /bin/grep -v '^SIGPROF' >${FILTERED_TEST_FILE}
   57 check_output $FILTERED_TEST_FILE $FILTERED_RIGHT_FILE
   58 rc=$?
   59 
   60 ((0 != rc)) && exit $rc
   61 rm $FILTERED_RIGHT_FILE
   62 rm $TEST_FILE
   63 
   64 # Return code tells testing mechanism whether passed or not.
   65 exit 0