2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
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)
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.
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/>.
17 # Sanity check for the automake testsuite: the 'is_newest' subroutine.
24 Y () { command_ok_ "is_newest $*" is_newest "$@"; }
25 N () { command_ok_ "not is_newest $*" not is_newest "$@"; }
27 # A simple "touch -r" might not work, since on some file systems, and/or
28 # with some 'touch' versions, it might truncate the timestamp (or even
29 # rounded it upwards maybe). So the first (apparently redundant) 'touch'
30 # invocation below ensures that the timestamp gets "normalized" in a way
31 # that allows it to be correctly copied by the second 'touch' invocation.
34 touch -r "$1" "$1" && touch -r "$1" "$2"
42 stat a b c || : # For debugging.
53 stat c d || : # For debugging.
57 # Should work on directories too, both empty and not-empty. An older
58 # implementation of 'is_newest' failed if the first argument was a
59 # directory containing files newer than itself (see automake bug#9147).
70 stat u v x y x/foo y/foo || : # For debugging.
86 # A couple of mild "stress" tests.