Fixed to report failure if getfulname hadn't been built yet.
[mmh] / test / format / test-myname
1 #!/bin/sh
2 #
3 # Test that we can retrieve the local username via the passwd file,
4 # the Signature profile entry, and via SIGNATURE environment variable.
5 #
6
7 set -e
8
9 if test -z "${MH_OBJ_DIR}"; then
10     srcdir=`dirname "$0"`/../..
11     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
12 fi
13
14 . "$MH_OBJ_DIR/test/common.sh"
15
16 setup_test
17
18 unset SIGNATURE
19
20 fullname=`${MH_OBJ_DIR}/test/getfullname`
21 run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \
22          "$fullname" "GECOS field test"
23
24 echo "Signature: Some Random Name 1" >> ${MH}
25
26 run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \
27          "Some Random Name 1" "MH Profile Signature test"
28
29 export SIGNATURE="Some Random Name 2"
30
31 run_test "${MH_LIB_DIR}/ap -format %(myname) ignore" \
32          "${SIGNATURE}" "SIGNATURE Environment test"
33
34 exit $failed