X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Fformat%2Ftest-myhost;h=635f35f43e6f9acd22f205f9814ee3383114ff10;hb=8fcc5d7f43931e3ec9053b20f5e050b7a4008bc9;hp=d303a8f2f47604026df9bd72f587369e19522d62;hpb=23af631076209b31fb28feb90a779ff8dcc153a2;p=mmh diff --git a/test/format/test-myhost b/test/format/test-myhost index d303a8f..635f35f 100755 --- a/test/format/test-myhost +++ b/test/format/test-myhost @@ -4,31 +4,25 @@ # the localname entry out of the mts configuration file. # -if [ -z "${MH_TEST_COMMON}" ]; then - echo "MH_TEST_COMMON not set; try running via 'make check'" +if test -z "${MH_OBJ_DIR}"; then + srcdir=`dirname "$0"`/../.. + MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi -. ${MH_TEST_COMMON} +. "$MH_OBJ_DIR/test/common.sh" setup_test -runtest() -{ - testoutput=$(${MH_LIB_DIR}/ap -format "%(myhost)" ignore) - - if [ x"$1" != x"${testoutput}" ]; then - echo "For $2, expected $1 but got ${testoutput}" - exit 1 - fi -} - -runtest "$(hostname)" "local hostname test" +host=`${MH_OBJ_DIR}/test/getfqdn` +run_test "${MH_LIB_DIR}/ap -format %(myhost) ignore" "$host" \ + "local hostname test" cp ${MHMTSCONF} ${MH_TEST_DIR}/Mail/mts.conf || exit 1 export MHMTSCONF="${MH_TEST_DIR}/Mail/mts.conf" echo "localname: some.random.name" >> ${MHMTSCONF} -runtest "some.random.name" "mts.conf localname test" +run_test "${MH_LIB_DIR}/ap -format %(myhost) ignore" "some.random.name" \ + "mts.conf localname test" -exit 0 +exit $failed