tests-environment-backcompat.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. # With old serial testsuite driver, TESTS_ENVIRONMENT can be used to
  17. # define the "test runner", i.e. the program that the test scripts must
  18. # be run by (with the parallel test harness one should use LOG_COMPILER
  19. # for this). The behaviour tested here is also documented in the manual.
  20. am_serial_tests=yes
  21. . test-init.sh
  22. cat >> configure.ac <<END
  23. AC_SUBST([PERL], ['$PERL'])
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. TESTS_ENVIRONMENT = $(PERL) -Mstrict -w
  28. TESTS = foo.pl bar.pl baz.pl
  29. XFAIL_TESTS = baz.pl
  30. EXTRA_DIST = $(TESTS)
  31. END
  32. echo 'exit (0);' > foo.pl
  33. echo 'exit (0);' > bar.pl
  34. cat > baz.pl << 'END'
  35. # With "use strict" enacted, this will cause an error, since the
  36. # variable '$x' is not declared with 'my' nor specified with an
  37. # explicit package name.
  38. $x = 0;
  39. exit ($x);
  40. END
  41. chmod a+x *.pl
  42. $ACLOCAL
  43. $AUTOCONF
  44. $AUTOMAKE -a
  45. ./configure
  46. $MAKE check
  47. $MAKE distcheck
  48. :