From 6426f05fea3a3e289483b3eeb4bcffab1cc5c5ca Mon Sep 17 00:00:00 2001 From: trawick Date: Sun, 12 Aug 2012 23:05:58 +0000 Subject: Merge r1089129 from trunk: MinGW: Resolve paths to test DSOs and executables within the test suite. PR: 51021 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1372210 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_hints.m4 | 1 + test/testproc.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/apr_hints.m4 b/build/apr_hints.m4 index 5999a81dc..29f37712f 100644 --- a/build/apr_hints.m4 +++ b/build/apr_hints.m4 @@ -442,6 +442,7 @@ dnl # Not a problem in 10.20. Otherwise, who knows? APR_ADDTO(CPPFLAGS, [-DCYGWIN]) ;; *mingw*) + APR_ADDTO(INTERNAL_CPPFLAGS, -DBINPATH=$apr_builddir/test/.libs) APR_ADDTO(CPPFLAGS, [-DWIN32 -D__MSVCRT__]) APR_ADDTO(LDFLAGS, [-Wl,--enable-auto-import,--subsystem,console]) APR_SETIFNULL(have_unicode_fs, [1]) diff --git a/test/testproc.c b/test/testproc.c index c983f2594..096ecfdfc 100644 --- a/test/testproc.c +++ b/test/testproc.c @@ -23,6 +23,10 @@ #define TESTSTR "This is a test" +#define PROC_CHILD_NAME TESTBINPATH "proc_child" EXTENSION + +static char *proc_child; + static apr_proc_t newproc; static void test_create_proc(abts_case *tc, void *data) @@ -50,7 +54,7 @@ static void test_create_proc(abts_case *tc, void *data) args[0] = "proc_child" EXTENSION; args[1] = NULL; - rv = apr_proc_create(&newproc, "../" TESTBINPATH "proc_child" EXTENSION, args, NULL, + rv = apr_proc_create(&newproc, proc_child, args, NULL, attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -126,7 +130,7 @@ static void test_file_redir(abts_case *tc, void *data) args[0] = "proc_child"; args[1] = NULL; - rv = apr_proc_create(&newproc, "../" TESTBINPATH "proc_child" EXTENSION, args, NULL, + rv = apr_proc_create(&newproc, proc_child, args, NULL, attr, p); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); @@ -160,6 +164,7 @@ abts_suite *testproc(abts_suite *suite) { suite = ADD_SUITE(suite) + apr_filepath_merge(&proc_child, NULL, PROC_CHILD_NAME, 0, p); abts_run_test(suite, test_create_proc, NULL); abts_run_test(suite, test_proc_wait, NULL); abts_run_test(suite, test_file_redir, NULL); -- cgit v1.2.1