#!/bin/sh ###################################################### # # Test display of new version welcome message. This # doesn't really belong in install-mh. # ###################################################### set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname $0`/../.. MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi . "${MH_OBJ_DIR}/test/common.sh" setup_test require_prog script actual="$MH_TEST_DIR/test-version-check$$.actual" context="${MH_TEST_DIR}"/Mail/context start_test 'with welcome message' # Removing Version will trigger the welcome message. grep -v Version "$context" > "$context.NEW" mv -f "$context.NEW" "$context" # The will command wait for the user to hit return. script seems to do what # we want, continue, when run in the background. script -c 'pick last' -f -q "$actual" >/dev/null & wait $! grep 'Welcome to nmh version ' "$actual" >/dev/null rm "$actual" finish_test start_test 'without welcome message' # After running the previous test, this one should not have # the welcome message. script -c 'pick last' -f -q "$actual" >/dev/null & wait $! grep 'Welcome to nmh version ' "$actual" >/dev/null && false rm "$actual" finish_test exit $failed