2
0

tests-environment-and-log-compiler.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. # parallel-tests: check that we can use variables and functions set
  17. # by TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT in LOG_COMPILER and
  18. # LOG_FLAGS (for tests both with and without registered extensions).
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_OUTPUT
  22. END
  23. unset v0 v1 v2 v3 v4
  24. cat > Makefile.am << 'END'
  25. TESTS_ENVIRONMENT = am__f3 () { echo 3; }; v0='$(srcdir)' v1=1; :;
  26. AM_TESTS_ENVIRONMENT = v2=2; v4=4 && am__f5 () { echo 5; }; :;
  27. LOG_COMPILER = $$v0/log-compiler $$v1
  28. AM_LOG_FLAGS = $$v2 `am__f3`
  29. LOG_FLAGS = $$v4 `am__f5`
  30. TEST_LOG_COMPILER = $$v0/test-log-compiler $$v2
  31. AM_TEST_LOG_FLAGS = `am__f5` $$v1
  32. TEST_LOG_FLAGS = $$v4 `am__f3`
  33. EXTRA_DIST = log-compiler test-log-compiler
  34. TESTS = a b.test
  35. $(TESTS):
  36. END
  37. cat > log-compiler << 'END'
  38. #! /bin/sh
  39. echo "$0: $*"
  40. test x"$1$2$3$4$5" = x"12345"
  41. END
  42. cat > test-log-compiler << 'END'
  43. #! /bin/sh
  44. echo "$0: $*"
  45. test x"$1$2$3$4$5" = x"25143"
  46. END
  47. chmod a+x test-log-compiler log-compiler
  48. $ACLOCAL
  49. $AUTOCONF
  50. $AUTOMAKE -a
  51. ./configure
  52. $MAKE -n check || : # For debugging.
  53. VERBOSE=yes $MAKE check
  54. cat a.log
  55. cat b.log
  56. VERBOSE=yes $MAKE distcheck
  57. :