test: check that subsecond mtime works with make.
[automake.git] / t / silent-defaults.sh
blobe6a11ecc65c9fb78d878dce633973ea9fbc1182e
1 #!/bin/sh
2 # Copyright (C) 2022-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Check verbose mode defaults and behavior. See bug#32868.
18 # Because we have to rerun the autotools for every configuration,
19 # this test can take 30 seconds or so to run.
21 . test-init.sh
23 : > Makefile.am
25 # \f
26 echo "Default behavior is currently verbose."
27 cat <<EOF >configure.ac
28 AC_INIT([silent-defaults-default-verbose], [1.0])
29 AM_INIT_AUTOMAKE
30 AC_CONFIG_FILES([Makefile])
31 AC_OUTPUT
32 EOF
34 $ACLOCAL
35 $AUTOMAKE
36 $AUTOCONF
38 ./configure
39 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
41 ./configure -C --enable-silent-rules
42 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
44 ./configure -C --disable-silent-rules
45 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
47 # \f
48 echo "User doesn't pick a silent mode default before AM_INIT_AUTOMAKE."
49 cat <<EOF >configure.ac
50 AC_INIT([silent-defaults-use-am_silent_rules], [1.0])
51 AM_SILENT_RULES
52 AM_INIT_AUTOMAKE
53 AC_CONFIG_FILES([Makefile])
54 AC_OUTPUT
55 EOF
57 $ACLOCAL
58 $AUTOMAKE
59 $AUTOCONF
61 ./configure
62 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
64 ./configure -C --enable-silent-rules
65 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
67 ./configure -C --disable-silent-rules
68 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
70 # \f
71 echo "User disables silent mode default before AM_INIT_AUTOMAKE."
72 cat <<EOF >configure.ac
73 AC_INIT([silent-defaults-user-disable-before-am_init], [1.0])
74 AM_SILENT_RULES([no])
75 AM_INIT_AUTOMAKE
76 AC_CONFIG_FILES([Makefile])
77 AC_OUTPUT
78 EOF
80 $ACLOCAL
81 $AUTOMAKE
82 $AUTOCONF
84 ./configure
85 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
87 ./configure -C --enable-silent-rules
88 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
90 ./configure -C --disable-silent-rules
91 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
93 # \f
94 echo "User enables silent mode default before AM_INIT_AUTOMAKE."
95 cat <<EOF >configure.ac
96 AC_INIT([silent-defaults-user-enable-before-am_init], [1.0])
97 AM_SILENT_RULES([yes])
98 AM_INIT_AUTOMAKE
99 AC_CONFIG_FILES([Makefile])
100 AC_OUTPUT
103 $ACLOCAL
104 $AUTOMAKE
105 $AUTOCONF
107 ./configure
108 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
110 ./configure -C --enable-silent-rules
111 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
113 ./configure -C --disable-silent-rules
114 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
116 # \f
117 echo "User doesn't pick a silent mode default after AM_INIT_AUTOMAKE."
118 cat <<EOF >configure.ac
119 AC_INIT([silent-defaults-user-no-default-after-am_init], [1.0])
120 AM_INIT_AUTOMAKE
121 AM_SILENT_RULES
122 AC_CONFIG_FILES([Makefile])
123 AC_OUTPUT
126 $ACLOCAL
127 $AUTOMAKE
128 $AUTOCONF
130 ./configure
131 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
133 ./configure -C --enable-silent-rules
134 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
136 ./configure -C --disable-silent-rules
137 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
139 # \f
140 echo "User disables silent mode default after AM_INIT_AUTOMAKE."
141 cat <<EOF >configure.ac
142 AC_INIT([silent-defaults-user-disable-after-am_init], [1.0])
143 AM_INIT_AUTOMAKE
144 AM_SILENT_RULES([no])
145 AC_CONFIG_FILES([Makefile])
146 AC_OUTPUT
149 $ACLOCAL
150 $AUTOMAKE
151 $AUTOCONF
153 ./configure
154 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
156 ./configure -C --enable-silent-rules
157 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
159 ./configure -C --disable-silent-rules
160 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile
162 # \f
163 echo "User enables silent mode default after AM_INIT_AUTOMAKE."
164 cat <<EOF >configure.ac
165 AC_INIT([silent-defaults-user-enable-after-am_init], [1.0])
166 AM_INIT_AUTOMAKE
167 AM_SILENT_RULES([yes])
168 AC_CONFIG_FILES([Makefile])
169 AC_OUTPUT
172 $ACLOCAL
173 $AUTOMAKE
174 $AUTOCONF
176 ./configure
177 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
179 ./configure -C --enable-silent-rules
180 grep '^AM_DEFAULT_VERBOSITY = 0' Makefile
182 ./configure -C --disable-silent-rules
183 grep '^AM_DEFAULT_VERBOSITY = 1' Makefile