Revision: 116 http://trac.macosforge.org/projects/libdispatch/changeset/116 Author: robert@fledge.watson.org Date: 2009-11-03 16:38:43 -0800 (Tue, 03 Nov 2009) Log Message: ----------- Test for Apple's "leaks" program; only use it in regression tests if present. Modified Paths: -------------- trunk/configure.ac trunk/testing/dispatch_test.c Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-11-03 23:12:32 UTC (rev 115) +++ trunk/configure.ac 2009-11-04 00:38:43 UTC (rev 116) @@ -115,6 +115,11 @@ AC_PROG_LIBTOOL AC_PATH_PROGS(MIG, mig) +AC_CHECK_TARGET_TOOLS(LEAKS, leaks) +AS_IF([test "x$LEAKS" != "x"], + [AC_DEFINE(HAVE_LEAKS, 1, [Define if Apple leaks program is present])] +) + AM_INIT_AUTOMAKE([foreign]) DISPATCH_C_ATOMIC_BUILTINS Modified: trunk/testing/dispatch_test.c =================================================================== --- trunk/testing/dispatch_test.c 2009-11-03 23:12:32 UTC (rev 115) +++ trunk/testing/dispatch_test.c 2009-11-04 00:38:43 UTC (rev 116) @@ -123,14 +123,17 @@ void test_stop_after_delay(void *delay) { +#if HAVE_LEAKS int res; pid_t pid; char pidstr[10]; +#endif if (delay != NULL) { sleep((int)(intptr_t)delay); } +#if HAVE_LEAKS if (getenv("NOLEAKS")) _exit(EXIT_SUCCESS); /* leaks doesn't work against debug variant malloc */ @@ -146,6 +149,6 @@ } else { perror(args[0]); } - +#endif _exit(EXIT_SUCCESS); }
participants (1)
-
source_changes@macosforge.org