File: test-subshell

package info (click to toggle)
bashdb 4.0.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,820 kB
  • ctags: 942
  • sloc: sh: 10,581; lisp: 885; makefile: 449; ansic: 325
file content (29 lines) | stat: -rwxr-xr-x 806 bytes parent folder | download
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
#!/bin/sh
# -*- shell-script -*-
#$Id: test-subshell,v 1.3 2008/08/29 02:55:44 rockyb Exp $

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

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

tests=${@:-"subshell1 subshell2 subshell3"}

for TEST_NAME in $tests; do
  echo "checking $TEST_NAME..."
  RIGHT_FILE="${top_srcdir}/test/data/${TEST_NAME}.right"
  TEST_FILE="${top_builddir}/test/${TEST_NAME}.check"
  (cd $srcdir && $SH ${TEST_NAME}.tests > $TEST_FILE 2>&1 < /dev/null)

  check_output $TEST_FILE ${top_srcdir}/test/data/${TEST_NAME}.right
  rc=$?
  if test "$rc" -eq  0 ; then
    rm -f $TEST_FILE
  else
    exit $rc
  fi
done

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