Commits

Matt Oswald  committed 6c67a9a

if a test assembly fails to load, enforce a failing result

  • Participants
  • Parent commits 52783f0

Comments (0)

Files changed (1)

File xUnit++.console/main.cpp

     }
 
     int totalFailures = 0;
+    bool forcedFailure = false;
 
     for (const auto &lib : options.libraries)
     {
         if (testlib == nullptr)
         {
             std::cerr << "unable to load " << lib << std::endl;
+            forcedFailure = true;
             continue;
         }
 
         if (!enumerateTests)
         {
             std::cerr << "unable to load EnumerateTestDetails" << std::endl;
+            forcedFailure = true;
             continue;
         }
 
             if (!filteredTestRunner)
             {
                 std::cerr << "unable to get FilteredTestsRunner" << std::endl;
+                forcedFailure = true;
                 continue;
             }
 
         }
     }
 
-    return totalFailures;
+    return forcedFailure ? 1 : totalFailures;
 }