]> diplodocus.org Git - nmh/blob - test/mhparam/test-profile
Replace GNUism with standard touch flag in test-scan-file.
[nmh] / test / mhparam / test-profile
1 #!/bin/sh
2 ######################################################
3 #
4 # Test profile parser warning messages.
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 require_runpty_to_simulate_tty
19
20 actual="${MH_TEST_DIR}/test-profile$$.actual"
21 expected="$MH_TEST_DIR/test-profile$$.expected"
22
23 start_test 'without post component in profile'
24 set +e
25 run_test 'mhparam post' ''
26 set -e
27
28 start_test 'disabled post warning'
29 echo 'post: -snoop' >>"$MH"
30 run_test 'mhparam post' '-snoop'
31
32 start_test 'with no postproc component in profile'
33 grep -v '^postproc: ' "$MH" >"$MH.new"
34 cat >"$expected" <<EOF
35 mhparam: post profile component will be ignored. To suppress this warning,
36 either remove it, comment it with #:, or add the following to $MH.new:
37 postproc: ${nmhlibexecdir}/post
38
39 -snoop
40 EOF
41 MH="$MH.new" run_without_input "${actual}" mhparam post
42 check "$expected" "$actual"
43 rm -f "$MH.new"
44
45 start_test 'multiple profile components'
46 printf 'repeated-component: 1\nrepeated-component: 2\n' >>"$MH"
47 run_test 'mhparam moreproc' \
48 "mhparam: multiple \"repeated-component\" profile components in $MH,"\
49 " ignoring \"2\", continuing...
50 cat"
51
52 finish_test
53 exit ${failed}