]> diplodocus.org Git - nmh/blob - test/rcv/test-rcvtty
Tell make that uip/mhical.c depends on sbr/icalparse.h
[nmh] / test / rcv / test-rcvtty
1 #!/bin/sh
2 ######################################################
3 #
4 # Test rcvtty
5 #
6 ######################################################
7
8 set -e
9
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname $0`/../..
12 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
13 fi
14
15 . "$MH_OBJ_DIR/test/common.sh"
16
17 setup_test
18
19 # Use proper program, likely not the first one on PATH.
20 rcvtty="${MH_LIBEXEC_DIR}/rcvtty"
21
22 check_exit '-eq 1' $rcvtty -
23
24 expected="$MH_TEST_DIR/$$.expected"
25 actual="$MH_TEST_DIR/$$.actual"
26
27
28 # check -help
29 start_test "-help"
30 cat >"$expected" <<EOF
31 Usage: rcvtty [command ...]
32 switches are:
33 -biff
34 -form formatfile
35 -(forma)t string
36 -width columns
37 -[no]newline
38 -[no]bell
39 -version
40 -help
41 EOF
42
43 #### Skip nmh intro text.
44 run_prog "$rcvtty" -help 2>&1 | sed '/^$/,$d' >"$actual"
45 check "$expected" "$actual"
46
47 # check -version
48 start_test "-version"
49 case `$rcvtty -v` in
50 rcvtty\ --*) ;;
51 * ) printf '%s: rcvtty -v generated unexpected output\n' "$0" >&2
52 failed=`expr ${failed:-0} + 1`;;
53 esac
54
55 # check normal operation. Use -biff to avoid sending notification to
56 start_test "normal operation. Use -biff to avoid sending notification to"
57 # each of the user's terminals. So this command shouldn't do
58 # anything. It will write the notification(s) if the user actually
59 # has actually enabled biff notification, or has set the exec bit of
60 # any of their ttys.
61 cat >"$expected" <<EOF
62 EOF
63 run_prog $rcvtty <${MH_TEST_DIR}/Mail/inbox/1 -biff >"$actual" 2>&1
64 check "$expected" "$actual"
65
66
67 finish_test
68 exit ${failed:-0}