check10.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #! /bin/sh
  2. # Copyright (C) 2008-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 singular and plural in test summaries.
  17. # This test only makes sense for the older serial testsuite driver.
  18. am_serial_tests=yes
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am << 'END'
  24. TESTS = fail pass skip xfail xpass fail2 pass2 skip2 xfail2 xpass2
  25. XFAIL_TESTS = xfail xpass xfail2 xpass2
  26. END
  27. cat > pass <<'END'
  28. #! /bin/sh
  29. exit 0
  30. END
  31. cat > fail <<'END'
  32. #! /bin/sh
  33. exit 1
  34. END
  35. cat > skip <<'END'
  36. #! /bin/sh
  37. exit 77
  38. END
  39. chmod a+x pass fail skip
  40. cp pass pass2
  41. cp pass xpass
  42. cp xpass xpass2
  43. cp fail xfail
  44. cp fail fail2
  45. cp xfail xfail2
  46. cp skip skip2
  47. $ACLOCAL
  48. $AUTOCONF
  49. $AUTOMAKE -a
  50. ./configure
  51. (
  52. run_make -e IGNORE TESTS=pass check
  53. run_make -e IGNORE TESTS=fail check
  54. run_make -e IGNORE TESTS=skip check
  55. run_make -e IGNORE TESTS=xfail check
  56. run_make -e IGNORE TESTS=xpass check
  57. run_make -e IGNORE TESTS="pass pass2" check
  58. run_make -e IGNORE TESTS="fail fail2" check
  59. run_make -e IGNORE TESTS="skip skip2" check
  60. run_make -e IGNORE TESTS="xfail xfail2" check
  61. run_make -e IGNORE TESTS="xpass xpass2" check
  62. run_make -e IGNORE TESTS='pass skip xfail' check
  63. run_make -e IGNORE check
  64. ) >stdout || { cat stdout; exit 1; }
  65. cat stdout
  66. grep '1 [tT]ests' stdout && exit 1
  67. grep '[02-9] [tT]est ' stdout && exit 1
  68. grep '1 .* were ' stdout && exit 1
  69. grep '[02-9].* was .*run' stdout && exit 1
  70. grep 'All 1 ' stdout && exit 1
  71. $EGREP '1 (un)?expected (failures|passes)' stdout && exit 1
  72. $EGREP '[^1] (un)?expected (failure|pass)\)' stdout && exit 1
  73. :