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.

51 lines
1.8KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_find_junit.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_FIND_JUNIT
  8. #
  9. # DESCRIPTION
  10. #
  11. # AX_FIND_JUNIT will look for the JUnit java library. When found its path
  12. # will be put in JUNIT_CPF as a classpath fragment.
  13. #
  14. # To override the location define JUNIT_JAR to the wanted path.
  15. #
  16. # LICENSE
  17. #
  18. # Copyright (c) 2013 Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
  19. #
  20. # Copying and distribution of this file, with or without modification, are
  21. # permitted in any medium without royalty provided the copyright notice
  22. # and this notice are preserved. This file is offered as-is, without any
  23. # warranty.
  24. #serial 3
  25. AC_ARG_VAR(JUNIT_JAR, [the location of JUnit 4])
  26. AC_DEFUN([AX_FIND_JUNIT], [
  27. AC_CACHE_VAL(ax_cv_junit_cpf, [
  28. AS_IF([test x"$JUNIT_JAR" != x],
  29. [ax_cv_junit_cpf="$JUNIT_JAR$PATH_SEPARATOR"], [
  30. AX_XTRA_CLASSPATH(ax_cv_junit_cpf, org.junit.Assert,
  31. [junit4-4.11.jar junit4.jar junit.jar])
  32. # junit.jar may not have org.hamcrest.Matcher
  33. classpath_when_starting_ax_find_junit="$CLASSPATH"
  34. CLASSPATH="$ax_cv_junit_cpf$classpath_when_starting_ax_find_junit"
  35. AC_CHECK_CLASS(org.hamcrest.Matcher,
  36. built_in_hamcrest=yes, built_in_hamcrest=no)
  37. CLASSPATH="$classpath_when_starting_ax_find_junit"
  38. AS_IF([test x"$built_in_hamcrest" = xno], [
  39. AX_FIND_HAMCREST
  40. ax_cv_junit_cpf="$HAMCREST_CPF$ax_cv_junit_cpf"])])])
  41. AS_IF([test x"$ax_cv_junit_cpf" != x], [
  42. AC_MSG_NOTICE([JUnit 4 found $ax_cv_junit_cpf])
  43. AC_SUBST(JUNIT_CPF, $ax_cv_junit_cpf)],
  44. AC_MSG_WARN([JUnit 4 not found]))])