OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Presubmit script for changes affecting extensions docs server | 5 """Presubmit script for changes affecting extensions docs server |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into gcl. | 8 for more details about the presubmit API built into gcl. |
9 """ | 9 """ |
10 | 10 |
11 # Run build_server so that files needed by tests are copied to the local | 11 # Run build_server so that files needed by tests are copied to the local |
12 # third_party directory. | 12 # third_party directory. |
13 import sys | 13 import sys |
14 sys.path.insert(0, '.') | 14 sys.path.insert(0, '.') |
15 import build_server | 15 import build_server |
16 build_server.main() | 16 build_server.main() |
17 sys.path.pop(0) | 17 sys.path.pop(0) |
18 | 18 |
19 # TODO(cduvall) Include integration_test.py again. | 19 WHITELIST = [ r'.+_test.py$' ] |
20 WHITELIST = [ r'^[^i].+_test.py$' ] | |
21 | 20 |
22 def CheckChangeOnUpload(input_api, output_api): | 21 def CheckChangeOnUpload(input_api, output_api): |
23 return input_api.canned_checks.RunUnitTestsInDirectory( | 22 return input_api.canned_checks.RunUnitTestsInDirectory( |
24 input_api, output_api, '.', whitelist=WHITELIST) | 23 input_api, output_api, '.', whitelist=WHITELIST) |
25 | 24 |
26 def CheckChangeOnCommit(input_api, output_api): | 25 def CheckChangeOnCommit(input_api, output_api): |
27 return input_api.canned_checks.RunUnitTestsInDirectory( | 26 return input_api.canned_checks.RunUnitTestsInDirectory( |
28 input_api, output_api, '.', whitelist=WHITELIST) | 27 input_api, output_api, '.', whitelist=WHITELIST) |
OLD | NEW |