]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_journal: got rid of relative paths
authorAli Maredia <amaredia@redhat.com>
Thu, 4 Feb 2016 01:31:01 +0000 (20:31 -0500)
committerAli Maredia <amaredia@redhat.com>
Fri, 15 Apr 2016 00:48:21 +0000 (20:48 -0400)
Replaced .libs in TestClassHandler.cc with CEPH_LIB

Signed-off-by: Ali Maredia <amaredia@redhat.com>
src/test/journal/CMakeLists.txt
src/test/librados_test_stub/TestClassHandler.cc

index 07dbbc5de5488619f9023757b4741ecae08351cf..0fc9fe83fec27ef5114b61e769c180a0e4768600 100644 (file)
@@ -18,10 +18,11 @@ add_executable(unittest_journal EXCLUDE_FROM_ALL
   )
 add_ceph_unittest(unittest_journal ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_journal)
 target_link_libraries(unittest_journal 
+  journal
+  cls_journal
+  cls_journal_client
   rados_test_stub
   librados
   radostest
-  journal
-  cls_journal_client
   global 
   )
index 4f66e1effa8b6fe518220550467dc5327e28a1b2..22afad649faae53101d971add9f96fffdf182695 100644 (file)
@@ -6,6 +6,8 @@
 #include <boost/algorithm/string/predicate.hpp>
 #include <dlfcn.h>
 #include <errno.h>
+#include <stdlib.h>
+#include <string.h>
 #include "common/debug.h"
 #include "include/assert.h"
 
@@ -43,7 +45,8 @@ void TestClassHandler::open_class(const std::string& name,
 void TestClassHandler::open_all_classes() {
   assert(m_class_handles.empty());
 
-  DIR *dir = ::opendir(".libs");
+  string CEPH_LIB = getenv("CEPH_LIB");
+  DIR *dir = ::opendir(CEPH_LIB.c_str());
   if (dir == NULL) {
     assert(false);;
   }
@@ -58,7 +61,7 @@ void TestClassHandler::open_all_classes() {
       continue;
     }
     std::string class_name = name.substr(7, name.size() - 10);
-    open_class(class_name, ".libs/" + name);
+    open_class(class_name, CEPH_LIB + "/" + name);
   }
   closedir(dir);
 }