# unittest_ceph_crypto
add_executable(unittest_ceph_crypto
ceph_crypto.cc
- $<TARGET_OBJECTS:unit-main>
)
add_ceph_unittest(unittest_ceph_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_crypto)
target_link_libraries(unittest_ceph_crypto global)
#include "gtest/gtest.h"
+#include "common/ceph_argparse.h"
#include "common/ceph_crypto.h"
+#include "common/common_init.h"
+#include "global/global_init.h"
#include "global/global_context.h"
class CryptoEnvironment: public ::testing::Environment {
ASSERT_EXIT(do_simple_crypto(), ::testing::ExitedWithCode(0), "^$");
}
#endif //GTEST_HAS_DEATH_TEST
+
+int main(int argc, char **argv) {
+ std::vector<const char*> args(argv, argv + argc);
+ env_to_vec(args);
+ auto cct = global_init(NULL, args,
+ CEPH_ENTITY_TYPE_CLIENT,
+ CODE_ENVIRONMENT_UTILITY,
+ CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+ common_init_finish(g_ceph_context);
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}