MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / main

Function main

server/fakerut.cpp:3718–3792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3716
3717
3718int main(int argc, char **argv)
3719{
3720 int ret = 0, nThreads = DEFTHREADS;
3721 bool doStereo = true, doMultisample = true, doDBPixmap = true,
3722 doCopyContext = true, doUseXFont = true, doSelectEvent = false,
3723 doNamedFB = true;
3724
3725 if(putenv((char *)"VGL_AUTOTEST=1") == -1
3726 || putenv((char *)"VGL_SPOIL=0") == -1
3727 || putenv((char *)"VGL_XVENDOR=Spacely Sprockets, Inc.") == -1
3728 || putenv((char *)"VGL_GLXVENDOR=Slate Rock and Gravel Company"))
3729 {
3730 printf("putenv() failed!\n"); return -1;
3731 }
3732
3733 if(argc > 1) for(int i = 1; i < argc; i++)
3734 {
3735 if(!strcasecmp(argv[i], "-h") || !strcmp(argv[i], "-?")) usage(argv);
3736 else if(!strcasecmp(argv[i], "-n") && i < argc - 1)
3737 {
3738 nThreads = atoi(argv[++i]);
3739 if(nThreads < 0 || nThreads > MAXTHREADS) usage(argv);
3740 }
3741 else if(!strcasecmp(argv[i], "-nostereo")) doStereo = false;
3742 else if(!strcasecmp(argv[i], "-nomultisample")) doMultisample = false;
3743 else if(!strcasecmp(argv[i], "-nodbpixmap")) doDBPixmap = false;
3744 else if(!strcasecmp(argv[i], "-nocopycontext")) doCopyContext = false;
3745 else if(!strcasecmp(argv[i], "-nousexfont")) doUseXFont = false;
3746 else if(!strcasecmp(argv[i], "-nonamedfb")) doNamedFB = false;
3747 else if(!strcasecmp(argv[i], "-selectevent")) doSelectEvent = true;
3748 else usage(argv);
3749 }
3750
3751 // Intentionally leave a pending dlerror()
3752 dlsym(RTLD_NEXT, "ifThisSymbolExistsI'llEatMyHat");
3753 dlsym(RTLD_NEXT, "ifThisSymbolExistsI'llEatMyHat2");
3754
3755 if(!XInitThreads())
3756 THROW("XInitThreads() failed");
3757 if(!extensionQueryTest()) ret = -1;
3758 printf("\n");
3759 if(!procAddrTest()) ret = -1;
3760 printf("\n");
3761 if(!readbackTest(false, doNamedFB)) ret = -1;
3762 printf("\n");
3763 if(doStereo)
3764 {
3765 if(!readbackTest(true, doNamedFB)) ret = -1;
3766 printf("\n");
3767 }
3768 if(doMultisample)
3769 {
3770 if(!readbackTestMS()) ret = -1;
3771 printf("\n");
3772 }
3773 if(!contextMismatchTest()) ret = -1;
3774 printf("\n");
3775 if(doCopyContext)

Callers

nothing calls this directly

Calls 12

readbackTestMSFunction · 0.85
contextMismatchTestFunction · 0.85
copyContextTestFunction · 0.85
flushTestFunction · 0.85
subWinTestFunction · 0.85
usageFunction · 0.70
extensionQueryTestFunction · 0.70
procAddrTestFunction · 0.70
readbackTestFunction · 0.70
visTestFunction · 0.70
multiThreadTestFunction · 0.70
offScreenTestFunction · 0.70

Tested by

no test coverage detected