parallel-tests-log-override-2.sh 1.9 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 parallel-tests features: runtime redefinition of:
  17. # - $(TEST_SUITE_LOG) and $(TESTS)
  18. # - $(TEST_SUITE_LOG) and $(TEST_LOGS)
  19. . test-init.sh
  20. cat >> configure.ac <<'END'
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am <<'END'
  24. TESTS = pass.test pass2.test skip.test skip2.test fail.test
  25. END
  26. cat > pass.test <<'END'
  27. #! /bin/sh
  28. exit 0
  29. END
  30. cp pass.test pass2.test
  31. cat > skip.test <<'END'
  32. #! /bin/sh
  33. echo "% skipped test %"
  34. exit 77
  35. END
  36. cp skip.test skip2.test
  37. cat > fail.test <<'END'
  38. #! /bin/sh
  39. exit 1
  40. END
  41. chmod a+x *.test
  42. $ACLOCAL
  43. $AUTOCONF
  44. $AUTOMAKE -a
  45. ./configure
  46. for test_list_override in \
  47. 'TESTS=pass.test skip.test' \
  48. 'TEST_LOGS=pass.log skip.log'
  49. do
  50. run_make -O TEST_SUITE_LOG=partial.log "$test_list_override" check
  51. ls -l
  52. count_test_results total=2 pass=1 fail=0 skip=1 xfail=0 xpass=0 error=0
  53. cat pass.log
  54. cat skip.log
  55. cat partial.log
  56. test ! -e test-suite.log
  57. test ! -e pass2.log
  58. test ! -e skip2.log
  59. test ! -e fail.log
  60. grep '^PASS: pass\.test$' stdout
  61. grep '^SKIP: skip\.test$' stdout
  62. $FGREP 'SKIP: skip' partial.log
  63. $FGREP '% skipped test %' partial.log
  64. $EGREP '(pass2|skip2|fail)\.test' stdout && exit 1
  65. $EGREP '(pass2|skip2|fail)' partial.log && exit 1
  66. rm -f *.log
  67. done
  68. :