2 # Copyright (C) 2011-2013 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 # Auxiliary shell script that copies the common data and files used by
18 # many tests on TAP support into the current directory. It should be
19 # sourced by client test scripts, and assumes the auxiliary test
20 # 'tap-common-setup.test' has been run beforehand (it will error out
21 # if this is not the case).
23 # Check that we are running from a proper directory: last thing we want
24 # is to overwrite some random user files.
25 test -f ../../bin/automake && test -f ../../runtest && test -d ../../t \
26 || fatal_ "running from a wrong directory"
28 test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
29 || fatal_ "failed to save Makefile.am"
31 test -d ../tap-common-setup.dir && cp -fpR ../tap-common-setup.dir/* . \
32 || fatal_ "couldn't get precomputed data files"
36 if test -f Makefile.am~; then
37 mv -f Makefile.am~ Makefile.am \
38 || fatal_ "failed to restore Makefile.am"
39 echo 'TEST_LOG_DRIVER = $(srcdir)/tap-driver' >> Makefile.am \
40 || fatal_ "failed to update Makefile.am"
42 || fatal_ "failed to remake Makefile.in"
43 ./config.status Makefile \
44 || fatal_ "failed to remake Makefile"