Set LD_LIBRARY_PATH when running tests

Needed on ELF systems.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/f084e276
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/f084e276
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/f084e276

Branch: refs/heads/master
Commit: f084e276ae79b4afa340c626bfa9ec6236f6aa01
Parents: 6184ab5
Author: Nick Wellnhofer <[email protected]>
Authored: Thu Mar 14 14:41:47 2013 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Thu Mar 14 14:41:47 2013 +0100

----------------------------------------------------------------------
 common/charmonizer.main |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/f084e276/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index f62c23d..c369a65 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -308,7 +308,11 @@ S_write_makefile() {
     chaz_MakeRule_add_prereq(rule, "$(LUCY_SHOBJ)");
 
     rule = chaz_MakeFile_add_rule(makefile, "test", "$(TEST_LUCY_EXE)");
-    chaz_MakeRule_add_command(rule, "$(TEST_LUCY_EXE)");
+    const char *test_command = "$(TEST_LUCY_EXE)";
+    if (strcmp(chaz_OS_shared_obj_ext(), ".so") == 0) {
+        test_command = "LD_LIBRARY_PATH=. $(TEST_LUCY_EXE)";
+    }
+    chaz_MakeRule_add_command(rule, test_command);
 
     chaz_MakeFile_add_to_cleanup(makefile, "$(TEST_LUCY_OBJS)");
     chaz_MakeFile_add_to_cleanup(makefile, "$(LUCY_OBJS)");

Reply via email to