Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / get-sysconf.test
1 #! /bin/sh
2 # Copyright (C) 2011 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 # 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!).
22
23 . ./defs || Exit 1
24
25 set -e
26
27 # FIXME: remove these once we are merged into master.
28 top_testsrcdir=$testsrcdir/..
29 testbuilddir=`(cd .. && pwd)`
30 top_testbuilddir=`(cd $testbuilddir/.. && pwd)`
31
32 st=0
33 if test -d "$top_testsrcdir"/.git; then
34   # We are running from a git checkout.
35   git log -1 || st=1
36 else
37   # We are probably running from a distribution tarball, so
38   # the ChangeLog file must be present.
39   awk '
40     BEGIN { first = 1 }
41     (first == 1) { print; first = 0; next; }
42     /^[^\t]/ { exit(0); }
43     { print }
44   ' "$top_testsrcdir"/ChangeLog || st=1
45 fi
46 $PERL -V || st=1
47 cat "$top_testbuilddir/config.log" || st=1
48 cat "$testbuilddir/aclocal-$APIVERSION" || st=1
49 cat "$testbuilddir/automake-$APIVERSION" || st=1
50
51 if test $st -eq 0; then
52   # This test SKIPs, so that all the information it has gathered and
53   # printed will get unconditionally copied into the `test-suite.log'
54   # file.
55   Exit 77
56 fi
57
58 # Some unexpected error occurred; this must be reported as an hard
59 # error by the testsuite driver.
60 Exit 99