/** * Interface to other classes for running all desired Wine tests. */ void CWineTest::Run() { auto_ptr<CTestList> TestList; auto_ptr<CWebService> WebService; CTestInfo* TestInfo; SECURITY_ATTRIBUTES SecurityAttributes; /* Create a pipe for getting the output of the tests */ SecurityAttributes.nLength = sizeof(SecurityAttributes); SecurityAttributes.bInheritHandle = TRUE; SecurityAttributes.lpSecurityDescriptor = NULL; if(!CreatePipe(&m_hReadPipe, &m_hWritePipe, &SecurityAttributes, 0)) FATAL("CreatePipe failed\n"); m_StartupInfo.cb = sizeof(m_StartupInfo); m_StartupInfo.dwFlags = STARTF_USESTDHANDLES; m_StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); m_StartupInfo.hStdOutput = m_hWritePipe; m_StartupInfo.hStdError = m_hWritePipe; /* The virtual test list is of course faster, so it should be preferred over the journaled one. Enable the journaled one only in case ... - we're running under ReactOS (as the journal is only useful in conjunction with sysreg2) - we shall keep information for Crash Recovery - and the user didn't specify a module (then doing Crash Recovery doesn't really make sense) */ if(Configuration.IsReactOS() && Configuration.DoCrashRecovery() && Configuration.GetModule().empty()) { /* Use a test list with a permanent journal */ TestList.reset(new CJournaledTestList(this)); } else { /* Use the fast virtual test list with no additional overhead */ TestList.reset(new CVirtualTestList(this)); } /* Initialize the Web Service interface if required */ if(Configuration.DoSubmit()) WebService.reset(new CWebService()); /* Get information for each test to run */ while((TestInfo = TestList->GetNextTestInfo()) != 0) { auto_ptr<CTestInfo> TestInfoPtr(TestInfo); RunTest(TestInfo); if(Configuration.DoSubmit() && !TestInfo->Log.empty()) WebService->Submit("wine", TestInfo); StringOut("\n\n"); } }
/** * Interface to other classes for running all desired Wine tests. */ void CWineTest::Run() { auto_ptr<CTestList> TestList; auto_ptr<CWebService> WebService; CTestInfo* TestInfo; DWORD ErrorMode; /* The virtual test list is of course faster, so it should be preferred over the journaled one. Enable the journaled one only in case ... - we're running under ReactOS (as the journal is only useful in conjunction with sysreg2) - we shall keep information for Crash Recovery - and the user didn't specify a module (then doing Crash Recovery doesn't really make sense) */ if(Configuration.IsReactOS() && Configuration.DoCrashRecovery() && Configuration.GetModule().empty()) { /* Use a test list with a permanent journal */ TestList.reset(new CJournaledTestList(this)); } else { /* Use the fast virtual test list with no additional overhead */ TestList.reset(new CVirtualTestList(this)); } /* Initialize the Web Service interface if required */ if(Configuration.DoSubmit()) WebService.reset(new CWebService()); /* Disable error dialogs if we're running in non-interactive mode */ if(!Configuration.IsInteractive()) ErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); /* Get information for each test to run */ while((TestInfo = TestList->GetNextTestInfo()) != 0) { auto_ptr<CTestInfo> TestInfoPtr(TestInfo); RunTest(TestInfo); if(Configuration.DoSubmit() && !TestInfo->Log.empty()) WebService->Submit("wine", TestInfo); StringOut("\n\n"); } /* We're done with all tests. Finish this run */ if(Configuration.DoSubmit()) WebService->Finish("wine"); /* Restore the original error mode */ if(!Configuration.IsInteractive()) SetErrorMode(ErrorMode); }