Merge branch 'fix-pr14560' into micro
[platform/upstream/automake.git] / t / spy-rm.tap
1 #! /bin/sh
2 # Copyright (C) 2012-2013 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Check whether "rm -f" do not complain if called without file
18 # operands.  We'd like to depend on this behaviour (which seems
19 # to hold on all non-museum systems, and will soon be mandated
20 # by POSIX as well) in future version of automake, to simplify
21 # automake-provided cleanup rules.
22 # References:
23 #  <http://lists.gnu.org/archive/html/bug-autoconf/2012-02/msg00002.html>
24 #  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10819>
25 #  <http://austingroupbugs.net/view.php?id=542>
26
27 am_create_testdir=empty
28 . test-init.sh
29
30 plan_ 10
31
32 chk ()
33 {
34   if test -f /bin/rm; then
35     command_ok_ "/bin/rm $*" /bin/rm "$@"
36   else
37     skip_ -r "/bin/rm not found"
38   fi
39   command_ok_ "rm $*" rm "$@"
40 }
41
42 chk -f
43 chk -rf
44 chk -fr
45 chk -f -r
46 chk -r -f
47
48 :