Move check for existence of generated tests from run-tests.py to presubmit.py
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 May 2014 13:18:13 +0000 (13:18 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 May 2014 13:18:13 +0000 (13:18 +0000)
Inspired by https://codereview.chromium.org/275143002#msg3

R=machenbach@chromium.org

Review URL: https://codereview.chromium.org/290023002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21341 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/presubmit.py
tools/run-tests.py

index 7961156..a4ca399 100755 (executable)
@@ -306,7 +306,8 @@ class SourceProcessor(SourceFileProcessor):
           if self.IgnoreDir(dir_part):
             break
         else:
-          if self.IsRelevant(file) and not self.IgnoreFile(file):
+          if (self.IsRelevant(file) and os.path.exists(file)
+              and not self.IgnoreFile(file)):
             result.append(join(path, file))
       if output.wait() == 0:
         return result
@@ -416,6 +417,13 @@ class SourceProcessor(SourceFileProcessor):
     return success
 
 
+def CheckGeneratedRuntimeTests(workspace):
+  code = subprocess.call(
+      [sys.executable, join(workspace, "tools", "generate-runtime-tests.py"),
+       "check"])
+  return code == 0
+
+
 def GetOptions():
   result = optparse.OptionParser()
   result.add_option('--no-lint', help="Do not run cpplint", default=False,
@@ -434,6 +442,7 @@ def Main():
   print "Running copyright header, trailing whitespaces and " \
         "two empty lines between declarations check..."
   success = SourceProcessor().Run(workspace) and success
+  success = CheckGeneratedRuntimeTests(workspace) and success
   if success:
     return 0
   else:
index 6b07574..cfca80f 100755 (executable)
@@ -336,13 +336,8 @@ def Main():
   workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), ".."))
   if not options.no_presubmit:
     print ">>> running presubmit tests"
-    code = subprocess.call(
+    exit_code = subprocess.call(
         [sys.executable, join(workspace, "tools", "presubmit.py")])
-    exit_code = code
-    code = subprocess.call(
-        [sys.executable, join(workspace, "tools", "generate-runtime-tests.py"),
-         "check"])
-    exit_code = exit_code or code
 
   suite_paths = utils.GetSuitePaths(join(workspace, "test"))