ceph_test_rados_api_list: parse env

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-04-03 09:45:23 -04:00
parent b9b07c13e4
commit 769c0affc4
2 changed files with 20 additions and 1 deletions

View File

@ -234,7 +234,7 @@ ceph_test_rados_api_aio_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_rados_api_aio
ceph_test_rados_api_list_SOURCES = test/librados/list.cc
ceph_test_rados_api_list_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
ceph_test_rados_api_list_LDADD = $(LIBRADOS) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD) $(CEPH_GLOBAL)
ceph_test_rados_api_list_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_rados_api_list

View File

@ -5,6 +5,10 @@
#include "include/stringify.h"
#include "test/librados/test.h"
#include "test/librados/TestCase.h"
#include "global/global_context.h"
#include "global/global_init.h"
#include "common/ceph_argparse.h"
#include "common/common_init.h"
#include "include/types.h"
#include "common/hobject.h"
@ -956,3 +960,18 @@ TEST_F(LibRadosListPP, EnumerateObjectsFilterPP) {
#pragma GCC diagnostic pop
#pragma GCC diagnostic warning "-Wpragmas"
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
vector<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);
cout << args << std::endl;
global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
common_init_finish(g_ceph_context);
return RUN_ALL_TESTS();
}