diff --git a/configure.ac b/configure.ac index 4b64f2e64..1b6531cf4 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,8 @@ LT_INIT([dlopen]) LT_LANG([C++]) LT_LIB_M +AC_SUBST([lt_cv_dlopen_libs]) + AC_PROG_CC_C99 AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])]) @@ -112,7 +114,6 @@ AX_ENABLE_LIBHIREDIS # Checks for programs. AC_CHECK_PROGS([DPKG_GENSYMBOLS],[dpkg-gensymbols]) AC_CHECK_PROGS([OPENSSL],[openssl]) -AC_CHECK_PROGS([PERL],[perl]) AC_CHECK_PROGS([VALGRIND],['valgrind']) AC_CHECK_PROGS([WINE],['wine']) AC_PATH_PROG([GPERF],['gperf'],[]) @@ -225,9 +226,6 @@ AC_CHECK_FUNCS([strstr]) AC_CHECK_FUNC([setsockopt],[],[AC_CHECK_LIB([socket],[setsockopt])]) AC_CHECK_FUNC([bind],[],[AC_CHECK_LIB([bind],[bind])]) -# Check for the ability to call dlopen (used in libhostile) -AX_DLOPEN - # Check for -lrt AC_CHECK_LIB([rt],[clock_gettime], [AX_SAVE_FLAGS diff --git a/gearmand/include.am b/gearmand/include.am index d461af2b5..dff0be9bc 100644 --- a/gearmand/include.am +++ b/gearmand/include.am @@ -41,7 +41,7 @@ gearmand_hostile_gearmand_SOURCES= gearmand_hostile_gearmand_CXXFLAGS+= $(gearmand_gearmand_CXXFLAGS) EXTRA_gearmand_hostile_gearmand_DEPENDENCIES+= $(EXTRA_gearmand_gearmand_DEPENDENCIES) -gearmand_hostile_gearmand_LDADD+= @DL_LIB@ +gearmand_hostile_gearmand_LDADD+= @lt_cv_dlopen_libs@ gearmand_hostile_gearmand_LDADD+= libgearman-server/libgearman-server.la if TARGET_HOSTILE gearmand_hostile_gearmand_LDADD+= libhostile/libhostile.la diff --git a/libgearman-server/include.am b/libgearman-server/include.am index 0e0530a4a..9c7911c7f 100644 --- a/libgearman-server/include.am +++ b/libgearman-server/include.am @@ -92,7 +92,7 @@ libgearman_server_libgearman_server_la_LIBADD+= @LIBEVENT_LIB@ libgearman_server_libgearman_server_la_LIBADD+= @PTHREAD_LIBS@ libgearman_server_libgearman_server_la_LIBADD+= @BOOST_PROGRAM_OPTIONS_LIB@ libgearman_server_libgearman_server_la_LIBADD+= @LIBM@ -libgearman_server_libgearman_server_la_LIBADD+= @DL_LIB@ +libgearman_server_libgearman_server_la_LIBADD+= @lt_cv_dlopen_libs@ libgearman_server_libgearman_server_la_LIBADD+= @RT_LIB@ if ENABLE_SSL if ENABLE_CYASSL diff --git a/libgearman/include.am b/libgearman/include.am index c87972995..91a93f537 100644 --- a/libgearman/include.am +++ b/libgearman/include.am @@ -74,13 +74,13 @@ noinst_HEADERS+= \ noinst_LTLIBRARIES+= libgearman/libgearman-vector.la libgearman_libgearman_vector_la_CXXFLAGS= -DBUILDING_LIBGEARMAN -libgearman_libgearman_vector_la_LIBADD= @DL_LIB@ +libgearman_libgearman_vector_la_LIBADD= @lt_cv_dlopen_libs@ libgearman_libgearman_vector_la_SOURCES= libgearman/vector.cc libgearman_libgearman_vector_la_SOURCES+= libgearman/backtrace.cc noinst_LTLIBRARIES+= libgearman/libgearman-result.la libgearman_libgearman_result_la_CXXFLAGS= -DBUILDING_LIBGEARMAN -libgearman_libgearman_result_la_LIBADD= @DL_LIB@ +libgearman_libgearman_result_la_LIBADD= @lt_cv_dlopen_libs@ libgearman_libgearman_result_la_SOURCES= libgearman/vector.cc libgearman_libgearman_result_la_SOURCES+= libgearman/result.cc libgearman_libgearman_result_la_SOURCES+= libgearman/backtrace.cc @@ -152,7 +152,7 @@ libgearman_libgearman_la_LDFLAGS+= @OPENSSL_LDFLAGS@ endif endif endif -libgearman_libgearman_la_LIBADD+= @DL_LIB@ +libgearman_libgearman_la_LIBADD+= @lt_cv_dlopen_libs@ libgearman_libgearman_la_LIBADD+= @LIBUUID_LIB@ libgearman_libgearman_la_LIBADD+= libhashkit/libhashkit.la diff --git a/libgearmancore/include.am b/libgearmancore/include.am index 59713211d..cd48d7aea 100644 --- a/libgearmancore/include.am +++ b/libgearmancore/include.am @@ -35,6 +35,6 @@ libgearman_libgearmancore_la_SOURCES+= libgearman/vector.cc libgearman_libgearmancore_la_CXXFLAGS= -DBUILDING_LIBGEARMAN libgearman_libgearmancore_la_LIBADD= -libgearman_libgearmancore_la_LIBADD+= @DL_LIB@ +libgearman_libgearmancore_la_LIBADD+= @lt_cv_dlopen_libs@ libgearman_libgearmancore_la_LIBADD+= @LIBUUID_LIB@ libgearman_libgearmancore_la_LIBADD+= libhashkit/libhashkit.la diff --git a/libhostile/include.am b/libhostile/include.am index ea5d03247..7959e84bc 100644 --- a/libhostile/include.am +++ b/libhostile/include.am @@ -50,7 +50,7 @@ libhostile_libhostile_la_CXXFLAGS+= @PTHREAD_CFLAGS@ libhostile_libhostile_la_SOURCES+= libhostile/initialize.c if TARGET_HOSTILE -libhostile_libhostile_la_LIBADD+= @DL_LIB@ +libhostile_libhostile_la_LIBADD+= @lt_cv_dlopen_libs@ libhostile_libhostile_la_LIBADD+= @RT_LIB@ libhostile_libhostile_la_LIBADD+= @PTHREAD_LIBS@ diff --git a/libtest/formatter.cc b/libtest/formatter.cc index 18e3f2730..7f70566df 100644 --- a/libtest/formatter.cc +++ b/libtest/formatter.cc @@ -41,6 +41,60 @@ #include #include #include + +namespace { + + std::string& escape4XML(std::string const& arg, std::string& escaped_string) + { + escaped_string.clear(); + + escaped_string+= '"'; + for (std::string::const_iterator x= arg.begin(), end= arg.end(); x != end; ++x) + { + unsigned char c= *x; + if (c == '&') + { + escaped_string+= "&"; + } + else if (c == '>') + { + escaped_string+= ">"; + } + else if (c == '<') + { + escaped_string+= "<"; + } + else if (c == '\'') + { + escaped_string+= "'"; break; + } + else if (c == '"') + { + escaped_string+= """; + } + else if (c == ' ') + { + escaped_string+= ' '; + } + else if (isalnum(c)) + { + escaped_string+= c; + } + else + { + char const* const hexdig= "0123456789ABCDEF"; + escaped_string+= "&#x"; + escaped_string+= hexdig[c >> 4]; + escaped_string+= hexdig[c & 0xF]; + escaped_string+= ';'; + } + } + escaped_string+= '"'; + + return escaped_string; + } + +} namespace libtest { @@ -111,7 +165,8 @@ void Legacy::report(const libtest::TestCase* test, size_t) const Junit::Junit(const Framework* frame_, std::ostream& output_): Formatter(frame_, output_) { - _output << "" << std::endl; + std::string escaped_string; + _output << "" << std::endl; } Junit::~Junit() @@ -121,9 +176,11 @@ Junit::~Junit() void Junit::report(const libtest::TestCase* test, size_t) const { - _output << "\t\tname() - << "\" time=\"" + std::string escaped_string; + + _output << "\t\ttimer() << "\">" << std::endl; @@ -146,7 +203,14 @@ void Junit::report(const libtest::TestCase* test, size_t) const void Junit::plan(const Collection* collection) { - _output << "\tname() << "\" classname=\"\" package=\"\">" << std::endl; + std::string escaped_string; + + _output << "\t" << std::endl; +#if 0 + << "\" classname=\"\" package=\"\">" << std::endl; +#endif } void Junit::complete() diff --git a/libtest/include.am b/libtest/include.am index 3acf536db..85f44f4c6 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -259,7 +259,7 @@ libtest_backtrace_SOURCES= libtest_backtrace_LDADD= libtest_backtrace_SOURCES+= libtest/backtrace_test.cc libtest_backtrace_SOURCES+= libgearman/backtrace.cc -libtest_backtrace_LDADD+= @DL_LIB@ +libtest_backtrace_LDADD+= @lt_cv_dlopen_libs@ noinst_PROGRAMS+= libtest/backtrace test-backtrace: libtest/backtrace @libtest/backtrace diff --git a/m4/ax_dlopen.m4 b/m4/ax_dlopen.m4 deleted file mode 100644 index 514c578a1..000000000 --- a/m4/ax_dlopen.m4 +++ /dev/null @@ -1,10 +0,0 @@ -#serial 2 - -AC_DEFUN([AX_DLOPEN], - [AS_IF([test "x$enable_shared" = xyes], - [AX_CHECK_LIBRARY([DL],[dlfcn.h],[dl], - [AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen]) - AC_CHECK_LIB([dl],[dlopen],[AC_DEFINE([HAVE_DLOPEN],[1],[Have dlopen])]) - AC_CHECK_LIB([dl],[dladdr],[AC_DEFINE([HAVE_DLADDR],[1],[Have dladdr])])])]) - ]) - diff --git a/tests/hostile.am b/tests/hostile.am index 12984b36b..661816fca 100644 --- a/tests/hostile.am +++ b/tests/hostile.am @@ -19,7 +19,7 @@ t_hostile_gearmand_CXXFLAGS+= -DHAVE_LIBHOSTILE=1 t_hostile_gearmand_CFLAGS+= -DHAVE_LIBHOSTILE=1 t_hostile_gearmand_LDADD+= libhostile/libhostile.la if HOST_LINUX -t_hostile_gearmand_LDADD+= @DL_LIB@ +t_hostile_gearmand_LDADD+= @lt_cv_dlopen_libs@ t_hostile_gearmand_LDADD+= @RT_LIB@ endif @@ -50,7 +50,7 @@ t_hostile_libgearman_CXXFLAGS+= -DSERVER_TARGET="\"gearmand\"" t_hostile_libgearman_CFLAGS+= -DSERVER_TARGET="\"gearmand\"" t_hostile_libgearman_LDADD+= libhostile/libhostile.la if HOST_LINUX -t_hostile_libgearman_LDADD+= @DL_LIB@ +t_hostile_libgearman_LDADD+= @lt_cv_dlopen_libs@ t_hostile_libgearman_LDADD+= @RT_LIB@ endif