2
0

tap-setup.sh 1.8 KB

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