Browse Source

BUG: better error handling

Ken Martin 20 years ago
parent
commit
4baa085a1a
1 changed files with 13 additions and 0 deletions
  1. 13 0
      Source/cmCTest.cxx

+ 13 - 0
Source/cmCTest.cxx

@@ -1806,6 +1806,19 @@ int cmCTest::RunCMakeAndTest(std::string* outstring)
   double timeout = m_TimeOut;
   int retVal = 0;
   
+  // if the generator and make program are not specified then it is an error
+  if (!m_BuildGenerator.size() || !m_BuildMakeProgram.size())
+    {
+    if(outstring)
+      {
+      *outstring =  
+        "--build-and-test requires that both the generator and makeprogram "
+        "be provided using the --build-generator and --build-makeprogram "
+        "command line options. ";
+      }
+    return 1;
+    }
+    
   // default to the build type of ctest itself
   if(m_ConfigType.size() == 0)
     {