tap-numeric-description.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. # TAP result lines whose description is a number.
  17. . test-init.sh
  18. . tap-setup.sh
  19. # Some random numbers to be used as test names. The definitions below are
  20. # selected so that $x<n> != <n> for every n >= 1. We can't use positional
  21. # parameters for this unfortunately, since Solaris 10 /bin/sh doesn't allow
  22. # the dereferencing of parameters from ${10} onwards.
  23. x1=5 x2=7 x3=45 x4=11 x5=7 x6=3 x7=6 x8=9 x9=1000 x10=1
  24. cat > all.test <<END
  25. 1..10
  26. ok 1 ${x1}
  27. ok - ${x2}
  28. not ok 3 ${x3}
  29. not ok - ${x4}
  30. ok 5 ${x5} # SKIP
  31. ok - ${x6} # SKIP
  32. not ok 7 ${x7} # TODO
  33. not ok - ${x8} # TODO
  34. ok 9 ${x9} # TODO
  35. ok - ${x10} # TODO
  36. END
  37. cat > exp <<END
  38. PASS: all.test 1 ${x1}
  39. PASS: all.test 2 - ${x2}
  40. FAIL: all.test 3 ${x3}
  41. FAIL: all.test 4 - ${x4}
  42. SKIP: all.test 5 ${x5} # SKIP
  43. SKIP: all.test 6 - ${x6} # SKIP
  44. XFAIL: all.test 7 ${x7} # TODO
  45. XFAIL: all.test 8 - ${x8} # TODO
  46. XPASS: all.test 9 ${x9} # TODO
  47. XPASS: all.test 10 - ${x10} # TODO
  48. END
  49. run_make -O -e FAIL check
  50. count_test_results total=10 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=0
  51. $FGREP ': all.test' stdout > got
  52. cat exp
  53. cat got
  54. diff exp got
  55. :