| 27 | char *PMEM_DIR = const_cast<char *>("/tmp/"); |
| 28 | |
| 29 | int 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 | } |
nothing calls this directly
no test coverage detected