Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_junit.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_JUNIT
  8. #
  9. # DESCRIPTION
  10. #
  11. # AX_CHECK_JUNIT tests the availability of the Junit testing framework,
  12. # and set some variables for conditional compilation of the test suite by
  13. # automake.
  14. #
  15. # If available, JUNIT is set to a command launching the text based user
  16. # interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT and @TESTS_JUNIT@
  17. # is set to $TESTS_JUNIT, otherwise they are set to empty values.
  18. #
  19. # You can use these variables in your Makefile.am file like this :
  20. #
  21. # # Some of the following classes are built only if junit is available
  22. # JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java
  23. #
  24. # noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@
  25. #
  26. # EXTRA_JAVA = $(JAVA_JUNIT)
  27. #
  28. # TESTS_JUNIT = AllJunitTests
  29. #
  30. # TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@
  31. #
  32. # EXTRA_TESTS = $(TESTS_JUNIT)
  33. #
  34. # AllJunitTests :
  35. # echo "#! /bin/sh" > $@
  36. # echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@
  37. # chmod +x $@
  38. #
  39. # LICENSE
  40. #
  41. # Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
  42. #
  43. # Copying and distribution of this file, with or without modification, are
  44. # permitted in any medium without royalty provided the copyright notice
  45. # and this notice are preserved. This file is offered as-is, without any
  46. # warranty.
  47. #serial 6
  48. AU_ALIAS([AC_CHECK_JUNIT], [AX_CHECK_JUNIT])
  49. AC_DEFUN([AX_CHECK_JUNIT],[
  50. AC_CACHE_VAL(ac_cv_prog_JUNIT,[
  51. AC_CHECK_CLASS(junit.textui.TestRunner)
  52. if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then
  53. ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner'
  54. fi])
  55. AC_MSG_CHECKING([for junit])
  56. if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then
  57. JUNIT="$ac_cv_prog_JUNIT"
  58. JAVA_JUNIT='$(JAVA_JUNIT)'
  59. TESTS_JUNIT='$(TESTS_JUNIT)'
  60. else
  61. JUNIT=
  62. JAVA_JUNIT=
  63. TESTS_JUNIT=
  64. fi
  65. AC_MSG_RESULT($JAVA_JUNIT)
  66. AC_SUBST(JUNIT)
  67. AC_SUBST(JAVA_JUNIT)
  68. AC_SUBST(TESTS_JUNIT)])