doc: typos in test file.
[automake.git] / t / get-sysconf.sh
blob97bdbe7cf6d08fd4a518b1cb204fe3d21e8445d2
1 #! /bin/sh
2 # Copyright (C) 2011-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 # Dummy test case, aimed at reporting useful system information in the
18 # final 'test-suite.log'. This way, if a user experiences a failure in
19 # the Automake test suite and then only sends us the 'test-suite.log',
20 # we won't have to ask him for more information to start analyzing the
21 # failure (that had happened too many times in the past!).
23 . test-init.sh
25 st=0
26 if test -d "$am_top_srcdir"/.git; then
27 # We are running from a git checkout.
28 (cd "$am_top_srcdir" && git --no-pager log -1) || st=1
29 elif test -f "$am_top_srcdir"/ChangeLog; then
30 # We are probably running from a distribution tarball.
31 awk '
32 BEGIN { first = 1 }
33 (first == 1) { print; first = 0; next; }
34 /^[^\t]/ { exit(0); }
35 { print }
36 ' "$am_top_srcdir"/ChangeLog || st=1
37 else
38 # Some non-common but possibly valid setup (see for example the Homebrew
39 # problem reported in automake bug#10866); so just give an harmless
40 # warning instead of failing.
41 warn_ "no .git directory nor ChangeLog file found, some info won't" \
42 "be available"
44 $PERL -V || st=1
45 # It's OK for the user not to have the TAP::Parser module; this can
46 # happen with older perl installation, or on MinGW/MSYS.
47 $PERL -e 'use TAP::Parser; print $TAP::Parser::VERSION, "\n"' || :
49 $AUTOCONF --version
50 $AUTOCONF --help
52 # It's OK if libtool is missing, as the relevant tests skip.
53 libtoolize --version || :
54 libtoolize --help || :
56 # It's OK if the selected Lex and Yacc programs don't know how to print
57 # the version number or the help screen; those are usually available only
58 # for Flex and Bison.
59 $LEX --version </dev/null || :
60 $LEX --help </dev/null || :
61 $YACC --version </dev/null || :
62 $YACC --help </dev/null || :
64 cat "$am_top_builddir/config.log" || st=1
65 cat "$am_top_builddir/bin/aclocal-$APIVERSION" || st=1
66 cat "$am_top_builddir/bin/automake-$APIVERSION" || st=1
68 if test $st -eq 0; then
69 # This test SKIPs, so that all the information it has gathered and
70 # printed will get unconditionally copied into the 'test-suite.log'
71 # file.
72 exit 77
75 # Some unexpected error occurred; this must be reported as an hard
76 # error by the testsuite driver.
77 exit 99