Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / nomode.test
1 #! /bin/sh
2 # nomode.test - check that we can actually get help
3 #
4 #   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
5 #   Written by Gary V. Vaughan, 2003
6 #
7 #   This file is part of GNU Libtool.
8 #
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
13 #
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING.  If not, a copy
21 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ####
25
26 . tests/defs || exit 1
27
28 status=$EXIT_SUCCESS
29 if $LIBTOOL --help 2>&1 | grep '^Usage:' >/dev/null; then :
30 else
31   echo "cannot get top-level help"
32   status=$EXIT_FAILURE
33 fi
34
35 if $LIBTOOL --mode=link --help 2>&1 | grep '^Usage:' >/dev/null; then :
36 else
37   echo "cannot get --mode=link help"
38   status=$EXIT_FAILURE
39 fi
40
41 # The emoticon below works around a nasty bug in Ultrix /bin/sh
42 if ($LIBTOOL 2>&1; :) | grep 'you must specify a MODE' >/dev/null; then :
43 else
44   echo "invalid error when no mode is specified"
45   status=$EXIT_FAILURE
46 fi
47
48 exit $status