]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/unit.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2011 New Dream Network
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_UNIT_TEST_H
16 #define CEPH_UNIT_TEST_H
18 #include "include/types.h" // FIXME: ordering shouldn't be important, but right
19 // now, this include has to come before the others.
21 #include "common/ceph_argparse.h"
22 #include "common/code_environment.h"
23 #include "common/config.h"
24 #include "global/global_context.h"
25 #include "global/global_init.h"
26 #include "include/msgr.h" // for CEPH_ENTITY_TYPE_CLIENT
27 #include "gtest/gtest.h"
32 * You only need to include this file if you are testing Ceph internal code. If
33 * you are testing library code, the library init() interfaces will handle
34 * initialization for you.
36 int main(int argc
, char **argv
) {
37 std::vector
<const char*> args(argv
, argv
+ argc
);
38 auto cct
= global_init(NULL
, args
,
39 CEPH_ENTITY_TYPE_CLIENT
,
40 CODE_ENVIRONMENT_UTILITY
,
41 CINIT_FLAG_NO_MON_CONFIG
);
42 common_init_finish(g_ceph_context
);
44 ::testing::InitGoogleTest(&argc
, argv
);
45 return RUN_ALL_TESTS();