tap-more2.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. # More on TAP support:
  17. # - more LOG_COMPILER at once for TAP tests
  18. # - binary programs in $(TESTS)
  19. # - interactions with 'check_*' variables
  20. required='cc native'
  21. . test-init.sh
  22. fetch_tap_driver
  23. cat >> configure.ac <<END
  24. AC_PROG_CC
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am << 'END'
  28. TEST_EXTENSIONS = .sh .tap
  29. tap_driver = $(srcdir)/tap-driver
  30. LOG_DRIVER = $(tap_driver)
  31. SH_LOG_DRIVER = $(tap_driver)
  32. TAP_LOG_DRIVER = $(tap_driver)
  33. TAP_LOG_COMPILER = cat
  34. SH_LOG_COMPILER = $(SHELL)
  35. LOG_COMPILER =
  36. EXTRA_DIST = baz.tap
  37. check_SCRIPTS = bar.sh
  38. bar.sh: Makefile
  39. echo '#!/bin/sh' > $@-t
  40. echo 'echo 1..1' >> $@-t
  41. echo 'echo "not ok 1 # TODO"' >> $@-t
  42. chmod a-w $@-t && mv -f $@-t $@
  43. CLEANFILES = bar.sh
  44. check_PROGRAMS = foo-test
  45. foo_test_SOURCES = foo.c
  46. TESTS = foo-test $(check_SCRIPTS) baz.tap
  47. EXTRA_DIST += tap-driver
  48. END
  49. cat > foo.c <<'END'
  50. #include <stdio.h>
  51. int main (void)
  52. {
  53. printf ("1..1\n");
  54. printf ("ok 1\n");
  55. return 0;
  56. }
  57. END
  58. cat > baz.tap << 'END'
  59. 1..1
  60. ok 1 # SKIP
  61. END
  62. $ACLOCAL
  63. $AUTOCONF
  64. $AUTOMAKE
  65. ./configure
  66. for target in check distcheck; do
  67. run_make -O $target
  68. count_test_results total=3 pass=1 fail=0 xpass=0 xfail=1 skip=1 error=0
  69. done
  70. :