<div dir="ltr">Merged, thanks!<div><br></div><div>As discussed with Jonathan and Michael, we'll add a default "auto-detect" mode to enable those as available on the system if neither enable-test-* or disable-test-* are provided.</div><div><br></div><div>Jérémie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 12:39 PM, Michael Jeanson <span dir="ltr"><<a href="mailto:mjeanson@efficios.com" target="_blank">mjeanson@efficios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch adds the switches --enable-test-java-agent-(jul|log4j|all) to<br>
the configure script, the tests now need to be explicitly enabled and<br>
their dependencies are only checked if so.<br>
<br>
Signed-off-by: Michael Jeanson <<a href="mailto:mjeanson@efficios.com">mjeanson@efficios.com</a>><br>
---<br>
<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 94 ++++++++++++++++++++---------<br>
tests/regression/ust/java-jul/Makefile.am | 4 +-<br>
tests/regression/ust/java-log4j/Makefile.am | 4 +-<br>
3 files changed, 69 insertions(+), 33 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index bfef178..4e6c06e 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -131,6 +131,25 @@ AC_ARG_WITH([lttng-system-rundir],<br>
[LTTNG_SYSTEM_RUNDIR="/var/run/lttng"])<br>
AC_SUBST([LTTNG_SYSTEM_RUNDIR])<br>
<br>
+AC_ARG_ENABLE([test-java-agent-jul],<br>
+ [AS_HELP_STRING([--enable-test-java-agent-jul],[enable the LTTng UST Java agent JUL tests [default=no]])],<br>
+ [test_java_agent_jul=$enableval],<br>
+ [test_java_agent_jul=no]<br>
+)<br>
+<br>
+AC_ARG_ENABLE([test-java-agent-log4j],<br>
+ [AS_HELP_STRING([--enable-test-java-agent-log4j],[enable the LTTng UST Java agent Log4j tests [default=no]])],<br>
+ [test_java_agent_log4j=$enableval],<br>
+ [test_java_agent_log4j=no]<br>
+)<br>
+<br>
+AC_ARG_ENABLE([test-java-agent-all],<br>
+ [AS_HELP_STRING([--enable-test-java-agent-all],[enable all the LTTng UST Java agent tests [default=no]])],<br>
+ [test_java_agent_jul=$enableval<br>
+ test_java_agent_log4j=$enableval],<br>
+ [:]<br>
+)<br>
+<br>
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])<br>
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])<br>
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])<br>
@@ -355,44 +374,45 @@ AX_CONFIG_FEATURE(<br>
)<br>
AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])<br>
<br>
-AX_JAVA_OPTIONS<br>
-AX_PROG_JAVAC<br>
-AX_PROG_JAVA<br>
-AX_PROG_JAR<br>
+AM_CONDITIONAL([TEST_JAVA_JUL_AGENT], [test "x$test_java_agent_jul" = "xyes"])<br>
+AM_CONDITIONAL([TEST_JAVA_LOG4J_AGENT], [test "x$test_java_agent_log4j" = "xyes"])<br>
<br>
-AX_CHECK_CLASSPATH<br>
+if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xyes"; then<br>
+ AX_JAVA_OPTIONS<br>
+ AX_PROG_JAVAC<br>
+ AX_PROG_JAVA<br>
+ AX_PROG_JAR<br>
<br>
-# Check for Java UST agent common class first<br>
-AX_CHECK_CLASS(org.lttng.ust.agent.AbstractLttngAgent)<br>
-if test "x$ac_cv_class_org_lttng_ust_agent_AbstractLttngAgent" = "xyes"; then<br>
- java_agent_common=yes<br>
-else<br>
- java_agent_common=no<br>
-fi<br>
-<br>
-# If the common class is available, test for each agent<br>
-if test "x$java_agent_common" = "xyes"; then<br>
- # Check for JUL<br>
- AX_CHECK_CLASS(org.lttng.ust.agent.jul.LttngLogHandler)<br>
- AX_CHECK_CLASS(org.lttng.ust.agent.log4j.LttngLogAppender)<br>
- AX_CHECK_CLASS(org.apache.log4j.Logger)<br>
+ AX_CHECK_CLASSPATH<br>
<br>
- build_java_jul_agent=no<br>
- if test "x$ac_cv_class_org_lttng_ust_agent_jul_LttngLogHandler" = "xyes"; then<br>
- build_java_jul_agent=yes<br>
+ # Check for Java UST agent common class first<br>
+ AX_CHECK_CLASS(org.lttng.ust.agent.AbstractLttngAgent)<br>
+ if test "x$ac_cv_class_org_lttng_ust_agent_AbstractLttngAgent" = "xno"; then<br>
+ AC_MSG_ERROR([The UST Java agent common class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-common.jar"])<br>
fi<br>
<br>
- build_java_log4j_agent=no<br>
- if test "x$ac_cv_class_org_lttng_ust_agent_log4j_LttngLogAppender" = "xyes"; then<br>
- if test "x$ac_cv_class_org_apache_log4j_Logger" = "xyes"; then<br>
- build_java_log4j_agent=yes<br>
+ if test "x$test_java_agent_jul" = "xyes"; then<br>
+ # Check for JUL agent class<br>
+ AX_CHECK_CLASS(org.lttng.ust.agent.jul.LttngLogHandler)<br>
+ if test "x$ac_cv_class_org_lttng_ust_agent_jul_LttngLogHandler" = "xno"; then<br>
+ AC_MSG_ERROR([The UST Java agent JUL class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-jul.jar"])<br>
fi<br>
fi<br>
<br>
-fi<br>
+ if test "x$test_java_agent_log4j" = "xyes"; then<br>
+ # Check for Log4j agent class<br>
+ AX_CHECK_CLASS(org.lttng.ust.agent.log4j.LttngLogAppender)<br>
+ if test "x$ac_cv_class_org_lttng_ust_agent_log4j_LttngLogAppender" = "xno"; then<br>
+ AC_MSG_ERROR([The UST Java agent Log4j class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-log4j.jar"])<br>
+ fi<br>
<br>
-AM_CONDITIONAL([BUILD_JAVA_JUL_AGENT], [test "x$build_java_jul_agent" = "xyes"])<br>
-AM_CONDITIONAL([BUILD_JAVA_LOG4J_AGENT], [test "x$build_java_log4j_agent" = "xyes"])<br>
+ # Check for Log4j class<br>
+ AX_CHECK_CLASS(org.apache.log4j.Logger)<br>
+ if test "x$ac_cv_class_org_apache_log4j_Logger" = "xno"; then<br>
+ AC_MSG_ERROR([The Log4j class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/log4j.jar"])<br>
+ fi<br>
+ fi<br>
+fi<br>
<br>
AC_SYS_LARGEFILE<br>
<br>
@@ -570,6 +590,22 @@ AS_IF([test "x$lttng_ust_support" = "xyes"],[<br>
AS_ECHO("Disabled")<br>
])<br>
<br>
+# LTTng UST Java agent JUL tests enabled/disabled<br>
+AS_ECHO_N("LTTng-UST Java agent JUL tests: ")<br>
+AS_IF([test "x$test_java_agent_jul" = "xyes"],[<br>
+ AS_ECHO("Enabled")<br>
+],[<br>
+ AS_ECHO("Disabled")<br>
+])<br>
+<br>
+# LTTng UST Java agent Log4j tests enabled/disabled<br>
+AS_ECHO_N("LTTng-UST Java agent Log4j tests: ")<br>
+AS_IF([test "x$test_java_agent_log4j" = "xyes"],[<br>
+ AS_ECHO("Enabled")<br>
+],[<br>
+ AS_ECHO("Disabled")<br>
+])<br>
+<br>
#Python binding enabled/disabled<br>
AS_ECHO_N("Python binding: ")<br>
AS_IF([test "x${enable_python:-yes}" = xyes], [<br>
diff --git a/tests/regression/ust/java-jul/Makefile.am b/tests/regression/ust/java-jul/Makefile.am<br>
index 877237f..b0a04f3 100644<br>
--- a/tests/regression/ust/java-jul/Makefile.am<br>
+++ b/tests/regression/ust/java-jul/Makefile.am<br>
@@ -3,9 +3,9 @@ JAVAROOT = .<br>
noinst_SCRIPTS = test_java_jul JTestLTTng.java<br>
EXTRA_DIST = test_java_jul JTestLTTng.java<br>
<br>
-if BUILD_JAVA_JUL_AGENT<br>
+if TEST_JAVA_JUL_AGENT<br>
dist_noinst_JAVA = JTestLTTng.java<br>
-endif # BUILD_JAVA_JUL_AGENT<br>
+endif # TEST_JAVA_JUL_AGENT<br>
<br>
all-local: static_file<br>
<br>
diff --git a/tests/regression/ust/java-log4j/Makefile.am b/tests/regression/ust/java-log4j/Makefile.am<br>
index 42daab8..60d5c37 100644<br>
--- a/tests/regression/ust/java-log4j/Makefile.am<br>
+++ b/tests/regression/ust/java-log4j/Makefile.am<br>
@@ -3,9 +3,9 @@ JAVAROOT = .<br>
noinst_SCRIPTS = test_java_log4j JTestLTTng.java<br>
EXTRA_DIST = test_java_log4j JTestLTTng.java<br>
<br>
-if BUILD_JAVA_LOG4J_AGENT<br>
+if TEST_JAVA_LOG4J_AGENT<br>
dist_noinst_JAVA = JTestLTTng.java<br>
-endif # BUILD_JAVA_LOG4J_AGENT<br>
+endif # TEST_JAVA_LOG4J_AGENT<br>
<br>
all-local: static_file<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.9.1<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jérémie Galarneau<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div>
</div>