testsuite-summary-reference-log.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # Check that the global testsuite log file referenced in the testsuite
  17. # summary and in the global testsuite log itself is correct.
  18. . test-init.sh
  19. mv configure.ac configure.stub
  20. cat > fail << 'END'
  21. #!/bin/sh
  22. exit 1
  23. END
  24. chmod a+x fail
  25. cat configure.stub - > configure.ac <<'END'
  26. AC_OUTPUT
  27. END
  28. cat > Makefile.am << 'END'
  29. TEST_SUITE_LOG = my_test_suite.log
  30. TESTS = fail
  31. END
  32. $ACLOCAL
  33. $AUTOCONF
  34. $AUTOMAKE -a
  35. mkdir build
  36. cd build
  37. ../configure
  38. run_make -O -e FAIL check
  39. grep '^See \./my_test_suite\.log$' stdout
  40. mkdir bar
  41. run_make -O -e FAIL TEST_SUITE_LOG=bar/bar.log check
  42. grep '^See \./bar/bar\.log$' stdout
  43. cd ..
  44. echo SUBDIRS = sub > Makefile.am
  45. mkdir sub
  46. echo TESTS = fail > sub/Makefile.am
  47. mv fail sub
  48. cat configure.stub - > configure.ac <<'END'
  49. AC_CONFIG_FILES([sub/Makefile])
  50. AC_OUTPUT
  51. END
  52. $ACLOCAL --force
  53. $AUTOCONF --force
  54. $AUTOMAKE
  55. ./configure
  56. run_make -O -e FAIL check
  57. grep '^See sub/test-suite\.log$' stdout
  58. cd sub
  59. run_make -O -e FAIL check
  60. grep '^See sub/test-suite\.log$' stdout
  61. cd ..
  62. run_make -O -e FAIL TEST_SUITE_LOG=foo.log check
  63. grep '^See sub/foo\.log$' stdout
  64. :