Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / objectlist.test
1 #! /bin/sh
2 # objectlist.test - make sure that a nonexisting objectlist file is properly
3 #                   mentioned and that the argument may contain spaces.
4 #
5 #   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
6 #   Written by Gary V. Vaughan, 2003
7 #
8 #   This file is part of GNU Libtool.
9 #
10 # GNU Libtool is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation; either version 2 of
13 # the License, or (at your option) any later version.
14 #
15 # GNU Libtool is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Libtool; see the file COPYING.  If not, a copy
22 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
23 # or obtained by writing to the Free Software Foundation, Inc.,
24 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 ####
26
27 . tests/defs || exit 1
28
29 # Try a sample link command.
30 linkresult=`$LIBTOOL -n --mode=link $CC -objectlist nonexistant 2>&1`
31 test $? -eq 0 && exit $EXIT_FAILURE
32
33 echo "$linkresult" | ${EGREP} "nonexistant" >/dev/null 2>&1 && {
34   func_msg "$progname: error message contains -objectlist argument as expected"
35 }  || exit $EXIT_FAILURE
36
37
38 objlist="object list with spaces"
39 : > "$objlist"
40 linkresult=`$LIBTOOL -n --mode=link $CC -o a.out -objectlist "$objlist" 2>&1`
41 rm -f "$objlist"
42
43 echo "$linkresult" | ${EGREP} "spaces" >/dev/null 2>&1 && {
44   func_msg "$progname: -objectlist with spaces in filename not recognized."
45   exit $EXIT_FAILURE
46
47
48 exit $EXIT_SUCCESS