Set exitcode on generic runner if no output log folder is provided.

This is a temporary way to ensure the bots will fail on these test suites until
the test matrix provides the output directory. At that point, the .json files
will be used to track test failures and the exit code is no longer necessary

TBR=vsm@google.com

Change-Id: Ie96c3835760de02addc89f7ccbcb3ccb04c21940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
diff --git a/pkg/modular_test/lib/src/generic_runner.dart b/pkg/modular_test/lib/src/generic_runner.dart
index 7a3786c..fae48d8 100644
--- a/pkg/modular_test/lib/src/generic_runner.dart
+++ b/pkg/modular_test/lib/src/generic_runner.dart
@@ -116,7 +116,15 @@
     testOutcomes.add(outcome);
   }
 
-  if (options.logDir == null) return;
+  if (options.logDir == null) {
+    // TODO(sigmund): delete. This is only added to ensure the bots show test
+    // failures until support for `--output-directory` is added to the test
+    // matrix.
+    if (testOutcomes.any((o) => !o.matchedExpectations)) {
+      exitCode = 1;
+    }
+    return;
+  }
 
   List<String> results = [];
   List<String> logs = [];