1 | #! /bin/sh |
---|
2 | # $Id: yat_msg_error_test.sh 3210 2014-05-05 06:10:02Z peter $ |
---|
3 | # |
---|
4 | # Copyright (C) 2011, 2012, 2013 Peter Johansson |
---|
5 | # |
---|
6 | # This file is part of the yat library, http://dev.thep.lu.se/yat |
---|
7 | # |
---|
8 | # The yat library is free software; you can redistribute it |
---|
9 | # and/or modify it under the terms of the GNU General Public License as |
---|
10 | # published by the Free Software Foundation; either version 3 of the |
---|
11 | # License, or (at your option) any later version. |
---|
12 | # |
---|
13 | # The yat library is distributed in the hope that it will be useful, |
---|
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | # General Public License for more details. |
---|
17 | # |
---|
18 | # You should have received a copy of the GNU General Public License |
---|
19 | # along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | |
---|
21 | |
---|
22 | # test macros in m4/yat_msg_error.m4 |
---|
23 | |
---|
24 | required="autoconf" |
---|
25 | |
---|
26 | set -e |
---|
27 | |
---|
28 | . ./test/init.sh || exit 99 |
---|
29 | |
---|
30 | specific_msg='some specific message a51965' |
---|
31 | |
---|
32 | cat >> configure.ac <<EOF |
---|
33 | YAT_MSG_ERROR([$specific_msg]) |
---|
34 | AC_PREREQ([2.63]) |
---|
35 | AC_MSG_CHECKING([for something more]) |
---|
36 | AC_MSG_RESULT([no]) |
---|
37 | YAT_MSG_ERROR([could not find something more]) |
---|
38 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM]) |
---|
39 | AC_CONFIG_FILES([Makefile]) |
---|
40 | AC_OUTPUT |
---|
41 | EOF |
---|
42 | |
---|
43 | echo "@configure_input@" > Makefile.in |
---|
44 | |
---|
45 | bootstrap |
---|
46 | rm -f config.status |
---|
47 | run ./configure 1 $configure_opts |
---|
48 | grep "$specific_msg" stderr || exit_fail |
---|
49 | grep "$specific_msg" config.log || exit_fail |
---|
50 | |
---|
51 | # configure should abort before config.status creates Makefile |
---|
52 | test -f Makefile && exit_fail |
---|
53 | |
---|
54 | grep 'for something more' stdout || exit_fail |
---|
55 | exit_success |
---|