diff options
author | Ben Murdoch <benm@google.com> | 2017-01-17 12:11:28 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2017-01-18 14:32:11 +0000 |
commit | f3b273f5e6ffd2f6ba1c18a27a17db41dfb113c3 (patch) | |
tree | e748f964837dfc9e4b961000ddacb2965c629d9f /PRESUBMIT.py | |
parent | a7e90cde16bf95fddae4a5156268e449da86ee36 (diff) | |
download | v8-f3b273f5e6ffd2f6ba1c18a27a17db41dfb113c3.tar.gz |
Merge V8 5.5.372.32
Test: Manual, built and ran D8
Change-Id: I831a5491f74342c2675bb6fe1e24a2258e493758
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 5255ca11..78e7482e 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -216,6 +216,38 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): return [] +def _CheckMissingFiles(input_api, output_api): + """Runs verify_source_deps.py to ensure no files were added that are not in + GN. + """ + # We need to wait until we have an input_api object and use this + # roundabout construct to import checkdeps because this file is + # eval-ed and thus doesn't have __file__. + original_sys_path = sys.path + try: + sys.path = sys.path + [input_api.os_path.join( + input_api.PresubmitLocalPath(), 'tools')] + from verify_source_deps import missing_gn_files, missing_gyp_files + finally: + # Restore sys.path to what it was before. + sys.path = original_sys_path + + gn_files = missing_gn_files() + gyp_files = missing_gyp_files() + results = [] + if gn_files: + results.append(output_api.PresubmitError( + "You added one or more source files but didn't update the\n" + "corresponding BUILD.gn files:\n", + gn_files)) + if gyp_files: + results.append(output_api.PresubmitError( + "You added one or more source files but didn't update the\n" + "corresponding gyp files:\n", + gyp_files)) + return results + + def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] @@ -231,6 +263,7 @@ def _CommonChecks(input_api, output_api): _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api)) results.extend( _CheckNoInlineHeaderIncludesInNormalHeaders(input_api, output_api)) + results.extend(_CheckMissingFiles(input_api, output_api)) return results |