MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / main

Function main

deps/memkind/src/test/main.cpp:29–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27char *PMEM_DIR = const_cast<char *>("/tmp/");
28
29int main(int argc, char **argv)
30{
31 int opt = 0;
32 struct stat st;
33
34 testing::InitGoogleTest(&argc, argv);
35
36 if (testing::GetGtestHelpFlag()) {
37 printf("\nMemkind options:\n"
38 "-d <directory_path> change directory on which PMEM kinds\n"
39 " are created (default /tmp/)\n");
40 return 0;
41 }
42
43 while ((opt = getopt(argc, argv, "d:")) != -1) {
44 switch (opt) {
45 case 'd':
46 PMEM_DIR = optarg;
47
48 if (stat(PMEM_DIR, &st) != 0 || !S_ISDIR(st.st_mode)) {
49 printf("%s : Error in getting path status or"
50 " invalid or non-existent directory\n", PMEM_DIR);
51 return -1;
52 }
53
54 break;
55 default:
56 return -1;
57 }
58 }
59
60 return RUN_ALL_TESTS();
61}

Callers

nothing calls this directly

Calls 4

InitGoogleTestFunction · 0.85
GetGtestHelpFlagFunction · 0.85
RUN_ALL_TESTSFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected