check-html.am 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ## automake - create Makefile.in from Makefile.am
  2. ## Copyright (C) 2001-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. ## Makefile.am fragment to produce HTML output from RST-formatted
  17. ## log files produced by the parallel-tests output.
  18. ## This fragment was part of the automake core in the 1.11.x release
  19. ## series, but has been then moved to contrib.
  20. TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
  21. mostlyclean-local: mostlyclean-check-html
  22. .PHONY: mostlyclean-check-html
  23. mostlyclean-check-html:
  24. ## Expand $(TEST_LOGS) only once, to avoid exceeding line length limits.
  25. list='$(TEST_LOGS:.log=.html)'; test -z "$$list" || rm -f $$list
  26. rm -f $(TEST_SUITE_HTML)
  27. .log.html:
  28. @list='$(RST2HTML) rst2html rst2html.py'; \
  29. while :; do \
  30. for r2h in $$list; do \
  31. if ($$r2h --version) >/dev/null 2>&1; then break 2; \
  32. else :; fi; \
  33. done; \
  34. echo "cannot find rst2html, cannot create $@" >&2; \
  35. exit 2; \
  36. done; \
  37. $$r2h $(AM_RST2HTMLFLAGS) $(RST2HTMLFLAGS) $< >$@-t \
  38. && mv -f $@-t $@
  39. # Be sure to run check first, and then to convert the result.
  40. # Beware of concurrent executions. Run "check" not "check-TESTS", as
  41. # check-SCRIPTS and other dependencies are rebuilt by the former only.
  42. # And expect check to fail.
  43. check-html recheck-html:
  44. @target=`echo $@ | sed 's/-html$$//'`; \
  45. rv=0; $(MAKE) $(AM_MAKEFLAGS) $$target || rv=$$?; \
  46. ## The nullification of $(TEST_LOGS) is required to ensure that
  47. ## "make recheck-html" do not try to uselessly re-run tests.
  48. $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \
  49. exit $$rv
  50. .PHONY: check-html recheck-html
  51. .MAKE: check-html recheck-html