]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: fix for unittest_async_compressor 8820/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 29 Apr 2016 17:34:59 +0000 (13:34 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 29 Apr 2016 17:42:12 +0000 (13:42 -0400)
this test wasn't creating the lib/compressor subdirectory, so it
depended on test_compressor_plugin_zlib or test_compressor_plugin_snappy
being run first

added the same dirty hack to copy libceph_snappy.so into lib/compressor,
and added a dependency on ceph_snappy to make sure it's built

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/test/common/CMakeLists.txt
src/test/common/test_async_compressor.cc

index 85abb403ce426b075dc9e5da0127a48290f2e052..89a8a3ccd75f11d334dc0b5901b8e4a71d8a2f97 100644 (file)
@@ -160,6 +160,7 @@ add_executable(unittest_async_compressor EXCLUDE_FROM_ALL
 )
 add_ceph_unittest(unittest_async_compressor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_async_compressor)
 target_link_libraries(unittest_async_compressor global)
+add_dependencies(unittest_async_compressor ceph_snappy)
 
 # unittest_interval_set
 add_executable(unittest_interval_set EXCLUDE_FROM_ALL
index 4ea8dc5a951790461a24cb2a972b98e283ab0028..677a410302c87f731074832a6da6851562228ad6 100644 (file)
@@ -212,6 +212,17 @@ int main(int argc, char **argv) {
 
   const char* env = getenv("CEPH_LIB");
   string directory(env ? env : "lib");
+
+  // copy libceph_snappy.so into $plugin_dir/compressor for PluginRegistry
+  // TODO: just build the compressor plugins in this subdir
+  string mkdir_compressor = "mkdir -p " + directory + "/compressor";
+  int r = system(mkdir_compressor.c_str());
+  (void)r;
+
+  string cp_libceph_snappy = "cp " + directory + "/libceph_snappy.so* " + directory + "/compressor/";
+  r = system(cp_libceph_snappy.c_str());
+  (void)r;
+
   g_conf->set_val("plugin_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);