https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ff6b138117e2fc262b40e8ed1ac854591c3e75b0

commit ff6b138117e2fc262b40e8ed1ac854591c3e75b0
Author:     Mark Jansen <[email protected]>
AuthorDate: Tue Jun 23 23:45:42 2020 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Sat Jul 4 20:43:37 2020 +0200

    [ROSAUTOTEST] Add option to list all testable modules
---
 modules/rostests/rosautotest/CConfiguration.cpp |  7 ++++++-
 modules/rostests/rosautotest/CConfiguration.h   |  2 ++
 modules/rostests/rosautotest/CWineTest.cpp      | 10 ++++++++++
 modules/rostests/rosautotest/main.cpp           |  1 +
 4 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/modules/rostests/rosautotest/CConfiguration.cpp 
b/modules/rostests/rosautotest/CConfiguration.cpp
index f7e880d8221..8eee32dbb29 100644
--- a/modules/rostests/rosautotest/CConfiguration.cpp
+++ b/modules/rostests/rosautotest/CConfiguration.cpp
@@ -21,7 +21,8 @@ CConfiguration::CConfiguration()
       m_PrintToConsole(true),
       m_RepeatCount(1),
       m_Shutdown(false),
-      m_Submit(false)
+      m_Submit(false),
+      m_ListModules(false)
 {
     WCHAR WindowsDirectory[MAX_PATH];
     WCHAR Interactive[32];
@@ -100,6 +101,10 @@ CConfiguration::ParseParameters(int argc, wchar_t* argv[])
                     m_RepeatCount = tmp_RepeatCount;
                     break;
 
+                case 'l':
+                    m_ListModules = true;
+                    break;
+
                 default:
                     throw CInvalidParameterException();
             }
diff --git a/modules/rostests/rosautotest/CConfiguration.h 
b/modules/rostests/rosautotest/CConfiguration.h
index 4359f751dd2..684f4bbe9dc 100644
--- a/modules/rostests/rosautotest/CConfiguration.h
+++ b/modules/rostests/rosautotest/CConfiguration.h
@@ -15,6 +15,7 @@ private:
     unsigned long m_RepeatCount;
     bool m_Shutdown;
     bool m_Submit;
+    bool m_ListModules;
     string m_Comment;
     wstring m_Module;
     string m_Test;
@@ -35,6 +36,7 @@ public:
     bool IsInteractive() const { return m_IsInteractive; }
     bool IsReactOS() const { return m_IsReactOS; }
     unsigned long GetRepeatCount() const { return m_RepeatCount; }
+    bool ListModulesOnly() const { return m_ListModules; }
     const string& GetComment() const { return m_Comment; }
     const wstring& GetModule() const { return m_Module; }
     const string& GetTest() const { return m_Test; }
diff --git a/modules/rostests/rosautotest/CWineTest.cpp 
b/modules/rostests/rosautotest/CWineTest.cpp
index d734d2a0a22..42442ecb73b 100644
--- a/modules/rostests/rosautotest/CWineTest.cpp
+++ b/modules/rostests/rosautotest/CWineTest.cpp
@@ -213,6 +213,16 @@ CWineTest::GetNextTestInfo()
 {
     while(!m_CurrentFile.empty() || GetNextFile())
     {
+        /* The user asked for a list of all modules */
+        if (Configuration.ListModulesOnly())
+        {
+            std::stringstream ss;
+            ss << "Module: " << UnicodeToAscii(m_CurrentFile) << endl;
+            m_CurrentFile.clear();
+            StringOut(ss.str());
+            continue;
+        }
+
         try
         {
             while(GetNextTest())
diff --git a/modules/rostests/rosautotest/main.cpp 
b/modules/rostests/rosautotest/main.cpp
index 5061d7d664c..d671696e6d0 100644
--- a/modules/rostests/rosautotest/main.cpp
+++ b/modules/rostests/rosautotest/main.cpp
@@ -32,6 +32,7 @@ IntPrintUsage()
          << "    /w           - Submit the results to the webservice." << endl
          << "                   Requires a \"rosautotest.ini\" with valid 
login data." << endl
          << "                   Incompatible with the /r option." << endl
+         << "    /l           - List all modules that would run." << endl
          << endl
          << "  module:" << endl
          << "    The module to be tested (i.e. \"advapi32\")" << endl

Reply via email to