MCPcopy Create free account
hub / github.com/Kitware/CMake / main

Function main

Source/kwsys/testProcess.c:567–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567int main(int argc, char const* argv[])
568{
569 int n = 0;
570
571#ifdef _WIN32
572 int i;
573 char new_args[10][_MAX_PATH];
574 LPWSTR* w_av = CommandLineToArgvW(GetCommandLineW(), &argc);
575 for (i = 0; i < argc; i++) {
576 kwsysEncoding_wcstombs(new_args[i], w_av[i], _MAX_PATH);
577 argv[i] = new_args[i];
578 }
579 LocalFree(w_av);
580#endif
581
582#if 0
583 {
584 HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
585 DuplicateHandle(GetCurrentProcess(), out,
586 GetCurrentProcess(), &out, 0, FALSE,
587 DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
588 SetStdHandle(STD_OUTPUT_HANDLE, out);
589 }
590 {
591 HANDLE out = GetStdHandle(STD_ERROR_HANDLE);
592 DuplicateHandle(GetCurrentProcess(), out,
593 GetCurrentProcess(), &out, 0, FALSE,
594 DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
595 SetStdHandle(STD_ERROR_HANDLE, out);
596 }
597#endif
598 if (argc == 2) {
599 n = atoi(argv[1]);
600 } else if (argc == 3 && strcmp(argv[1], "run") == 0) {
601 n = atoi(argv[2]);
602 }
603 /* Check arguments. */
604 if (((n >= 1 && n <= 10) || n == 108 || n == 109 || n == 110) && argc == 3) {
605 /* This is the child process for a requested test number. */
606 switch (n) {
607 case 1:
608 return test1(argc, argv);
609 case 2:
610 return test2(argc, argv);
611 case 3:
612 return test3(argc, argv);
613 case 4:
614 return test4(argc, argv);
615 case 5:
616 return test5(argc, argv);
617 case 6:
618 test6(argc, argv);
619 return 0;
620 case 7:
621 return test7(argc, argv);
622 case 8:
623 return test8(argc, argv);
624 case 9:

Callers

nothing calls this directly

Calls 15

kwsysEncoding_wcstombsFunction · 0.85
test3Function · 0.85
test4Function · 0.85
test5Function · 0.85
test6Function · 0.85
test7Function · 0.85
test8Function · 0.85
test9Function · 0.85
test10Function · 0.85
test8_grandchildFunction · 0.85
test9_grandchildFunction · 0.85
test10_grandchildFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…