From: Casey Bodley Date: Fri, 29 Apr 2016 17:34:59 +0000 (-0400) Subject: cmake: fix for unittest_async_compressor X-Git-Tag: v11.0.0~791^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d1801ebbbc207fc5af22efa64925b376a227d9c;p=ceph.git cmake: fix for unittest_async_compressor 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 --- diff --git a/src/test/common/CMakeLists.txt b/src/test/common/CMakeLists.txt index 85abb403ce42..89a8a3ccd75f 100644 --- a/src/test/common/CMakeLists.txt +++ b/src/test/common/CMakeLists.txt @@ -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 diff --git a/src/test/common/test_async_compressor.cc b/src/test/common/test_async_compressor.cc index 4ea8dc5a9517..677a410302c8 100644 --- a/src/test/common/test_async_compressor.cc +++ b/src/test/common/test_async_compressor.cc @@ -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);