[test] Fail when no tests are run

TBR=sergiyb@chromium.org

Bug: v8:7337
Change-Id: I1732f6e587305ce4ab41a65f73e943c7eb9e1d15
Reviewed-on: https://chromium-review.googlesource.com/877760
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50747}
diff --git a/tools/testrunner/standard_runner.py b/tools/testrunner/standard_runner.py
index 28192b9..dfef443 100755
--- a/tools/testrunner/standard_runner.py
+++ b/tools/testrunner/standard_runner.py
@@ -503,6 +503,7 @@
         verbose.PrintTestDurations(suites, runner.outputs, overall_duration)
 
       if num_tests == 0:
+        exit_code = 3
         print("Warning: no tests were run!")
 
       if exit_code == 1 and options.json_test_results:
@@ -588,7 +589,8 @@
         exit_code = 1
       if results.remaining:
         exit_code = 2
-
+      if not results.total:
+        exit_code = 3
 
       if exit_code == 1 and options.json_test_results:
         print("Force exit code 0 after failures. Json test results file "
diff --git a/tools/unittests/run_tests_test.py b/tools/unittests/run_tests_test.py
index f4ff3fe..d175a20 100755
--- a/tools/unittests/run_tests_test.py
+++ b/tools/unittests/run_tests_test.py
@@ -390,7 +390,7 @@
       else:
         self.assertIn('Running 1 base tests', result.stdout, result)
         self.assertIn('0 tests ran', result.stdout, result)
-      self.assertEqual(0, result.returncode, result)
+      self.assertEqual(3, result.returncode, result)
 
   def testDefaultProc(self):
     self.testDefault(infra_staging=True)
@@ -410,7 +410,7 @@
       else:
         self.assertIn('Running 0 base tests', result.stdout, result)
         self.assertIn('0 tests ran', result.stdout, result)
-      self.assertEqual(0, result.returncode, result)
+      self.assertEqual(3, result.returncode, result)
 
   def testNoBuildConfig(self):
     """Test failing run when build config is not found."""