Author: tfaber Date: Sat Feb 28 21:29:44 2015 New Revision: 66506
URL: http://svn.reactos.org/svn/reactos?rev=66506&view=rev Log: [ROSAUTOTEST] - Disable error dialogs unless running in interactive mode ONLINE-441
Modified: trunk/rostests/rosautotest/CConfiguration.cpp trunk/rostests/rosautotest/CConfiguration.h trunk/rostests/rosautotest/CWineTest.cpp
Modified: trunk/rostests/rosautotest/CConfiguration.cpp URL: http://svn.reactos.org/svn/reactos/trunk/rostests/rosautotest/CConfiguration... ============================================================================== --- trunk/rostests/rosautotest/CConfiguration.cpp [iso-8859-1] (original) +++ trunk/rostests/rosautotest/CConfiguration.cpp [iso-8859-1] Sat Feb 28 21:29:44 2015 @@ -17,17 +17,22 @@ */ CConfiguration::CConfiguration() : m_CrashRecovery(false), + m_IsInteractive(false), m_PrintToConsole(true), m_Shutdown(false), m_Submit(false) { WCHAR WindowsDirectory[MAX_PATH]; + WCHAR Interactive[32];
/* Check if we are running under ReactOS from the SystemRoot directory */ if(!GetWindowsDirectoryW(WindowsDirectory, MAX_PATH)) FATAL("GetWindowsDirectoryW failed");
m_IsReactOS = !_wcsnicmp(&WindowsDirectory[3], L"reactos", 7); + + if(GetEnvironmentVariableW(L"WINETEST_INTERACTIVE", Interactive, _countof(Interactive))) + m_IsInteractive = _wtoi(Interactive); }
/**
Modified: trunk/rostests/rosautotest/CConfiguration.h URL: http://svn.reactos.org/svn/reactos/trunk/rostests/rosautotest/CConfiguration... ============================================================================== --- trunk/rostests/rosautotest/CConfiguration.h [iso-8859-1] (original) +++ trunk/rostests/rosautotest/CConfiguration.h [iso-8859-1] Sat Feb 28 21:29:44 2015 @@ -9,6 +9,7 @@ { private: bool m_CrashRecovery; + bool m_IsInteractive; bool m_IsReactOS; bool m_PrintToConsole; bool m_Shutdown; @@ -30,6 +31,7 @@ bool DoPrint() const { return m_PrintToConsole; } bool DoShutdown() const { return m_Shutdown; } bool DoSubmit() const { return m_Submit; } + bool IsInteractive() const { return m_IsInteractive; } bool IsReactOS() const { return m_IsReactOS; } const string& GetComment() const { return m_Comment; } const wstring& GetModule() const { return m_Module; }
Modified: trunk/rostests/rosautotest/CWineTest.cpp URL: http://svn.reactos.org/svn/reactos/trunk/rostests/rosautotest/CWineTest.cpp?... ============================================================================== --- trunk/rostests/rosautotest/CWineTest.cpp [iso-8859-1] (original) +++ trunk/rostests/rosautotest/CWineTest.cpp [iso-8859-1] Sat Feb 28 21:29:44 2015 @@ -248,9 +248,14 @@ } catch(CTestException& e) { + stringstream ss; + + ss << "An exception occurred trying to list tests for: " << UnicodeToAscii(m_CurrentFile) << endl; + StringOut(ss.str()); + StringOut(e.GetMessage()); + StringOut("\n"); + m_CurrentFile.clear(); delete[] m_ListBuffer; - StringOut(e.GetMessage()); - m_CurrentFile.clear(); } }
@@ -327,6 +332,7 @@ 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. @@ -349,6 +355,10 @@ 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) { @@ -361,4 +371,8 @@
StringOut("\n\n"); } -} + + /* Restore the original error mode */ + if(!Configuration.IsInteractive()) + SetErrorMode(ErrorMode); +}